Ignore:
Timestamp:
Oct 18, 2013 4:00:32 PM (12 years ago)
Author:
toby
Message:

rework exports for new types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/exports/G2export_examples.py

    r1102 r1115  
    88# $Id$
    99########### SVN repository information ###################
    10 '''Code to demonstrate how export routines are created
     10'''Code to demonstrate how GSAS-II data export routines are created
    1111'''
    1212import os.path
     
    3030        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
    3131            G2frame=G2frame,
    32             formatName = 'text',
     32            formatName = 'Text file',
    3333            extension='.txt',
    3434            longFormatName = 'Export phase as text file'
     
    4141        '''
    4242        # the export process starts here
     43        self.InitExport(event)
    4344        # load all of the tree into a set of dicts
    4445        self.loadTree()
    4546        # create a dict with refined values and their uncertainties
    4647        self.loadParmDict()
    47         if self.SetupExport( # set export parameters
    48             event,                         
     48        if self.ExportSelect( # set export parameters
    4949            AskFile=True     # prompt the user for a file name
    5050            ): return
     
    114114        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
    115115            G2frame=G2frame,
    116             formatName = 'text',
     116            formatName = 'Text file',
    117117            extension='.txt',
    118118            longFormatName = 'Export powder data as text file'
     
    125125        '''
    126126        # 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
    132131            AskFile=False # use the default file name
    133132            #AskFile=True
     
    136135        hist = self.histnam[0] # there should only be one histogram, in any case take the 1st
    137136        histblk = self.Histograms[hist]
    138         #inst = histblk['Instrument Parameters'][0]
    139         #hId = histblk['hId']
    140         #pfx = ':' + str(hId) + ':'
    141137        fmt = 2*"{:12.3f} " + "{:12.5f} " + 2*"{:12.3f} "
    142138        hfmt = 5*"{:>12s} "
     
    171167        '''Export a set of powder reflections as a text file
    172168        '''
    173         # load all of the tree into a set of dicts
    174         self.loadTree()
    175         if self.SetupExport( # set export parameters
    176             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
    177173            AskFile=False # use the default file name
    178174            #AskFile=True
     
    204200        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
    205201            G2frame=G2frame,
    206             formatName = 'reflection list as text',
     202            formatName = 'Text file',
    207203            extension='.txt',
    208204            longFormatName = 'Export reflection list as a text file'
     
    215211        '''
    216212        # the export process starts here
    217         # load all of the tree into a set of dicts
    218         self.loadTree()
    219         if self.SetupExport( # set export parameters
    220             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
    221217            AskFile=False # use the default file name
    222218            #AskFile=True
Note: See TracChangeset for help on using the changeset viewer.