Changeset 1115 for trunk/exports/G2export_examples.py
- Timestamp:
- Oct 18, 2013 4:00:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/exports/G2export_examples.py ¶
r1102 r1115 8 8 # $Id$ 9 9 ########### SVN repository information ################### 10 '''Code to demonstrate how export routines are created10 '''Code to demonstrate how GSAS-II data export routines are created 11 11 ''' 12 12 import os.path … … 30 30 super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__ 31 31 G2frame=G2frame, 32 formatName = ' text',32 formatName = 'Text file', 33 33 extension='.txt', 34 34 longFormatName = 'Export phase as text file' … … 41 41 ''' 42 42 # the export process starts here 43 self.InitExport(event) 43 44 # load all of the tree into a set of dicts 44 45 self.loadTree() 45 46 # create a dict with refined values and their uncertainties 46 47 self.loadParmDict() 47 if self.SetupExport( # set export parameters 48 event, 48 if self.ExportSelect( # set export parameters 49 49 AskFile=True # prompt the user for a file name 50 50 ): return … … 114 114 super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__ 115 115 G2frame=G2frame, 116 formatName = ' text',116 formatName = 'Text file', 117 117 extension='.txt', 118 118 longFormatName = 'Export powder data as text file' … … 125 125 ''' 126 126 # the export process starts here 127 # load all of the tree into a set of dicts 128 self.loadTree() 129 print 'Exporter',self.defaultSaveFile() 130 if self.SetupExport( # set export parameters 131 event, 127 self.InitExport(event) 128 # load all of the tree into a set of dicts 129 self.loadTree() 130 if self.ExportSelect( # set export parameters 132 131 AskFile=False # use the default file name 133 132 #AskFile=True … … 136 135 hist = self.histnam[0] # there should only be one histogram, in any case take the 1st 137 136 histblk = self.Histograms[hist] 138 #inst = histblk['Instrument Parameters'][0]139 #hId = histblk['hId']140 #pfx = ':' + str(hId) + ':'141 137 fmt = 2*"{:12.3f} " + "{:12.5f} " + 2*"{:12.3f} " 142 138 hfmt = 5*"{:>12s} " … … 171 167 '''Export a set of powder reflections as a text file 172 168 ''' 173 # load all of the tree into a set of dicts174 self.loadTree()175 if self.SetupExport( # set export parameters176 event,169 self.InitExport(event) 170 # load all of the tree into a set of dicts 171 self.loadTree() 172 if self.ExportSelect( # set export parameters 177 173 AskFile=False # use the default file name 178 174 #AskFile=True … … 204 200 super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__ 205 201 G2frame=G2frame, 206 formatName = ' reflection list as text',202 formatName = 'Text file', 207 203 extension='.txt', 208 204 longFormatName = 'Export reflection list as a text file' … … 215 211 ''' 216 212 # the export process starts here 217 # load all of the tree into a set of dicts218 self.loadTree()219 if self.SetupExport( # set export parameters220 event,213 self.InitExport(event) 214 # load all of the tree into a set of dicts 215 self.loadTree() 216 if self.ExportSelect( # set export parameters 221 217 AskFile=False # use the default file name 222 218 #AskFile=True
Note: See TracChangeset
for help on using the changeset viewer.