source: trunk/exports/G2export_csv.py @ 4190

Last change on this file since 4190 was 4190, checked in by vondreele, 2 years ago

add sample parameters to PWDR csv export file

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Author Revision URL Id
File size: 23.3 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3########### SVN repository information ###################
4# $Date: 2019-11-06 12:06:30 +0000 (Wed, 06 Nov 2019) $
5# $Author: vondreele $
6# $Revision: 4190 $
7# $URL: trunk/exports/G2export_csv.py $
8# $Id: G2export_csv.py 4190 2019-11-06 12:06:30Z vondreele $
9########### SVN repository information ###################
10'''
11*Module G2export_csv: Spreadsheet export*
12-------------------------------------------
13
14Code to create .csv (comma-separated variable) files for
15GSAS-II data export to a spreadsheet program, etc.
16
17'''
18from __future__ import division, print_function
19import os.path
20import numpy as np
21import GSASIIpath
22GSASIIpath.SetVersionNumber("$Revision: 4190 $")
23import GSASIIIO as G2IO
24import GSASIIpy3 as G2py3
25import GSASIIobj as G2obj
26import GSASIImath as G2mth
27import GSASIIpwd as G2pwd
28import GSASIIlattice as G2lat
29
30def WriteList(obj,headerItems):
31    '''Write a CSV header
32
33    :param object obj: Exporter object
34    :param list headerItems: items to write as a header
35    '''
36    line = ''
37    for lbl in headerItems:
38        if line: line += ','
39        line += '"'+lbl+'"'
40    obj.Write(line)
41
42class ExportPhaseCSV(G2IO.ExportBaseclass):
43    '''Used to create a csv file for a phase
44
45    :param wx.Frame G2frame: reference to main GSAS-II frame
46    '''
47    def __init__(self,G2frame):
48        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
49            G2frame=G2frame,
50            formatName = 'CSV file',
51            extension='.csv',
52            longFormatName = 'Export phase as comma-separated (csv) file'
53            )
54        self.exporttype = ['phase']
55        self.multiple = True # allow multiple phases to be selected
56
57    def Writer(self,hist,phasenam,mode='w'):
58        self.OpenFile(mode=mode)
59        # test for aniso atoms
60        aniso = False
61        AtomsList = self.GetAtoms(phasenam)
62        for lbl,typ,mult,xyz,td in AtomsList:
63            if len(td) != 1:
64                aniso = True
65                break
66        if mode == 'w':
67            lbllist = ['hist','phase','a','b','c','alpha','beta','gamma','volume']
68            lbllist += ["atm label","elem","mult","x","y","z","frac","Uiso"]
69            if aniso: lbllist += ['U11','U22','U33','U12','U13','U23']
70            WriteList(self,lbllist)
71           
72        cellList,cellSig = self.GetCell(phasenam)
73        line = '"' + str(hist)+ '","' + str(phasenam) + '"'
74        for defsig,val in zip(
75            3*[-0.00001] + 3*[-0.001] + [-0.01], # sets sig. figs.
76            cellList
77            ):
78            txt = G2mth.ValEsd(val,defsig)
79            if line: line += ','
80            line += txt
81        self.Write(line)
82
83        # get atoms and print separated by commas
84        AtomsList = self.GetAtoms(phasenam)
85        for lbl,typ,mult,xyz,td in AtomsList:
86            line = ",,,,,,,,,"
87            line += '"' + lbl + '","' + typ + '",' + str(mult) + ','
88            for val,sig in xyz:
89                line += G2mth.ValEsd(val,-abs(sig))
90                line += ","
91            if len(td) == 1:
92                line += G2mth.ValEsd(td[0][0],-abs(td[0][1]))
93            else:
94                line += ","
95                for val,sig in td:
96                    line += G2mth.ValEsd(val,-abs(sig))
97                    line += ","
98            self.Write(line)
99
100        if mode == 'w':
101            print('Phase '+phasenam+' written to file '+self.fullpath)
102        self.CloseFile()
103   
104    def Exporter(self,event=None):
105        '''Export a phase as a csv file
106        '''
107        # the export process starts here
108        self.InitExport(event)
109        # load all of the tree into a set of dicts
110        self.loadTree()
111        # create a dict with refined values and their uncertainties
112        self.loadParmDict()
113        if self.ExportSelect(): return # set export parameters; get file name
114        self.OpenFile()
115        # if more than one phase is selected, put them into a single file
116        for phasenam in self.phasenam:
117            phasedict = self.Phases[phasenam] # pointer to current phase info           
118            i = self.Phases[phasenam]['pId']
119            self.Write('"'+"Phase "+str(phasenam)+" from "+str(self.G2frame.GSASprojectfile)+'"')
120            self.Write('\n"Space group:","'+str(phasedict['General']['SGData']['SpGrp'].strip())+'"')
121            # get cell parameters & print them
122            cellList,cellSig = self.GetCell(phasenam)
123            WriteList(self,['a','b','c','alpha','beta','gamma','volume'])
124
125            line = ''
126            for defsig,val in zip(
127                3*[-0.00001] + 3*[-0.001] + [-0.01], # sign values to use when no sigma
128                cellList
129                ):
130                txt = G2mth.ValEsd(val,defsig)
131                if line: line += ','
132                line += txt
133            self.Write(line)
134               
135            # get atoms and print separated by commas
136            AtomsList = self.GetAtoms(phasenam)
137            # check for aniso atoms
138            aniso = False
139            for lbl,typ,mult,xyz,td in AtomsList:
140                if len(td) != 1: aniso = True               
141            lbllist = ["label","elem","mult","x","y","z","frac","Uiso"]
142            if aniso: lbllist += ['U11','U22','U33','U12','U13','U23']
143            WriteList(self,lbllist)
144               
145            for lbl,typ,mult,xyz,td in AtomsList:
146                line = '"' + lbl + '","' + typ + '",' + str(mult) + ','
147                for val,sig in xyz:
148                    line += G2mth.ValEsd(val,-abs(sig))
149                    line += ","
150                if len(td) == 1:
151                    line += G2mth.ValEsd(td[0][0],-abs(td[0][1]))
152                else:
153                    line += ","
154                    for val,sig in td:
155                        line += G2mth.ValEsd(val,-abs(sig))
156                        line += ","
157                self.Write(line)
158            print('Phase '+phasenam+' written to file '+self.fullpath)
159        self.CloseFile()
160
161class ExportPowderCSV(G2IO.ExportBaseclass):
162    '''Used to create a csv file for a powder data set
163
164    :param wx.Frame G2frame: reference to main GSAS-II frame
165    '''
166    def __init__(self,G2frame):
167        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
168            G2frame=G2frame,
169            formatName = 'histogram CSV file',
170            extension='.csv',
171            longFormatName = 'Export powder data as comma-separated (csv) file'
172            )
173        self.exporttype = ['powder']
174        #self.multiple = False # only allow one histogram to be selected
175        self.multiple = True
176
177    def Writer(self,TreeName,filename=None):
178        #print filename
179        self.OpenFile(filename)
180        histblk = self.Histograms[TreeName]
181        Parms = self.Histograms[TreeName]['Instrument Parameters'][0]
182        for parm in Parms:
183            if parm in ['Type','Source',]:
184                line = '"Instparm: %s","%s"'%(parm,Parms[parm][0])
185            elif parm in ['Lam','Zero',]:
186                line = '"Instparm: %s",%10.6f'%(parm,Parms[parm][1])
187            else:
188                line = '"Instparm: %s",%10.2f'%(parm,Parms[parm][1])
189            self.Write(line)
190        Samp = self.Histograms[TreeName]['Sample Parameters']
191        for samp in Samp:
192            if samp in ['InstrName','Type']:
193                line = '"Samparm: %s",%s'%(samp,Samp[samp])
194            elif samp in ['Azimuth','Chi','Gonio. radius','Omega','Phi','Pressure','Temperature','Time']:
195                line = '"Samparm: %s",%10.2f'%(samp,Samp[samp])
196            elif samp in ['DisplaceX','DisplaceY','Scale','Shift','SurfRoughA','SurfRoughB','Transparency']:
197                line = '"Samparm: %s",%10.2f'%(samp,Samp[samp][0])
198            else:
199                continue
200            self.Write(line)
201        WriteList(self,("x","y_obs","weight","y_calc","y_bkg","Q"))
202        digitList = 2*((13,3),) + ((13,5),) + 3*((13,3),)
203        for vallist in zip(histblk['Data'][0],
204                       histblk['Data'][1],
205                       histblk['Data'][2],
206                       histblk['Data'][3],
207                       histblk['Data'][4],
208                       #histblk['Data'][5],
209                       2*np.pi/G2lat.Pos2dsp(Parms,histblk['Data'][0])
210                       ):
211            line = ""
212            for val,digits in zip(vallist,digitList):
213                if line: line += ','
214                line += G2py3.FormatValue(val,digits)
215            self.Write(line)
216        self.CloseFile()
217       
218    def Exporter(self,event=None):
219        '''Export a set of powder data as a csv file
220        '''
221        # the export process starts here
222        self.InitExport(event)
223        # load all of the tree into a set of dicts
224        self.loadTree()
225        if self.ExportSelect( # set export parameters
226            AskFile='single' # get a file name/directory to save in
227            ): return
228        filenamelist = []
229        for hist in self.histnam:
230            if len(self.histnam) == 1:
231                name = self.filename
232            else:    # multiple files: create a unique name from the histogram
233                name = self.MakePWDRfilename(hist)
234            fileroot = os.path.splitext(G2obj.MakeUniqueLabel(name,filenamelist))[0]
235            # create the file
236            self.filename = os.path.join(self.dirname,fileroot + self.extension)
237            self.Writer(hist)
238            print('Histogram '+hist+' written to file '+self.fullpath)
239
240class ExportMultiPowderCSV(G2IO.ExportBaseclass):
241    '''Used to create a csv file for a stack of powder data sets suitable for display
242    purposes only; no y-calc or weights are exported only x & y-obs
243    :param wx.Frame G2frame: reference to main GSAS-II frame
244    '''
245    def __init__(self,G2frame):
246        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
247            G2frame=G2frame,
248            formatName = 'stacked CSV file',
249            extension='.csv',
250            longFormatName = 'Export powder data sets as a (csv) file - x,y-o1,y-o2,... only'
251            )
252        self.exporttype = ['powder']
253        #self.multiple = False # only allow one histogram to be selected
254        self.multiple = True
255
256    def Exporter(self,event=None):
257        '''Export a set of powder data as a single csv file
258        '''
259        # the export process starts here
260        self.InitExport(event)
261        # load all of the tree into a set of dicts
262        self.loadTree()
263        if self.ExportSelect( # set export parameters
264            AskFile='ask' # only one file is ever written
265            ): return
266        csvData = []
267        headList = ["x",]
268        digitList = []
269        self.filename = os.path.join(self.dirname,os.path.splitext(self.filename)[0]
270                                     + self.extension)
271        for ihst,hist in enumerate(self.histnam):
272            histblk = self.Histograms[hist]
273            headList.append('y_obs_'+G2obj.StripUnicode(hist[5:].replace(' ','_')))
274            if not ihst:
275                digitList = [(13,3),]
276                csvData.append(histblk['Data'][0])
277            digitList += [(13,3),]
278            csvData.append(histblk['Data'][1])
279            print('Histogram '+hist+' added to file...')
280        self.OpenFile()
281        WriteList(self,headList)
282        for vallist in np.array(csvData).T:
283            line = ""
284            for val,digits in zip(vallist,digitList):
285                if line: line += ','
286                line += G2py3.FormatValue(val,digits)
287            self.Write(line)
288        self.CloseFile()
289        print('...file '+self.fullpath+' written')
290
291class ExportPowderReflCSV(G2IO.ExportBaseclass):
292    '''Used to create a csv file of reflections from a powder data set
293
294    :param wx.Frame G2frame: reference to main GSAS-II frame
295    '''
296    def __init__(self,G2frame):
297        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
298            G2frame=G2frame,
299            formatName = 'reflection list as CSV',
300            extension='.csv',
301            longFormatName = 'Export powder reflection list as a comma-separated (csv) file'
302            )
303        self.exporttype = ['powder']
304        self.multiple = False # only allow one histogram to be selected
305
306    def Writer(self,TreeName,filename=None):
307        print(filename)
308        self.OpenFile(filename)
309        histblk = self.Histograms[TreeName]
310        self.write(TreeName,histblk)
311        self.CloseFile()
312        print(TreeName+' reflections written to file '+self.fullpath)
313       
314    def Exporter(self,event=None):
315        '''Export a set of powder reflections as a csv file
316        '''
317        self.InitExport(event)
318        # load all of the tree into a set of dicts
319        self.loadTree()
320        if self.ExportSelect(): return  # set export parameters, get file name
321        hist = list(self.histnam)[0] # there should only be one histogram, in any case take the 1st
322        histblk = self.Histograms[hist]
323        self.OpenFile()
324        self.write(hist,histblk)
325        self.CloseFile()
326        print(hist+' reflections written to file '+self.fullpath)
327       
328    def write(self,hist,histblk):
329        self.Write('"Histogram"')
330        self.Write('"'+hist+'"')
331        self.Write('')
332        # table of phases
333        self.Write('"Phase name","phase #"')
334        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
335            self.Write('"'+str(phasenam)+'",'+str(i))
336        self.Write('')
337        # note addition of a phase # flag at end (i)
338        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
339            phasDict = histblk['Reflection Lists'][phasenam]
340            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
341            if phasDict.get('Super',False):
342                WriteList(self,("h","k","l","m","d-sp",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #"))
343                if 'T' in phasDict['Type']:
344                    fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}"
345                else:
346                    fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}"
347                refList = phasDict['RefList']
348                for refItem in refList:
349                    if 'T' in phasDict['Type']:
350                        h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:17]
351                        FWHM = G2pwd.getgamFW(gam,sig)
352                        self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i))
353                    else:        #convert to deg       
354                        h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:14]
355                        s = np.sqrt(max(sig,0.0001))/100.   #var -> sig in deg
356                        g = gam/100.    #-> deg
357                        FWHM = G2pwd.getgamFW(g,s)
358                        self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,s,g,FWHM,i))
359            else:
360                WriteList(self,("h","k","l","d-sp",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #"))
361                if 'T' in phasDict['Type']:
362                    fmt = "{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.3f},{:.3f},{:.3f},{:.4f},{:d}"
363                else:
364                    fmt = "{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:.5f},{:.5f},{:.5f},{:.4f},{:d}"
365                refList = phasDict['RefList']
366                for refItem in refList:
367                    if 'T' in phasDict['Type']:
368                        h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:16]
369                        FWHM = G2pwd.getgamFW(gam,sig)
370                        self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,Prfo,i))
371                    else:        #convert to deg       
372                        h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:13]
373                        g = gam/100.
374                        s = np.sqrt(max(sig,0.0001))/100.
375                        FWHM = G2pwd.getgamFW(g,s)
376                        self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,s,g,FWHM,Prfo,i))
377       
378class ExportSASDCSV(G2IO.ExportBaseclass):
379    '''Used to create a csv file for a small angle data set
380
381    :param wx.Frame G2frame: reference to main GSAS-II frame
382    '''
383    def __init__(self,G2frame):
384        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
385            G2frame=G2frame,
386            formatName = 'CSV file',
387            extension='.csv',
388            longFormatName = 'Export small angle data as comma-separated (csv) file'
389            )
390        self.exporttype = ['sasd']
391        #self.multiple = False # only allow one histogram to be selected
392        self.multiple = True
393
394    def Writer(self,TreeName,filename=None):
395        self.OpenFile(filename)
396        histblk = self.Histograms[TreeName]
397        if len(self.Histograms[TreeName]['Models']['Size']['Distribution']):
398            self.Write('"Size Distribution"')
399            Distr = np.array(self.Histograms[TreeName]['Models']['Size']['Distribution'])
400            WriteList(self,("bin_pos","bin_width","bin_value"))
401            digitList = 2*((13,3),)+((13,4,'g'),)
402            for bindata in Distr.T:
403                line = ""
404                for val,digits in zip(bindata,digitList):
405                    if line: line += ','
406                    line += G2py3.FormatValue(val,digits)
407                self.Write(line)           
408        self.Write('"Small angle data"')
409        Parms = self.Histograms[TreeName]['Instrument Parameters'][0]
410        for parm in Parms:
411            if parm in ['Type','Source',]:
412                line = '"Instparm: %s","%s"'%(parm,Parms[parm][0])
413            elif parm in ['Lam',]:
414                line = '"Instparm: %s",%10.6f'%(parm,Parms[parm][1])
415            else:
416                line = '"Instparm: %s",%10.2f'%(parm,Parms[parm][1])
417            self.Write(line)
418        WriteList(self,("q","y_obs","y_sig","y_calc","y_bkg"))
419        digitList = 5*((13,5,'g'),)
420        for vallist in zip(histblk['Data'][0],
421                       histblk['Data'][1],
422                       1./np.sqrt(histblk['Data'][2]),
423                       histblk['Data'][3],
424                       histblk['Data'][4],
425                       ):
426            line = ""
427            for val,digits in zip(vallist,digitList):
428                if line: line += ','
429                line += G2py3.FormatValue(val,digits)
430            self.Write(line)
431        self.CloseFile()
432       
433    def Exporter(self,event=None):
434        '''Export a set of small angle data as a csv file
435        '''
436        # the export process starts here
437        self.InitExport(event)
438        # load all of the tree into a set of dicts
439        self.loadTree()
440        if self.ExportSelect( # set export parameters
441            AskFile='single' # get a file name/directory to save in
442            ): return
443        filenamelist = []
444        for hist in self.histnam:
445            if len(self.histnam) == 1:
446                name = self.filename
447            else:    # multiple files: create a unique name from the histogram
448                name = self.MakePWDRfilename(hist)
449            fileroot = os.path.splitext(G2obj.MakeUniqueLabel(name,filenamelist))[0]
450            # create the file
451            self.filename = os.path.join(self.dirname,fileroot + self.extension)
452            self.Writer(hist)
453            print('Histogram '+hist+' written to file '+self.fullpath)
454
455class ExportSingleCSV(G2IO.ExportBaseclass):
456    '''Used to create a csv file with single crystal reflection data
457
458    :param wx.Frame G2frame: reference to main GSAS-II frame
459    '''
460    def __init__(self,G2frame):
461        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
462            G2frame=G2frame,
463            formatName = 'CSV file',
464            extension='.csv',
465            longFormatName = 'Export reflection list as a comma-separated (csv) file'
466            )
467        self.exporttype = ['single']
468        self.multiple = False # only allow one histogram to be selected
469
470    def Exporter(self,event=None):
471        '''Export a set of single crystal data as a csv file
472        '''
473        # the export process starts here
474        self.InitExport(event)
475        # load all of the tree into a set of dicts
476        self.loadTree()
477        if self.ExportSelect(): return  # set export parameters, get file name
478        self.OpenFile()
479        hist = self.histnam[0] # there should only be one histogram, in any case take the 1st
480        histblk = self.Histograms[hist]
481        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
482            phasDict = histblk['Reflection Lists'][phasenam]
483            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
484            if phasDict.get('Super',False):
485                WriteList(self,("h","k","l","m",'d-sp',tname,"F_obs","F_calc","phase","mult","phase #"))
486                fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
487                refList = phasDict['RefList']
488                for refItem in refList:
489                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13]
490                    self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,i))               
491            else:
492                WriteList(self,("h","k","l",'d-sp',tname,"F_obs","F_calc","phase","mult","phase #"))
493                fmt = "{:.0f},{:.0f},{:.0f},{:.5f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
494                refList = phasDict['RefList']
495                for refItem in refList:
496                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
497                    self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,i))
498        self.CloseFile()
499        print(hist+' written to file '+self.fullname)                       
500
501class ExportStrainCSV(G2IO.ExportBaseclass):
502    '''Used to create a csv file with single crystal reflection data
503
504    :param wx.Frame G2frame: reference to main GSAS-II frame
505    '''
506    def __init__(self,G2frame):
507        super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__
508            G2frame=G2frame,
509            formatName = 'Strain CSV file',
510            extension='.csv',
511            longFormatName = 'Export strain results as a comma-separated (csv) file'
512            )
513        self.exporttype = ['image']
514        self.multiple = False # only allow one histogram to be selected
515
516    def Exporter(self,event=None):
517        '''Export a set of single crystal data as a csv file
518        '''
519        # the export process starts here
520        self.InitExport(event)
521        # load all of the tree into a set of dicts
522        self.loadTree()
523        if self.ExportSelect(): return  # set export parameters, get file name
524        self.OpenFile()
525        hist = self.histnam[0] # there should only be one histogram, in any case take the 1st
526        histblk = self.Histograms[hist]
527        StrSta = histblk['Stress/Strain']
528        WriteList(self,("Dset","Dcalc","e11","sig(e11)","e12","sig(e12)","e22","sig(e22)"))
529        fmt = 2*"{:.5f},"+6*"{:.0f},"
530        fmt1 = "{:.5f}"
531        fmt2 = "{:.2f},{:.5f},{:.5f}"
532        for item in StrSta['d-zero']:
533            Emat = item['Emat']
534            Esig = item['Esig']
535            self.Write(fmt.format(item['Dset'],item['Dcalc'],Emat[0],Esig[0],Emat[1],Esig[1],Emat[2],Esig[2]))
536        for item in StrSta['d-zero']:
537            WriteList(self,("Azm","dobs","dcalc","Dset="+fmt1.format(item['Dset'])))
538            ring = np.vstack((item['ImtaObs'],item['ImtaCalc']))
539            for dat in ring.T:
540                self.Write(fmt2.format(dat[1],dat[0],dat[2]))           
541        self.CloseFile()
542        print(hist+' written to file '+self.fullpath)
Note: See TracBrowser for help on using the repository browser.