Changeset 4191


Ignore:
Timestamp:
Nov 13, 2019 8:18:50 AM (2 years ago)
Author:
vondreele
Message:

put in dummy phase tab & menu for fullrmc
partial implementation of pdf from TOF data; lacks absorption & wavelength dependent scattering length effects.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4187 r4191  
    57035703        self.MEMDataEdit.Append(G2G.wxID_SAVEDYSNOMIA,'Save Dysnomia file','Save MEM info in Dysnomia file')
    57045704        self.MEMDataEdit.Append(G2G.wxID_RUNDYSNOMIA,'Run Dysonmia','Run Dysnomia to make new Fobs map')
     5705        self.PostfillDataMenu()
     5706       
     5707        #Phase / fullrmc (Reverse Monte Carlo method) tab
     5708        G2G.Define_wxId('wxID_SETUPFULLRMC','wxID_LOADFULLRMC','wxID_SAVEFULLRMC','wxID_EDITFULLRMC','wxID_RUNFULLRMC', )       
     5709        self.FRMCMenu = wx.MenuBar()
     5710        self.PrefillDataMenu(self.FRMCMenu)
     5711        self.FRMCMenu.Append(menu=wx.Menu(title=''),title='Select tab')
     5712        self.FRMCDataEdit = wx.Menu(title='')
     5713        self.FRMCMenu.Append(menu=self.FRMCDataEdit, title='Operations')
     5714        self.FRMCDataEdit.Append(G2G.wxID_SETUPFULLRMC,'Setup run.py','Setup new fullrmc run.py file')
     5715        self.FRMCDataEdit.Append(G2G.wxID_LOADFULLRMC,'Load run.py','Load fullrmc run.py file')
     5716        self.FRMCDataEdit.Append(G2G.wxID_SAVEFULLRMC,'Save run.py','Save fullrmc run.py file')
     5717        self.FRMCDataEdit.Append(G2G.wxID_EDITFULLRMC,'Edit run.py','Edit fullrmc run.py file')
     5718        self.FRMCDataEdit.Append(G2G.wxID_RUNFULLRMC,'Execute run.py','Run fullrmc run.py file')
    57055719        self.PostfillDataMenu()
    57065720       
  • trunk/GSASIIphsGUI.py

    r4183 r4191  
    43264326            wx.MessageBox('Dysnomia failed to make new structure factors','Dysnomia Error',
    43274327                style=wx.ICON_ERROR)
    4328        
    4329        
     4328
     4329################################################################################
     4330#### fullrmc Data page
     4331################################################################################
     4332
     4333    def UpdateFullRMC():
     4334        ''' Present the controls for running fullrmc
     4335        '''
     4336        generalData = data['General']
     4337        pName = generalData['Name'].replace(' ','_')
     4338       
     4339    def OnSetupFullRMC(event):
     4340        print('Setup new run.py - not yet implemented')
     4341           
     4342    def OnLoadFullRMC(event):
     4343        print('Load run.py - not yet implemented')
     4344       
     4345    def OnSaveFullRMC(event):
     4346        print('Save run.py - not yet implemented')
     4347
     4348    def OnEditFullRMC(event):
     4349        print('Edit run.py - not yet implemented')
     4350
     4351    def OnRunFullRMC(event):
     4352        print('Run run.py - not yet implemented')
     4353
     4354           
    43304355################################################################################
    43314356#### Layer Data page
     
    97489773            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.MEMMenu)
    97499774            UpdateDysnomia()
     9775        elif text == 'fullrmc':
     9776            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.FRMCMenu)
     9777            UpdateFullRMC()
    97509778        elif text == 'Draw Options':
    97519779            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.DataDrawOptions)
     
    98929920        G2frame.Bind(wx.EVT_MENU, OnPeaksDelete, id=G2G.wxID_PEAKSDELETE)
    98939921        G2frame.Bind(wx.EVT_MENU, OnPeaksClear, id=G2G.wxID_PEAKSCLEAR)
     9922        # fullrmc
     9923        FillSelectPageMenu(TabSelectionIdDict, G2frame.dataWindow.FRMCMenu)
     9924        G2frame.Bind(wx.EVT_MENU, OnSetupFullRMC, id=G2G.wxID_SETUPFULLRMC)
     9925        G2frame.Bind(wx.EVT_MENU, OnLoadFullRMC, id=G2G.wxID_LOADFULLRMC)
     9926        G2frame.Bind(wx.EVT_MENU, OnSaveFullRMC, id=G2G.wxID_SAVEFULLRMC)
     9927        G2frame.Bind(wx.EVT_MENU, OnEditFullRMC, id=G2G.wxID_EDITFULLRMC)
     9928        G2frame.Bind(wx.EVT_MENU, OnRunFullRMC, id=G2G.wxID_RUNFULLRMC)
    98949929        # MC/SA
    98959930        FillSelectPageMenu(TabSelectionIdDict, G2frame.dataWindow.MCSAMenu)
     
    998310018        G2frame.phaseDisplay.AddPage(G2frame.MCSA,'MC/SA')
    998410019        Pages.append('MC/SA')
     10020        G2frame.FRMC = wx.ScrolledWindow(G2frame.phaseDisplay)
     10021        G2frame.phaseDisplay.AddPage(G2frame.FRMC,'fullrmc')
     10022        Pages.append('fullrmc')
    998510023    Texture = wx.ScrolledWindow(G2frame.phaseDisplay)
    998610024    G2frame.phaseDisplay.AddPage(Texture,'Texture')
  • trunk/GSASIIpwd.py

    r4179 r4191  
    335335        dq = Qpoints[1]-Qpoints[0]
    336336        XY[0] = npT2q(XY[0],wave)
     337        Qdata = si.griddata(XY[0],XY[1],Qpoints,method='linear',fill_value=XY[1][0])    #interpolate I(Q)
    337338    elif 'T' in inst['Type'][0]:
    338339        difC = inst['difC'][1]
     
    342343        dq = Qpoints[1]-Qpoints[0]
    343344        XY[0] = 2.*np.pi*difC/XY[0]
    344     Qdata = si.griddata(XY[0],XY[1],Qpoints,method='linear',fill_value=XY[1][0])    #interpolate I(Q)
     345        Qdata = si.griddata(XY[0],XY[1],Qpoints,method='linear',fill_value=XY[1][-1])    #interpolate I(Q)
    345346    Qdata -= np.min(Qdata)*data['BackRatio']
    346347   
    347348    qLimits = data['QScaleLim']
    348     minQ = np.searchsorted(Qpoints,qLimits[0])
    349     maxQ = np.searchsorted(Qpoints,qLimits[1])+1
     349    maxQ = np.searchsorted(Qpoints,min(Qpoints[-1],qLimits[1]))+1
     350    minQ = np.searchsorted(Qpoints,min(qLimits[0],0.90*Qpoints[-1]))
     351    qLimits = [Qpoints[minQ],Qpoints[maxQ-1]]
    350352    newdata = []
    351353    if len(IofQ) < 3:
     
    358360   
    359361    xydata['SofQ'] = copy.deepcopy(xydata['IofQ'])
    360     FFSq,SqFF,CF = GetAsfMean(ElList,(xydata['SofQ'][1][0]/(4.0*np.pi))**2)  #these are <f^2>,<f>^2,Cf
     362    if 'XC' in inst['Type'][0]:
     363        FFSq,SqFF,CF = GetAsfMean(ElList,(xydata['SofQ'][1][0]/(4.0*np.pi))**2)  #these are <f^2>,<f>^2,Cf
     364    else: #TOF
     365        CF = np.zeros(len(xydata['SofQ'][1][0]))
     366        FFSq = np.ones(len(xydata['SofQ'][1][0]))
     367        SqFF = np.ones(len(xydata['SofQ'][1][0]))
    361368    Q = xydata['SofQ'][1][0]
    362369#    auxPlot.append([Q,np.copy(CF),'CF-unCorr'])
    363     ruland = Ruland(data['Ruland'],wave,Q,CF)
     370    if 'XC' in inst['Type'][0]:
     371        ruland = Ruland(data['Ruland'],wave,Q,CF)
    364372#    auxPlot.append([Q,ruland,'Ruland'])     
    365     CF *= ruland
     373        CF *= ruland
    366374#    auxPlot.append([Q,CF,'CF-Corr'])
    367375    scale = np.sum((FFSq+CF)[minQ:maxQ])/np.sum(xydata['SofQ'][1][1][minQ:maxQ])
    368376    xydata['SofQ'][1][1] *= scale
    369     xydata['SofQ'][1][1] -= CF
     377    if 'XC' in inst['Type'][0]:
     378        xydata['SofQ'][1][1] -= CF
    370379    xydata['SofQ'][1][1] = xydata['SofQ'][1][1]/SqFF
    371380    scale = len(xydata['SofQ'][1][1][minQ:maxQ])/np.sum(xydata['SofQ'][1][1][minQ:maxQ])
  • trunk/GSASIIpwdGUI.py

    r4177 r4191  
    69116911        geoBox = wx.BoxSizer(wx.HORIZONTAL)
    69126912        geoBox.Add(wx.StaticText(G2frame.dataWindow,label=' Sample geometry: '),0,WACV)
    6913         choice = ['Cylinder','Bragg-Brentano','Tilting flat plate in transmission','Fixed flat plate']
     6913        if 'C' in inst['Type'][0]:
     6914            choice = ['Cylinder','Bragg-Brentano','Tilting flat plate in transmission','Fixed flat plate']
     6915        else:
     6916            choice = ['Cylinder',]
    69146917        geometry = wx.ComboBox(G2frame.dataWindow,value=data['Geometry'],choices=choice,
    69156918                style=wx.CB_READONLY|wx.CB_DROPDOWN)
     
    70467049        bkBox.Add(backVal,0,WACV)   
    70477050        sfgSizer.Add(bkBox,0,wx.ALIGN_LEFT|wx.EXPAND)
    7048    
    7049         sqBox = wx.BoxSizer(wx.HORIZONTAL)
    7050         sqBox.Add(wx.StaticText(G2frame.dataWindow,label=' Ruland width: '),0,WACV)   
    7051         rulandSldr = wx.Slider(parent=G2frame.dataWindow,style=wx.SL_HORIZONTAL,
    7052             value=int(1000*data['Ruland']))
    7053         sqBox.Add(rulandSldr,1,wx.EXPAND)
    7054         rulandSldr.Bind(wx.EVT_SLIDER, OnRulSlider)
    7055         rulandWdt = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data,'Ruland',nDig=(10,3),min=0.001,max=1.0,
    7056             typeHint=float,OnLeave=AfterChangeNoRefresh)
    7057         sqBox.Add(rulandWdt,0,WACV)   
    7058         sfgSizer.Add(sqBox,0,wx.ALIGN_LEFT|wx.EXPAND)
     7051
     7052        if 'XC' in inst['Type'][0]:
     7053            sqBox = wx.BoxSizer(wx.HORIZONTAL)
     7054            sqBox.Add(wx.StaticText(G2frame.dataWindow,label=' Ruland width: '),0,WACV)   
     7055            rulandSldr = wx.Slider(parent=G2frame.dataWindow,style=wx.SL_HORIZONTAL,
     7056                value=int(1000*data['Ruland']))
     7057            sqBox.Add(rulandSldr,1,wx.EXPAND)
     7058            rulandSldr.Bind(wx.EVT_SLIDER, OnRulSlider)
     7059            rulandWdt = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data,'Ruland',nDig=(10,3),min=0.001,max=1.0,
     7060                typeHint=float,OnLeave=AfterChangeNoRefresh)
     7061            sqBox.Add(rulandWdt,0,WACV)   
     7062            sfgSizer.Add(sqBox,0,wx.ALIGN_LEFT|wx.EXPAND)
    70597063       
    70607064        sqBox = wx.BoxSizer(wx.HORIZONTAL)
Note: See TracChangeset for help on using the changeset viewer.