Changeset 4820


Ignore:
Timestamp:
Feb 17, 2021 3:05:30 PM (8 months ago)
Author:
vondreele
Message:

remove masks from argument list for MakeGainMap? - not used
Tweak gain map limits
fix to OnOrigX & OnOrien? - now set atom site fractions to the max found for atoms in RB
"fix" (with a try except) for the occasional crash on finding a nonexistent Pattern. Now just skips & tries again.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r4697 r4820  
    12621262    return useMask
    12631263
    1264 def MakeGainMap(image,Ix,Iy,data,masks,blkSize=128):
     1264def MakeGainMap(image,Ix,Iy,data,blkSize=128):
    12651265    import scipy.ndimage.filters as sdif
    12661266    Iy *= npcosd(Ix[:-1])**3       #undo parallax
  • trunk/GSASIIimgGUI.py

    r4796 r4820  
    171171        G2frame.Integrate = G2img.ImageIntegrate(sumImg,Data,masks,blkSize)           
    172172        Iy,azms,Ix = G2frame.Integrate[:3]
    173         GainMap = G2img.MakeGainMap(sumImg,Ix,Iy,Data,masks,blkSize)*1000.
     173        GainMap = G2img.MakeGainMap(sumImg,Ix,Iy,Data,blkSize)*1000.
    174174        Npix,imagefile,imagetag = G2IO.GetCheckImageFile(G2frame,G2frame.Image)
    175175        pth = os.path.split(os.path.abspath(imagefile))[0]
     
    181181            newimagefile = G2IO.FileDlgFixExt(dlg,newimagefile)
    182182            Data['formatName'] = 'GSAS-II image'
    183             Data['range'] = [(800,1200),[800,1200]]
    184             GainMap = np.where(GainMap > 1200,1000,GainMap)
    185             GainMap = np.where(GainMap < 800,1000,GainMap)
     183            Data['range'] = [(500,2000),[800,1200]]
     184            GainMap = np.where(GainMap > 1200,1200,GainMap)
     185            GainMap = np.where(GainMap < 800,800,GainMap)
    186186            G2IO.PutG2Image(newimagefile,[],data,Npix,GainMap)
    187187            GMname = 'IMG '+os.path.split(newimagefile)[1]
  • trunk/GSASIIphsGUI.py

    r4819 r4820  
    98999899                Sytsym,Mult = G2spc.SytSym(rbObj['Orig'][0],SGData)[:2]
    99009900                sytsymtxt.SetLabel('Origin site symmetry: %s, multiplicity: %d '%(Sytsym,Mult))
     9901                maxFrac = 0.0
     9902                for Id in RBObj['Ids']:
     9903                    maxFrac = max(maxFrac,data['Atoms'][AtLookUp[Id]][cx+3])
    99019904                for i,Id in enumerate(RBObj['Ids']):
    99029905                    data['Atoms'][AtLookUp[Id]][cx:cx+3] = newXYZ[i]
    9903                     data['Atoms'][AtLookUp[Id]][cx+3] = 1.0
     9906                    data['Atoms'][AtLookUp[Id]][cx+3] = maxFrac
    99049907                data['Atoms'] = G2lat.RBsymCheck(data['Atoms'],ct,cx,cs,AtLookUp,Amat,RBObj['Ids'],SGData)
    99059908                data['Drawing']['Atoms'] = []
     
    99209923                    RBObj['Orient'][0] = Q
    99219924                    newXYZ = G2mth.UpdateRBXYZ(Bmat,RBObj,RBData,rbType)[0]
     9925                    maxFrac = 0.0
     9926                    for Id in RBObj['Ids']:
     9927                        maxFrac = max(maxFrac,data['Atoms'][AtLookUp[Id]][cx+3])
    99229928                    for i,Id in enumerate(RBObj['Ids']):
    99239929                        data['Atoms'][AtLookUp[Id]][cx:cx+3] = newXYZ[i]
    9924                         data['Atoms'][AtLookUp[Id]][cx+3] = 1.0
     9930                        data['Atoms'][AtLookUp[Id]][cx+3] = maxFrac
    99259931                    data['Atoms'] = G2lat.RBsymCheck(data['Atoms'],ct,cx,cs,AtLookUp,Amat,RBObj['Ids'],SGData)
    99269932                    data['Drawing']['Atoms'] = []
  • trunk/GSASIIplot.py

    r4817 r4820  
    29182918    time0 = time.time()
    29192919    if G2frame.SinglePlot and PatternId:
    2920         Pattern = G2frame.GPXtree.GetItemPyData(PatternId)
    2921         Pattern.append(G2frame.GPXtree.GetItemText(PatternId))
    2922         PlotList = [Pattern,]
    2923         # PId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background')
    2924         # Pattern[0]['BackFile'] = ['',-1.0,False]
    2925         # if PId:
    2926         #     Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(PId)[1].get('background PWDR',['',-1.0,False])
    2927         Parms,Parms2 = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
    2928             G2frame.PatternId, 'Instrument Parameters'))
    2929         Sample = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Sample Parameters'))
    2930         ParmList = [Parms,]
    2931         SampleList = [Sample,]
    2932         Title = data[0].get('histTitle')
    2933         if not Title:
    2934             Title = Pattern[-1]
     2920        try:
     2921            Pattern = G2frame.GPXtree.GetItemPyData(PatternId)
     2922            Pattern.append(G2frame.GPXtree.GetItemText(PatternId))
     2923            PlotList = [Pattern,]
     2924            # PId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background')
     2925            # Pattern[0]['BackFile'] = ['',-1.0,False]
     2926            # if PId:
     2927            #     Pattern[0]['BackFile'] =  G2frame.GPXtree.GetItemPyData(PId)[1].get('background PWDR',['',-1.0,False])
     2928            Parms,Parms2 = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
     2929                G2frame.PatternId, 'Instrument Parameters'))
     2930            Sample = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Sample Parameters'))
     2931            ParmList = [Parms,]
     2932            SampleList = [Sample,]
     2933            Title = data[0].get('histTitle')
     2934            if not Title:
     2935                Title = Pattern[-1]
     2936        except AttributeError:
     2937            pass
    29352938    else:     #G2frame.selection   
    29362939        Title = os.path.split(G2frame.GSASprojectfile)[1]
Note: See TracChangeset for help on using the changeset viewer.