Ignore:
Timestamp:
Mar 5, 2014 1:51:53 PM (8 years ago)
Author:
toby
Message:

Add FXYE & XYE exporters; allow multiple powder exports; fix formatting of float32 intensities (which should be gone); minor sequential refinement changes; remove old export patterns items; new padded format routine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_examples.py

    r1127 r1236  
    2424GSASIIpath.SetVersionNumber("$Revision$")
    2525import GSASIIIO as G2IO
     26import GSASIIpy3 as G2py3
    2627#import GSASIIgrid as G2gd
    2728#import GSASIIstrIO as G2stIO
     
    145146        hist = self.histnam[0] # there should only be one histogram, in any case take the 1st
    146147        histblk = self.Histograms[hist]
    147         fmt = 2*"{:12.3f} " + "{:12.5f} " + 2*"{:12.3f} "
    148         hfmt = 5*"{:>12s} "
     148        hfmt = 5*"{:12s} "
     149        digitList = 2*((13,3),) + ((13,5),) + 2*((13,3),)
     150       
    149151        self.Write(hfmt.format("x","y_obs","weight","y_calc","y_bkg"))
    150         for x,yobs,yw,ycalc,ybkg,obsmcalc in zip(histblk['Data'][0],
    151                                                  histblk['Data'][1],
    152                                                  histblk['Data'][2],
    153                                                  histblk['Data'][3],
    154                                                  histblk['Data'][4],
    155                                                  histblk['Data'][5],
    156                                                  ):
    157             self.Write(fmt.format(x,yobs,yw,ycalc,ybkg))
    158         self.CloseFile()
    159         print(str(hist)+' written to file '+str(self.filename))                       
     152        for vallist in zip(histblk['Data'][0],
     153                           histblk['Data'][1],
     154                           histblk['Data'][2],
     155                           histblk['Data'][3],
     156                           histblk['Data'][4],
     157                           #histblk['Data'][5],
     158                           ):
     159            strg = ''
     160            for val,digits in zip(vallist,digitList):
     161                strg += G2py3.FormatPadValue(val,digits)
     162            self.Write(strg)
     163        self.CloseFile()
     164        print(str(hist)+' written to file '+str(self.filename))
     165       
    160166class ExportPowderReflText(G2IO.ExportBaseclass):
    161167    '''Used to create a text file of reflections from a powder data set
Note: See TracChangeset for help on using the changeset viewer.