Changeset 4361
- Timestamp:
- Mar 11, 2020 4:43:45 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r4349 r4361 72 72 print('Updating...') 73 73 GSASIIpath.svnUpdateProcess() 74 GSASIIpath.InvokeDebugOpts()75 74 import GSASIIdataGUI as G2gd 76 75 G2gd.GSASIImain(application) # start the GUI 77 76 if sys.platform == "darwin": 78 77 wx.CallLater(100,application.ClearStartup) 78 GSASIIpath.InvokeDebugOpts() 79 79 application.MainLoop() -
trunk/GSASIIIO.py
r4345 r4361 1429 1429 return True 1430 1430 elif len(self.powderDict) == 1: 1431 self.histnam = self.powderDict.values()1431 self.histnam = list(self.powderDict.values()) 1432 1432 elif self.multiple: 1433 1433 choices = sorted(self.powderDict.values()) -
trunk/GSASIIIntPDFtool.py
r4053 r4361 1 '''Independent-running GSAS-II based auto-integration program with minimal 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 #GSAS-II autointegration routines 4 ########### SVN repository information ################### 5 # $Date: $ 6 # $Author: $ 7 # $Revision: $ 8 # $URL: $ 9 # $Id: $ 10 ########### SVN repository information ################### 11 ''' 12 *GSASIIautoint: autointegration routines* 13 --------------------------------------------- 14 15 Independent-running GSAS-II based auto-integration program with minimal 2 16 GUI, no visualization but intended to implement significant levels of 3 17 parallelization. … … 32 46 import GSASIIscriptable as G2sc 33 47 import multiprocessing as mp 48 49 try: # fails during doc build 50 wxMainFrameStyle = wx.DEFAULT_FRAME_STYLE ^ wx.CLOSE_BOX 51 except: 52 wxMainFrameStyle = None 34 53 35 54 class AutoIntFrame(wx.Frame): … … 185 204 186 205 def TestInput(*args,**kwargs): 187 'Determine if the start button should be enabled' 206 '''Determine if the start button should be enabled and 207 ask for the exporter type with ambiguous extensions 208 ''' 209 for dfmt,obj in self.fmtlist.items(): 210 fmt = dfmt[1:] 211 if not self.params['outsel'][fmt]: continue 212 if fmt in self.multipleFmtChoices: continue 213 if type(obj) is not list: continue # only one exporter for this 214 choices = [] 215 for e in obj: 216 choices.append(e.formatName) 217 if len(choices) == 0: 218 print('Error: why 0 choices in TestInput?') 219 continue 220 if len(choices) == 1: 221 print('Error: why 1 choice in TestInput?') 222 self.multipleFmtChoices[fmt] = obj[0].formatName 223 continue 224 # select the format here 225 dlg = G2G.G2SingleChoiceDialog(self, 226 'There is more than one format with a '+ 227 '.{} output. Choose the one to use'.format(fmt), 228 'Choose output format',choices) 229 dlg.CenterOnParent() 230 dlg.clb.SetSelection(0) # force a selection 231 if dlg.ShowModal() == wx.ID_OK and dlg.GetSelection() >= 0: 232 self.multipleFmtChoices[fmt] = choices[dlg.GetSelection()] 233 dlg.Destroy() 234 188 235 writingSomething = False 189 236 writingPDF = False … … 431 478 self.params['outdir'] = os.getcwd() 432 479 self.PDFformats = ('I(Q)', 'S(Q)', 'F(Q)', 'G(r)', 'PDFgui') 480 self.multipleFmtChoices = {} 433 481 #GSASIIpath.IPyBreak_base() 434 482 435 483 wx.Frame.__init__(self, None, title='Automatic Integration', 436 style=wx .DEFAULT_FRAME_STYLE)484 style=wxMainFrameStyle) 437 485 self.Status = self.CreateStatusBar() 438 486 self.Status.SetStatusText('Press Start to load and integrate images matching filter') … … 497 545 sizer = wx.BoxSizer(wx.HORIZONTAL) 498 546 sizer.Add(wx.StaticText(mnpnl, wx.ID_ANY,'Select format(s):')) 499 for dfmt in s elf.fmtlist:547 for dfmt in sorted(self.fmtlist): 500 548 sizer.Add((6,2)) # add a bit of extra space 501 549 fmt = dfmt[1:] … … 712 760 dir = os.path.join(self.params['outdir'], 713 761 fmt.replace("(","_").replace(")","")) 714 if not os.path.exists(dir): os.makedirs(dir) 762 if not os.path.exists(dir): os.makedirs(dir) 715 763 return False 716 764 … … 734 782 outputSelect = self.params['outsel'] 735 783 PDFformats = self.PDFformats 736 outputModes = (outputSelect,PDFformats,self.fmtlist,outdir) 784 outputModes = (outputSelect,PDFformats,self.fmtlist,outdir, 785 self.multipleFmtChoices) 737 786 if PDFobj: 738 787 PDFdict = PDFobj.data … … 833 882 ''' 834 883 (TableMode,ComputePDF,SeparateDir,optPDF) = calcModes 835 (outputSelect,PDFformats,fmtlist,outdir ) = outputModes884 (outputSelect,PDFformats,fmtlist,outdir,multipleFmtChoices) = outputModes 836 885 if SeparateDir: 837 886 savedir = os.path.join(outdir,'gpx') … … 872 921 if not outputSelect[fmt]: continue 873 922 if fmtlist[dfmt] is None: continue 923 hint = '' 924 if fmt in multipleFmtChoices: 925 hint = multipleFmtChoices[fmt] 874 926 if SeparateDir: 875 927 savedir = os.path.join(outdir,fmt) … … 880 932 for i,h in enumerate(hists): 881 933 fname = h.name[5:].replace(' ','_') 934 #if len(hists) > 1: 935 GSASIIpath.IPyBreak_base() 882 936 try: 883 937 fil = os.path.join(savedir,fname) 884 print('Wrote',h.Export(fil,dfmt ))938 print('Wrote',h.Export(fil,dfmt,hint)) 885 939 except Exception as msg: 886 940 print('Failed to write {} as {}. Error msg\n{}' -
trunk/GSASIIimgGUI.py
r4345 r4361 100 100 if darkImg is not None: 101 101 sumImg += np.array(darkImage*darkScale,dtype='int32') 102 else: 103 print('Warning: resetting dark image (not found: {})'.format( 104 darkImg)) 105 data['dark image'][0] = darkImg = '' 102 106 if 'background image' in data: 103 107 backImg,backScale = data['background image'] -
trunk/docs/source/G2tools.rst
r4336 r4361 6 6 Both are under development. 7 7 8 .. automodule:: G2AutoInt 9 :members: 10 11 .. automodule:: GSASIIautoInt 8 .. automodule:: GSASIIIntPDFtool.py 12 9 :members: 13 10 -
trunk/exports/G2export_CIF.py
r4289 r4361 1417 1417 ' '+datablockidDict[phasenam] 1418 1418 ) 1419 el se:1419 elif len(self.Phases) == 1: 1420 1420 # single phase in this histogram 1421 pfx = '0:'+str(hId)+':' 1421 # get the phase number here 1422 pId = self.Phases[list(self.Phases.keys())[0]]['pId'] 1423 pfx = str(pId)+':'+str(hId)+':' 1422 1424 WriteCIFitem(self.fp, '_refine_ls_R_F_factor ','%.5f'%(histblk[pfx+'Rf']/100.)) 1423 1425 WriteCIFitem(self.fp, '_refine_ls_R_Fsqd_factor ','%.5f'%(histblk[pfx+'Rf^2']/100.)) 1424 1425 WriteCIFitem(self.fp, '_pd_proc_ls_prof_R_factor ','%.5f'%(histblk['R']/100.)) 1426 WriteCIFitem(self.fp, '_pd_proc_ls_prof_wR_factor ','%.5f'%(histblk['wR']/100.)) 1427 WriteCIFitem(self.fp, '_gsas_proc_ls_prof_R_B_factor ','%.5f'%(histblk['Rb']/100.)) 1428 WriteCIFitem(self.fp, '_gsas_proc_ls_prof_wR_B_factor','%.5f'%(histblk['wRb']/100.)) 1429 WriteCIFitem(self.fp, '_pd_proc_ls_prof_wR_expected','%.5f'%(histblk['wRmin']/100.)) 1426 1427 try: 1428 WriteCIFitem(self.fp, '_pd_proc_ls_prof_R_factor ','%.5f'%(histblk['R']/100.)) 1429 WriteCIFitem(self.fp, '_pd_proc_ls_prof_wR_factor ','%.5f'%(histblk['wR']/100.)) 1430 WriteCIFitem(self.fp, '_gsas_proc_ls_prof_R_B_factor ','%.5f'%(histblk['Rb']/100.)) 1431 WriteCIFitem(self.fp, '_gsas_proc_ls_prof_wR_B_factor','%.5f'%(histblk['wRb']/100.)) 1432 WriteCIFitem(self.fp, '_pd_proc_ls_prof_wR_expected','%.5f'%(histblk['wRmin']/100.)) 1433 except KeyError: 1434 pass 1430 1435 1431 1436 if histblk['Instrument Parameters'][0]['Type'][1][1] == 'X':
Note: See TracChangeset
for help on using the changeset viewer.