Changeset 5273


Ignore:
Timestamp:
May 10, 2022 10:59:01 AM (9 months ago)
Author:
toby
Message:

Laue Fringe fixes

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r5271 r5273  
    13841384The default is peakFitMode=True. This is changed only in
    13851385:func:`setPeakInstPrmMode`, which is called from :mod:`GSASIIscriptable`
    1386 or GSASIIOnSetPeakWidMode ('Gen unvaried widths' menu item).
     1386or GSASIIphsGUI.OnSetPeakWidMode ('Gen unvaried widths' menu item).
    13871387'''
    13881388
     
    23382338
    23392339    def SetPeaksParms(dataType,Peaks):
     2340        '''Set the contents of peakDict from list Peaks
     2341        '''
    23402342        peakDict = {}
    23412343        peakVary = []
     
    23552357               
    23562358    def GetPeaksParms(Inst,parmDict,Peaks,varyList):
     2359        '''Put values into the Peaks list from the refinement results from inside
     2360        the parmDict array
     2361        '''
    23572362        off = 0
    23582363        if 'LF' in Inst['Type'][0]:
     
    23672372                parName = names[j]+str(i)
    23682373                if parName in varyList or not peakInstPrmMode:
    2369                     peak[2*j+off] = parmDict[parName]               
     2374                    peak[2*j+off] = parmDict[parName]
     2375            if 'pos'+str(i) not in parmDict: continue
    23702376            pos = parmDict['pos'+str(i)]
    23712377            if 'LF' in Inst['Type'][0]: peak[0] = pos
     
    23732379                dsp = pos/Inst['difC'][1]
    23742380            for j in range(len(names)):
     2381                parName = names[j]+str(i)
     2382                if peak[2*j+off + 1] or not peakInstPrmMode: continue
    23752383                if 'alp' in parName:
    23762384                    if 'T' in Inst['Type'][0]:
    2377                         peak[2*j] = G2mth.getTOFalpha(parmDict,dsp)
     2385                        peak[2*j+off] = G2mth.getTOFalpha(parmDict,dsp)
    23782386                    else: #'B'
    2379                         peak[2*j] = G2mth.getPinkalpha(parmDict,pos)
     2387                        peak[2*j+off] = G2mth.getPinkalpha(parmDict,pos)
    23802388                elif 'bet' in parName:
    23812389                    if 'T' in Inst['Type'][0]:
    2382                         peak[2*j] = G2mth.getTOFbeta(parmDict,dsp)
     2390                        peak[2*j+off] = G2mth.getTOFbeta(parmDict,dsp)
    23832391                    else:   #'B'
    2384                         peak[2*j] = G2mth.getPinkbeta(parmDict,pos)
     2392                        peak[2*j+off] = G2mth.getPinkbeta(parmDict,pos)
    23852393                elif 'sig' in parName:
    23862394                    if 'T' in Inst['Type'][0]:
    2387                         peak[2*j] = G2mth.getTOFsig(parmDict,dsp)
     2395                        peak[2*j+off] = G2mth.getTOFsig(parmDict,dsp)
    23882396                    elif 'E' in Inst['Type'][0]:
    2389                         peak[2*j] = G2mth.getEDsig(parmDict,pos)
     2397                        peak[2*j+off] = G2mth.getEDsig(parmDict,pos)
    23902398                    else:   #'C' & 'B'
    2391                         peak[2*j] = G2mth.getCWsig(parmDict,pos)
     2399                        peak[2*j+off] = G2mth.getCWsig(parmDict,pos)
    23922400                elif 'gam' in parName:
    23932401                    if 'T' in Inst['Type'][0]:
    2394                         peak[2*j] = G2mth.getTOFgamma(parmDict,dsp)
     2402                        peak[2*j+off] = G2mth.getTOFgamma(parmDict,dsp)
    23952403                    else:   #'C' & 'B'
    2396                         peak[2*j] = G2mth.getCWgam(parmDict,pos)
     2404                        peak[2*j+off] = G2mth.getCWgam(parmDict,pos)
    23972405                       
    23982406    def PeaksPrint(dataType,parmDict,sigDict,varyList,ptsperFW):
  • trunk/GSASIIpwdGUI.py

    r5271 r5273  
    11411141        state = G2frame.dataWindow.setPeakMode.IsChecked()
    11421142        G2pwd.setPeakInstPrmMode(state)
     1143
    11431144    #======================================================================
    11441145    #### beginning of UpdatePeakGrid
    1145     #======================================================================
    11461146    G2frame.GetStatusBar().SetStatusText('Global refine: select refine column & press Y or N',1)
    11471147    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.PeakMenu)
     
    12131213                if i == 0:
    12141214                    pos = data['peaks'][i][0]
    1215                     data['LaueFringe']['clat'] = 0.5 * lam / np.sin(pos*np.pi/360)
    1216                     l = 1
     1215                    data['LaueFringe']['clat'] = data['LaueFringe']['lmin'] * 0.5 * lam / np.sin(pos*np.pi/360)
     1216                    l = data['LaueFringe']['lmin']
    12171217                else:
    12181218                    l = data['LaueFringe']['clat'] / (0.5 * lam / np.sin(data['peaks'][i][0]*np.pi/360))
     
    12471247        data['LaueFringe']['ncell'] = data['LaueFringe'].get('ncell',20)
    12481248        data['LaueFringe']['clat'] =  data['LaueFringe'].get('clat',9.0)
     1249        data['LaueFringe']['lmin'] =  data['LaueFringe'].get('lmin',1)
    12491250        data['LaueFringe']['clat-ref'] =  data['LaueFringe'].get('clat-ref',False)
    12501251        data['LaueFringe']['Show'] =  data['LaueFringe'].get('Show',0)
     
    12561257        topSizer.Add(cRef,0,WACV)
    12571258        topSizer.Add((15,-1))
     1259        siz = G2G.G2SpinWidget(G2frame.dataWindow,data['LaueFringe'] ,'lmin',
     1260                                       'l min')
     1261        topSizer.Add(siz,0,WACV)
     1262        topSizer.Add((15,-1))
    12581263        siz = G2G.G2SpinWidget(G2frame.dataWindow,data['LaueFringe'] ,'ncell',
    12591264                                       'Laue ncell',
    12601265                                       onChange=RefreshPeakGrid,onChangeArgs=[None])
    12611266        topSizer.Add(siz,0,WACV)
     1267        topSizer.Add((15,-1))
    12621268        topSizer.Add(wx.StaticText(G2frame.dataWindow,label='  Show '),0,WACV)
    12631269        ch = G2G.EnumSelector(G2frame.dataWindow,data['LaueFringe'],'Show',
Note: See TracChangeset for help on using the changeset viewer.