Changeset 397 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Oct 21, 2011 12:15:50 PM (10 years ago)
Author:
vondreele
Message:

collect default settings for Sample in one routine
add recalibrate routine for images
azimuths from image integration are now the center angle of each azimuth bin
put in 1/2 pixel offset in image calibration/integration calcs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r391 r397  
    1919import GSASIIspc as G2spc
    2020import GSASIIlattice as G2lat
     21import GSASIIpwdGUI as G2pdG
    2122import GSASIIElem as G2el
    2223import os.path as ospath
     
    848849       
    849850def SaveIntegration(self,PickId,data):
    850     azms = self.Integrate[1][:-1]
     851    azms = self.Integrate[1]
    851852    X = self.Integrate[2][:-1]
    852853    Xminmax = [X[0],X[-1]]
     
    859860    codes = [0 for i in range(11)]
    860861    LRazm = data['LRazimuth']
     862    Azms = []
    861863    if data['fullIntegrate'] and data['outAzimuths'] == 1:
    862864        Azms = [45.0,]                              #a poor man's average?
    863     for i,azm in enumerate(azms):
     865    else:
     866        for i,azm in enumerate(azms[:-1]):
     867            Azms.append((azms[i+1]+azm)/2.)
     868    for i,azm in enumerate(azms[:-1]):
    864869        item, cookie = self.PatternTree.GetFirstChild(self.root)
    865870        Id = 0
     
    869874                Id = item
    870875            item, cookie = self.PatternTree.GetNextChild(self.root, cookie)
    871         parms = ['PXC',data['wavelength'],0.0,0.99,1.0,-0.10,0.4,0.30,1.0,0.0001,azm]    #set polarization for synchrotron radiation!
     876        parms = ['PXC',data['wavelength'],0.0,0.99,1.0,-0.10,0.4,0.30,1.0,0.0001,Azms[i]]    #set polarization for synchrotron radiation!
    872877        Y = self.Integrate[0][i]
    873878        W = 1./Y                    #probably not true
    874         Sample = {'Scale':[1.0,True],'Type':'Debye-Scherrer','Absorption':[0.0,False],'DisplaceX':[0.0,False],
    875             'DisplaceY':[0.0,False],'Diffuse':[],'Temperature':300.,'Pressure':1.0,'Humidity':0.0,'Voltage':0.0,'Force':0.0}
     879        Sample = G2pdG.SetDefaultSample()
    876880        if Id:
    877881            self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id, 'Comments'),Comments)                   
     
    884888            self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id,'Reflection Lists'),{})             
    885889        else:
    886             Id = self.PatternTree.AppendItem(parent=self.root,text=name+" Azm= %.2f"%(azm))
     890            Id = self.PatternTree.AppendItem(parent=self.root,text=name+" Azm= %.2f"%(Azms[i]))
    887891            self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Comments'),Comments)                   
    888892            self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Limits'),[tuple(Xminmax),Xminmax])
Note: See TracChangeset for help on using the changeset viewer.