Changeset 2290 for trunk/GSASIIimgGUI.py


Ignore:
Timestamp:
May 25, 2016 3:39:41 PM (6 years ago)
Author:
vondreele
Message:

complex problem - fix summing of GE images; needed new item in Image Controls to save which reader was used. Change to OnImportGeneric? to keep self.formatName; GetImageData? put it in the call & check it with the available readers & GetImageZ to get it out of the Image Controls & apply it in GetImageData?.
Add a test on file size for GE files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r2288 r2290  
    6060    Npix,imagefile,imagetag = G2frame.PatternTree.GetImageLoc(G2frame.Image)
    6161    imagefile = G2IO.CheckImageFile(G2frame,imagefile)
    62     sumImg = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag)
     62    formatName = data.get('formatName','')
     63    sumImg = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag,FormatName=formatName)
    6364    if not 'dark image' in data:
    6465        return sumImg
     
    6667    if darkImg:
    6768        Did = G2gd.GetPatternTreeItemId(G2frame, G2frame.root, darkImg)
     69        Ddata = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Did,'Image Controls'))
     70        dformatName = Ddata.get('formatName','')
    6871        if Did:
    6972            Npix,imagefile,imagetag = G2frame.PatternTree.GetImageLoc(Did)
    7073            imagefile = G2IO.CheckImageFile(G2frame,imagefile)
    71             darkImage = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag)
     74            darkImage = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag,FormatName=dformatName)
    7275            sumImg += np.array(darkImage*darkScale,dtype='int32')
    7376    if not 'background image' in data:
     
    7982            Npix,imagefile,imagetag = G2frame.PatternTree.GetImageLoc(Bid)
    8083            imagefile = G2IO.CheckImageFile(G2frame,imagefile)
    81             backImage = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag)
    8284            Bdata = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Bid,'Image Controls'))
     85            bformatName = Bdata.get('formatName','')
     86            backImage = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag,FormatName=bformatName)
    8387            if darkImg:
    8488                Did = G2gd.GetPatternTreeItemId(G2frame, G2frame.root,darkImg)
     89                Ddata = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Did,'Image Controls'))
     90                dformatName = Ddata.get('formatName','')
    8591                Npix,imagefile,imagetag = G2frame.PatternTree.GetImageLoc(Did)
    8692                imagefile = G2IO.CheckImageFile(G2frame,imagefile)
    87                 darkImage = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag)
     93                darkImage = G2IO.GetImageData(G2frame,imagefile,True,ImageTag=imagetag,FormatName=dformatName)
    8894                backImage += np.array(darkImage*darkScale,dtype='int32')               
    8995            sumImg += np.array(backImage*backScale,dtype='int32')
Note: See TracChangeset for help on using the changeset viewer.