Changeset 4210


Ignore:
Timestamp:
Dec 18, 2019 3:44:47 AM (4 years ago)
Author:
vondreele
Message:

fix bad DifC name in MakeInst?
Add start on MakeRMCPdat routine - makes a dummy .testdat file not usable in RMCProfile at present

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r4209 r4210  
    10891089    def __init__(self,parent,Name,Phase):
    10901090        title = 'RMCProfile setup'
    1091         wx.Dialog.__init__(self,parent,wx.ID_ANY,title, 
     1091        wx.Dialog.__init__(self,parent,wx.ID_ANY,title,size=(500,500),
    10921092            pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
    10931093        self.panel = wxscroll.ScrolledPanel(self)         #just a dummy - gets destroyed in Draw!
     
    10991099        self.atSeq = self.aTypes[:]
    11001100        self.histogram = ''
    1101         self.metadata = {'title':'none','owner':'no one','date':str(time.ctime()),
    1102                          'material':'nothing','comment':'none ','source':'nowhere'}
     1101        self.files = {'Neutron real space data; G(r): ':['',0.01,'G(R)'],
     1102                      'Neutron reciprocal space data; F(Q): ':['',0.01,'F(Q)'],
     1103                      'Neutron reciprocal space data; S(Q): ':['',0.01,'S(Q)'],
     1104                      'Xray real space data; G(r): ':['',0.01,'G(R)'],
     1105                      'Xray reciprocal space data; F(Q): ':['',0.01,'F(Q)'],}
     1106        self.metadata = {'title':'none','owner':'no one','date':str(time.ctime()),'temperature':'300K',
     1107            'material':'nothing','phase':'vacuum','comment':'none ','source':'nowhere'}
    11031108        self.Draw()
    11041109       
     
    11231128        def OnStrain(event):
    11241129            self.UseSampBrd[1] = strain.GetValue()
     1130           
     1131        def OnFileSel(event):
     1132            Obj = event.GetEventObject()
     1133            fil = Indx[Obj.GetId()]
     1134            dlg = wx.FileDialog(self.panel, 'Choose '+fil+'NB: do not change directory; must be a local file',
     1135                '.',style=wx.FD_OPEN,wildcard=fil+'(*.*)|*.*')
     1136            if dlg.ShowModal() == wx.ID_OK:
     1137                fName = os.path.split(dlg.GetPath())[1]
     1138                if os.path.exists(fName):
     1139                    self.files[fil][0] = fName
     1140                dlg.Destroy()
     1141            else:
     1142                dlg.Destroy()
     1143                return
     1144            self.Draw()
     1145           
    11251146       
    11261147        self.panel.Destroy()
    1127         self.panel = wxscroll.ScrolledPanel(self,style = wx.DEFAULT_DIALOG_STYLE)
     1148        self.panel = wxscroll.ScrolledPanel(self,style = wx.DEFAULT_DIALOG_STYLE,size=(500,500))
    11281149        mainSizer = wx.BoxSizer(wx.VERTICAL)
    11291150        mainSizer.Add(wx.StaticText(self.panel,label=' Setup for: %s'%self.Name),0,WACV)
     
    11481169        histograms = self.Phase['Histograms']
    11491170        histNames = list(histograms.keys())
    1150         mainSizer.Add(wx.StaticText(self.panel,label=' Select one histogram for processing:'),0,WACV)
     1171        mainSizer.Add(wx.StaticText(self.panel,label=' Select one histogram for Bragg processing:'),0,WACV)
    11511172        histo = wx.ComboBox(self.panel,choices=histNames,style=wx.CB_DROPDOWN|wx.TE_READONLY)       
    11521173        histo.Bind(wx.EVT_COMBOBOX,OnHisto)
     
    11621183        samSizer.Add(strain,0,WACV)
    11631184        mainSizer.Add(samSizer,0,WACV)
    1164         metalist = ['title','owner','material','comment','source']
     1185        mainSizer.Add(wx.StaticText(self.panel,label=' Select data for processing:'),0,WACV)
     1186        fileSizer = wx.FlexGridSizer(2,5,5)
     1187        for fil in self.files:
     1188            filSel = wx.Button(self.panel,label='Select')
     1189            filSel.Bind(wx.EVT_BUTTON,OnFileSel)
     1190            Indx[filSel.GetId()] = fil
     1191            fileSizer.Add(filSel,0,WACV)
     1192            fileSizer.Add(wx.StaticText(self.panel,label=fil+self.files[fil][0]),0,WACV)
     1193        mainSizer.Add(fileSizer,0,WACV)
     1194        mainSizer.Add(wx.StaticText(self.panel,label=' Enter metadata items:'),0,WACV)
     1195        metalist = ['title','owner','material','phase','comment','source','temperature',]
    11651196        metaSizer = wx.FlexGridSizer(0,2,5,5)
    11661197        for item in metalist:
     
    11841215    def GetData(self):
    11851216        'Returns the values from the dialog'
    1186         return self.SuperCell,self.histogram,self.metadata,self.atSeq,self.UseSampBrd
     1217        return self.SuperCell,self.histogram,self.metadata,self.atSeq,self.UseSampBrd,self.files
    11871218       
    11881219    def OnOK(self,event):
     
    46204651            dlg = SetUpRMCProfileDialog(G2frame,Name=pName,Phase=data)
    46214652            if dlg.ShowModal() == wx.ID_OK:
    4622                 superCell,histoName,meta,atSeq,useSamBrd = dlg.GetData()
     4653                superCell,histoName,meta,atSeq,useSamBrd,files = dlg.GetData()
    46234654                PWId = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,histoName)
    46244655                if PWId:
    4625 #                    Progress
    4626 #                    print(useSamBrd)
    4627 #                    print(data['Histograms'][histoName]['Size'])
    4628 #                    print(data['Histograms'][histoName]['Mustrain'])
    46294656                    print(G2pwd.MakeInst(G2frame,pName,data,useSamBrd,PWId)+ ' written')
    46304657                    backfile = G2pwd.MakeBack(G2frame,pName,PWId)
     
    46354662                    print(G2pwd.MakeBragg(G2frame,pName,data,PWId)+ ' written')
    46364663                    print(G2pwd.MakeRMC6f(G2frame,pName,data,meta,atSeq,superCell,PWId)+ ' written')
     4664                    print(G2pwd.MakeRMCPdat(G2frame,pName,data,meta,atSeq,superCell,files,PWId)+ ' written')
    46374665                    print('RMCProfile file build completed')
    46384666                else:
  • trunk/GSASIIpwd.py

    r4206 r4210  
    21042104    Ysb = 0.
    21052105    if 'T' in inst['Type'][1]:
    2106         difC = inst['DifC'][1]
     2106        difC = inst['difC'][1]
    21072107        if useSamBrd[0]:
    21082108            if 'ellipsoidal' not in Size[0]:    #take the isotropic term only
     
    22422242    fl.close()
    22432243    return fname
     2244
     2245def MakeRMCPdat(G2frame,Name,Phase,Meta,Atseq,Supercell,Files,PWId):
     2246    fname = Name+'.testdat'
     2247    fl = open(fname,'w')
     2248    fl.write('TITLE :: '+Name+'\n')
     2249    fl.write('MATERIAL :: '+Meta['material']+'\n')
     2250    fl.write('PHASE :: '+Meta['phase']+'\n')
     2251    fl.write('TEMPERATURE :: '+str(Meta['temperature'])+'\n')
     2252    fl.write('INVESTIGATOR :: '+Meta['owner']+'\n')
     2253    fl.write(' %% edit the following as needed\n')
     2254    fl.write('MINIMUM_DISTANCES ::   4.00  1.37  2.0    Angstrom\n')
     2255    fl.write('MAXIMUM_MOVES ::   0.05  0.10 Angstrom\n')
     2256    fl.write('R_SPACING ::  0.0200 Angstrom\n')
     2257    fl.write('PRINT_PERIOD :: 100\n')
     2258    fl.write('TIME_LIMIT ::     10.00 MINUTES\n')
     2259    fl.write('SAVE_PERIOD ::     1.00 MINUTES\n')
     2260    fl.write('ATOMS :: '+' '.join(Atseq)+'\n')
     2261    fl.write('FLAGS ::\n')
     2262    fl.write('  > NO_MOVEOUT\n')
     2263    fl.write('  > NO_SAVE_CONFIGURATIONS\n')
     2264    fl.write('  > NO_RESOLUTION_CONVOLUTION\n')
     2265    fl.write('INPUT_CONFIGURATION_FORMAT ::  rmc6f\n')
     2266    fl.write('SAVE_CONFIGURATION_FORMAT  ::  rmc6f\n')
     2267   
     2268   
     2269   
     2270   
     2271    fl.close()
     2272    return fname
     2273   
    22442274
    22452275def MakePDB(G2frame,Name,Phase,Atseq,Supercell):
Note: See TracChangeset for help on using the changeset viewer.