Changeset 2147 for trunk/GSASII.py


Ignore:
Timestamp:
Feb 13, 2016 9:12:07 AM (6 years ago)
Author:
vondreele
Message:

handle TOF profile type=2 iparm files (e.g. for GEM)
implement multibank instprm files - add Save all profiles to Instrument parameters MenuBinding?
Do the Load profile to handle these - modifications to OnLoad?
add common transformation matrices to MergeDialog?
add bank no. to ReadPowderInstprm? call for matching it - in progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2141 r2147  
    952952        return lines       
    953953           
    954     def ReadPowderInstprm(self,instLines):
     954    def ReadPowderInstprm(self,instLines,bank):
    955955        '''Read lines from a GSAS-II (new) instrument parameter file
     956        similar to G2pwdGUI.OnLoad
     957        If instprm file has multiple banks each with header #Bank n: ..., this
     958        finds matching bank no. to load - rejects nonmatches.
    956959
    957960        :param list instLines: strings from GSAS-II parameter file; can be concatenated with ';'
     961        :param int  bank: bank number to check when instprm file has '#BANK n:...' strings
     962            when bank = n then use parameters; otherwise skip that set. Ignored if BANK n:
     963            not present. NB: this kind of instprm file made by a Save all profile command in Instrument Parameters
    958964
    959965        '''
     
    962968        newItems = []
    963969        newVals = []
     970        Found = False
    964971        for S in instLines:
    965972            if S[0] == '#':
     
    11481155                            s = Iparm['INS  1PRCF 2'].split()
    11491156                            data.extend([0.0,0.0,G2IO.sfloat(s[0]),G2IO.sfloat(s[1]),0.0,0.0,0.0,azm])    #beta-q, sig-0, sig-1, sig-2, sig-q, X, Y                       
     1157                    elif abs(pfType) == 2:
     1158                        data.extend([G2IO.sfloat(s[1]),0.0,1./G2IO.sfloat(s[3])]) #alpha, beta-0, beta-1
     1159                        data.extend([0.0,0.0,G2IO.sfloat(s[1]),0.0,0.0,0.0,0.0,azm])    #beta-q, sig-0, sig-1, sig-2, sig-q, X, Y                           
    11501160                else:
    11511161                    s = Iparm['INS  1PRCF1 '].split()
     
    12221232                instParmList = None
    12231233                if Lines is not None:
    1224                     instParmList = self.ReadPowderInstprm(Lines)
     1234                    instParmList = self.ReadPowderInstprm(Lines,bank)    #know Bank - see above
    12251235                if instParmList is not None:
    12261236                    rd.instfile = instfile
     
    12441254            instParmList = None
    12451255            if Lines is not None:
    1246                 instParmList = self.ReadPowderInstprm(Lines)
     1256                instParmList = self.ReadPowderInstprm(Lines,bank)    #know Bank - see above
    12471257            if instParmList is not None:
    12481258                rd.instfile = instfile
     
    12721282                    instParmList = None
    12731283                    if Lines is not None:
    1274                         instParmList = self.ReadPowderInstprm(Lines)
     1284                        instParmList = self.ReadPowderInstprm(Lines,bank)    #know Bank - see above
    12751285                    if instParmList is not None:
    12761286                        rd.instfile = instfile
     
    13061316            instParmList = None
    13071317            if Lines is not None:
    1308                 instParmList = self.ReadPowderInstprm(Lines)
     1318                instParmList = self.ReadPowderInstprm(Lines,bank)    #know Bank - see above
    13091319            if instParmList is not None:
    13101320                rd.instfile = instfile
     
    13381348            rd.instfile = ''
    13391349            rd.instmsg = 'default: '+dI.defaultIparm_lbl[res]
    1340             return self.ReadPowderInstprm(dI.defaultIparms[res])
     1350            return self.ReadPowderInstprm(dI.defaultIparms[res],bank)    #know Bank - see above
    13411351
    13421352    def OnImportPowder(self,event):
Note: See TracChangeset for help on using the changeset viewer.