Changeset 2687


Ignore:
Timestamp:
Feb 2, 2017 2:17:37 PM (5 years ago)
Author:
vondreele
Message:

problem if ESD=0 in EvalPSvarDeriv; just return 0.
add 'setdist' to Image controls; shows up in main image data window
add 'setdist' to tiff image importer; not in others as it isn't known
'setdist' is added to variables, etc. in seq image calib, suitable for plotting.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2685 r2687  
    33673367        inside after the Dict was created.
    33683368        '''
     3369        if not ESD:
     3370            return 0.
    33693371        step = ESD/10
    33703372        Ddict = dict(zip(['D11','D22','D33','D12','D13','D23'],
  • trunk/GSASIIimage.py

    r2686 r2687  
    546546    varyList = [item for item in data['varyList'] if data['varyList'][item]]
    547547    parmDict = {'dist':data['distance'],'det-X':data['center'][0],'det-Y':data['center'][1],
     548        'setdist':data.get('setdist',data['distance']),
    548549        'tilt':data['tilt'],'phi':data['rotation'],'wave':data['wavelength'],'dep':data['DetDepth']}
    549550    Found = False
  • trunk/GSASIIimgGUI.py

    r2686 r2687  
    132132        pixSize.Add(pixVal,0,WACV)
    133133    mainSizer.Add(pixSize,0)
    134    
     134    distSizer = wx.BoxSizer(wx.HORIZONTAL)
     135    distSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Set detector distance: '),0,WACV)
     136    if 'setdist' not in data:
     137        data['setdist'] = data['distance']
     138    distSizer.Add(G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'setdist',nDig=(10,2),
     139            typeHint=float),0,WACV)
     140    mainSizer.Add(distSizer,0)
    135141    mainSizer.Layout()   
    136142    G2frame.dataDisplay.SetSizer(mainSizer)
     
    191197                    print 'calibrating',name
    192198                    G2frame.Image = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,name)
    193                     CId = G2gd.GetPatternTreeItemId(G2frame,G2frame.Image,'Image Controls')
    194                     Data = G2frame.PatternTree.GetItemPyData(CId)
     199                    Data = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.Image,'Image Controls'))
    195200                    G2frame.ImageZ = GetImageZ(G2frame,Data)
    196201                    Data['setRings'] = True
     
    198203                    Masks = G2frame.PatternTree.GetItemPyData(Mid)
    199204                    vals,varyList,sigList,parmDict = G2img.ImageRecalibrate(G2frame,Data,Masks)
    200                     if 'distance' not in varyList:
     205                    sigList = list(sigList)
     206                    if 'dist' not in varyList:
    201207                        vals.append(parmDict['dist'])
    202208                        varyList.append('dist')
    203                         list(sigList).append(0.0)
     209                        sigList.append(0.0)
     210                    vals.append(Data['setdist'])
     211                    varyList.append('setdist')
     212                    sigList.append(0.01)
    204213                    SeqResult[name] = {'variables':vals,'varyList':varyList,'sig':sigList,'Rvals':[],
    205214                        'covMatrix':np.eye(len(varyList)),'title':name,'parmDict':parmDict}
     
    327336        # Assemble a list of item labels
    328337        keyList = ['type','wavelength','calibrant','distance','center','Oblique',
    329                     'tilt','rotation','azmthOff','fullIntegrate','LRazimuth',
     338                    'tilt','rotation','azmthOff','fullIntegrate','LRazimuth','setdist',
    330339                    'IOtth','outChannels','outAzimuths','invert_x','invert_y','DetDepth',
    331340                    'calibskip','pixLimit','cutoff','calibdmin','Flat Bkg','varyList',
     
    379388        File = open(filename,'w')
    380389        keys = ['type','wavelength','calibrant','distance','center','Oblique',
    381             'tilt','rotation','azmthOff','fullIntegrate','LRazimuth',
     390            'tilt','rotation','azmthOff','fullIntegrate','LRazimuth','setdist',
    382391            'IOtth','outChannels','outAzimuths','invert_x','invert_y','DetDepth',
    383392            'calibskip','pixLimit','cutoff','calibdmin','Flat Bkg','varyList',
     
    439448        cntlList = ['wavelength','distance','tilt','invert_x','invert_y','type','Oblique',
    440449            'fullIntegrate','outChannels','outAzimuths','LRazimuth','IOtth','azmthOff','DetDepth',
    441             'calibskip','pixLimit','cutoff','calibdmin','Flat Bkg','varyList',
     450            'calibskip','pixLimit','cutoff','calibdmin','Flat Bkg','varyList','setdist',
    442451            'PolaVal','SampleAbs','dark image','background image']
    443452        pth = G2G.GetImportPath(G2frame)
  • trunk/imports/G2img_1TIF.py

    r2546 r2687  
    304304    wavelength = (not wavelength) and 0.10 or wavelength
    305305    distance = (not distance) and 100.0 or distance
    306     data = {'pixelSize':pixy,'wavelength':wavelength,'distance':distance,'center':center,'size':sizexy}
     306    data = {'pixelSize':pixy,'wavelength':wavelength,'distance':distance,'center':center,'size':sizexy,'setdist':distance}
    307307    File.close()   
    308308    return head,data,Npix,image
Note: See TracChangeset for help on using the changeset viewer.