Changeset 1364 for trunk/GSASIIIO.py


Ignore:
Timestamp:
May 27, 2014 12:14:59 PM (8 years ago)
Author:
vondreele
Message:

read TOPAZ structure factor files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1359 r1364  
    16061606    and set :attr:`Parameters` with the instrument parameters
    16071607    (initialized with :meth:`InitParameters` and set with :meth:`UpdateParameters`).
    1608     Also, set :attr:`Controls`,
    1609     which specifies how the histogram is plotted
    1610     (initialized with :meth:`InitControls` and set with :meth:`UpdateControls`).
    16111608    '''
    16121609    def __init__(self,formatName,longFormatName=None,extensionlist=[],
     
    16191616        'self.Parameters is a list with two dicts for data parameter settings'
    16201617        self.InitParameters()
    1621         self.Controls = {}
    1622         'self.Controls is a dict with plotting controls'
    1623         self.InitControls() # initialize the above
    16241618        self.RefDict = {'RefList':[],'FF':[]}
     1619        self.Banks = []             #for multi bank data (usually TOF)
    16251620        '''self.RefDict is a dict containing the reflection information, as read from the file.
    16261621        Item 'RefList' contains the reflection information. See the
     
    16341629        ImportBaseclass.ReInitialize(self)
    16351630        self.InitParameters()
    1636         self.InitControls()
    16371631        self.RefDict = {'RefList':[],'FF':[]}
    1638 
    16391632       
    1640     def InitControls(self):
    1641         'initialize the controls structure'
    1642         self.Controls = { # dictionary with plotting controls
    1643             'Type' : 'Fosq',
    1644             'ifFc' : False,    #
    1645             'HKLmax' : [None,None,None],
    1646             'HKLmin' : [None,None,None],
    1647             'FoMax' : None,   # maximum observed structure factor as Fo
    1648             'Zone' : '001',
    1649             'Layer' : 0,
    1650             'Scale' : 1.0,
    1651             }
    1652 
    16531633    def InitParameters(self):
    16541634        'initialize the instrument parameters structure'
     
    16661646        if Wave is not None:
    16671647            self.Parameters[0]['Lam'] = [Wave,Wave]
    1668            
    1669     def UpdateControls(self,Type='Fosq',FcalcPresent=False):
    1670         '''Scan through the reflections to update the Controls dictionary
    1671         '''
    1672         self.Controls['Type'] = Type
    1673         self.Controls['ifFc'] = FcalcPresent
    1674         HKLmax = [None,None,None]
    1675         HKLmin = [None,None,None]
    1676         Fo2max = None
    1677         for refl in self.RefDict['RefList']:
    1678             HKL = refl[:3]
    1679             if Fo2max is None:
    1680                 Fo2max = refl[8]
    1681             else:
    1682                 Fo2max = max(Fo2max,refl[8])
    1683             for i,hkl in enumerate(HKL):
    1684                 if HKLmax[i] is None:
    1685                     HKLmax[i] = hkl
    1686                     HKLmin[i] = hkl
    1687                 else:
    1688                     HKLmax[i] = max(HKLmax[i],hkl)
    1689                     HKLmin[i] = min(HKLmin[i],hkl)
    1690         self.Controls['HKLmax'] = HKLmax
    1691         self.Controls['HKLmin'] = HKLmin
    1692         if Type ==  'Fosq':
    1693             self.Controls['FoMax'] = np.sqrt(Fo2max)
    1694         elif Type ==  'Fo':
    1695             self.Controls['FoMax'] = Fo2max
    1696         else:
    1697             print "Unsupported Struct Fact type in ImportStructFactor.UpdateControls"
    1698             raise Exception,"Unsupported Struct Fact type in ImportStructFactor.UpdateControls"
    1699 
     1648                       
    17001649######################################################################
    17011650class ImportPowderData(ImportBaseclass):
Note: See TracChangeset for help on using the changeset viewer.