Changeset 2152 for trunk/exports


Ignore:
Timestamp:
Feb 18, 2016 1:01:27 PM (6 years ago)
Author:
vondreele
Message:

all PWDR exporters will make file name from histogram name
allow read of multibank data
alert user to duplicate histograms (by name)
rename data will not change Bank or Azm part of histogram name
fix L&R plotting commands for TOF data

Location:
trunk/exports
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_FIT2D.py

    r2133 r2152  
    6565        filenamelist = []
    6666        for hist in self.histnam:
    67             fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(self.histnam[0]),filenamelist)
     67            # multiple files: create a unique name from the histogram
     68            fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
     69            # create an instrument parameter file
    6870            self.filename = os.path.join(self.dirname,fileroot + self.extension)
    6971            self.Writer(hist)
  • trunk/exports/G2export_csv.py

    r2132 r2152  
    127127
    128128    def Writer(self,TreeName,filename=None):
     129        print filename
    129130        self.OpenFile(filename)
    130131        histblk = self.Histograms[TreeName]
     
    157158        filenamelist = []
    158159        for hist in self.histnam:
    159             #if len(self.histnam) > 1:
    160             #    # multiple files: create a unique name from the histogram
    161             #    fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
    162             #    # create an instrument parameter file
    163             #    self.filename = os.path.join(self.dirname,fileroot + self.extension)
     160            # multiple files: create a unique name from the histogram
     161            fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
     162            # create an instrument parameter file
     163            self.filename = os.path.join(self.dirname,fileroot + self.extension)
    164164            self.Writer(hist)
    165165            print('Histogram '+str(hist)+' written to file '+str(self.fullpath))
  • trunk/exports/G2export_pwdr.py

    r2026 r2152  
    9797        filenamelist = []
    9898        for hist in self.histnam:
    99             if len(self.histnam) > 1:
    100                 # multiple files: create a unique name from the histogram
    101                 fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
    102                 # create an instrument parameter file
    103                 self.filename = os.path.join(self.dirname,fileroot + self.extension)
    104             else:
    105                 # use the supplied name, but force the extension
    106                 self.filename= os.path.splitext(self.filename)[0] + self.extension
    107 
     99            # multiple files: create a unique name from the histogram
     100            fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
     101            # create an instrument parameter file
     102            self.filename = os.path.join(self.dirname,fileroot + self.extension)
    108103            histblk = self.Histograms[hist]
    109104            prmname = self.WriteInstFile(hist,histblk['Instrument Parameters'][0])
    110105            self.Writer(hist,prmname=prmname)
    111106            print('Histogram '+str(hist)+' written to file '+str(self.fullpath))
    112 
    113107
    114108class ExportPowderXYE(G2IO.ExportBaseclass):
     
    157151        filenamelist = []
    158152        for hist in self.histnam:
    159             if len(self.histnam) > 1:
    160                 # multiple files: create a unique name from the histogram
    161                 fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
    162                 # create an instrument parameter file
    163                 self.filename = os.path.join(self.dirname,fileroot + self.extension)
    164             else:
    165                 # use the supplied name, but force the extension
    166                 self.filename= os.path.splitext(self.filename)[0] + self.extension
    167 
     153            # multiple files: create a unique name from the histogram
     154            fileroot = G2obj.MakeUniqueLabel(self.MakePWDRfilename(hist),filenamelist)
     155            # create an instrument parameter file
     156            self.filename = os.path.join(self.dirname,fileroot + self.extension)
    168157            self.Writer(hist)
    169158            print('Histogram '+str(hist)+' written to file '+str(self.fullpath))
Note: See TracChangeset for help on using the changeset viewer.