Changeset 281 for trunk/GSASIIIO.py


Ignore:
Timestamp:
May 4, 2011 4:18:44 PM (11 years ago)
Author:
vondreele
Message:

implement reusable GSAS-II image files that can be read into a new project.
fix order of color schemes in contour plots
fix azimuth values from image integration
fix use of correct data structure for calculat all pdfs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r273 r281  
    448448        Comments,Data,Npix,Image = GetGEsumData(imagefile)
    449449    elif ext == '.G2img':
    450         return GetG2Image(imagefile)
     450        Comments,Data,Npix,Image = GetG2Image(imagefile)
    451451    if imageOnly:
    452452        return Image
     
    454454        return Comments,Data,Npix,Image
    455455       
    456 def PutG2Image(filename,image):
     456def PutG2Image(filename,Comments,Data,Npix,image):
    457457    File = open(filename,'wb')
    458     cPickle.dump(image,File,1)
     458    cPickle.dump([Comments,Data,Npix,image],File,1)
    459459    File.close()
    460460    return
     
    462462def GetG2Image(filename):
    463463    File = open(filename,'rb')
    464     image = cPickle.load(File)
     464    Comments,Data,Npix,image = cPickle.load(File)
    465465    File.close()
    466     return image
     466    return Comments,Data,Npix,image
    467467   
    468468def GetGEsumData(filename,imageOnly=False):
     
    783783       
    784784def SaveIntegration(self,PickId,data):
    785     azms = self.Integrate[1]
     785    azms = self.Integrate[1][:-1]
    786786    X = self.Integrate[2][:-1]
    787787    Xminmax = [X[0],X[-1]]
     
    793793    names = ['Type','Lam','Zero','Polariz.','U','V','W','X','Y','SH/L','Azimuth']
    794794    codes = [0 for i in range(11)]
    795     Azms = [(azms[i+1]+azms[i])/2. for i in range(len(azms)-1)]
     795    LRazm = data['LRazimuth']
    796796    if data['fullIntegrate'] and data['outAzimuths'] == 1:
    797         Azms = [0.0,]
    798     for i,azm in enumerate(Azms):
     797        Azms = [45.0,]                              #a poor man's average?
     798    for i,azm in enumerate(azms):
    799799        item, cookie = self.PatternTree.GetFirstChild(self.root)
    800800        Id = 0
Note: See TracChangeset for help on using the changeset viewer.