Changeset 2026 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Oct 28, 2015 5:32:01 PM (6 years ago)
Author:
toby
Message:

autoint minimal, but ready for testing; fixes to Exports

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r2015 r2026  
    277277    Comments,Data,Npix,Image = GetImageData(G2frame,imagefile)
    278278    if Comments:
    279         LoadImage(imagefile,G2frame,Comments,Data,Npix,Image)
     279        LoadImage2Tree(imagefile,G2frame,Comments,Data,Npix,Image)
    280280   
    281 def LoadImage(imagefile,G2frame,Comments,Data,Npix,Image):
     281def LoadImage2Tree(imagefile,G2frame,Comments,Data,Npix,Image):
    282282    '''Load an image into the tree
    283283    '''
     
    12691269                Azms.append(G2img.meanAzm(azm,azms[i+1]))
    12701270        dazm = np.min(np.abs(np.diff(azms)))/2.
     1271    G2frame.IntgOutList = []
    12711272    for i,azm in enumerate(azms[:-1]):
    12721273        Aname = name+" Azm= %.2f"%((azm+dazm)%360.)
     
    12941295        W = np.where(Y>0.,1./Y,1.e-6)                    #probably not true
    12951296        Id = G2frame.PatternTree.AppendItem(parent=G2frame.root,text=Aname)
     1297        G2frame.IntgOutList.append(Id)
    12961298        G2frame.PatternTree.SetItemPyData(G2frame.PatternTree.AppendItem(Id,text='Comments'),Comments)                   
    12971299        G2frame.PatternTree.SetItemPyData(G2frame.PatternTree.AppendItem(Id,text='Limits'),[tuple(Xminmax),Xminmax])
     
    25812583            fil = os.path.join(self.dirname,self.filename)
    25822584        self.fullpath = os.path.abspath(fil)
    2583         self.fp = open(fil,mode)
     2585        self.fp = open(self.fullpath,mode)
    25842586        return self.fp
    25852587
     
    26992701      match a powder export routine that has a Writer object.
    27002702    '''
    2701     filename = os.path.abspath(os.path.splitext(fileroot)[1]+extension)
     2703    filename = os.path.abspath(os.path.splitext(fileroot)[0]+extension)
    27022704    for obj in G2frame.exporterlist:
    27032705        if obj.extension == extension and 'powder' in obj.exporttype:
     
    27062708            obj.loadTree() # load all histograms in tree into dicts
    27072709            if TreeName not in obj.Histograms:
    2708                 raise Exception('Histogram not found: '+hst)
     2710                raise Exception('Histogram not found: '+str(TreeName))
     2711            try:
     2712                obj.Writer
     2713            except AttributeError:
     2714                continue
    27092715            try:
    27102716                obj.Writer(TreeName,filename)
    27112717                return
    2712             except AttributeError:
    2713                 print('Export Routine for '+extension+' does not have a .Writer method')
     2718            except Exception,err:
     2719                print('Export Routine for '+extension+' failed.')
     2720                print err
    27142721    else:
    27152722        print('No Export routine supports extension '+extension)
Note: See TracChangeset for help on using the changeset viewer.