Changeset 4119 for trunk/exports/G2export_csv.py
- Timestamp:
- Aug 28, 2019 11:11:22 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exports/G2export_csv.py
r3825 r4119 167 167 super(self.__class__,self).__init__( # fancy way to say <parentclass>.__init__ 168 168 G2frame=G2frame, 169 formatName = ' CSV file',169 formatName = 'histogram CSV file', 170 170 extension='.csv', 171 171 longFormatName = 'Export powder data as comma-separated (csv) file' … … 293 293 self.multiple = False # only allow one histogram to be selected 294 294 295 def Writer(self,TreeName,filename=None): 296 print(filename) 297 self.OpenFile(filename) 298 histblk = self.Histograms[TreeName] 299 self.write(TreeName,histblk) 300 self.CloseFile() 301 print(TreeName+' reflections written to file '+self.fullpath) 302 295 303 def Exporter(self,event=None): 296 304 '''Export a set of powder reflections as a csv file … … 300 308 self.loadTree() 301 309 if self.ExportSelect(): return # set export parameters, get file name 302 self.OpenFile()303 310 hist = list(self.histnam)[0] # there should only be one histogram, in any case take the 1st 304 311 histblk = self.Histograms[hist] 312 self.OpenFile() 313 self.write(hist,histblk) 314 self.CloseFile() 315 print(hist+' reflections written to file '+self.fullpath) 316 317 def write(self,hist,histblk): 305 318 self.Write('"Histogram"') 306 319 self.Write('"'+hist+'"') … … 351 364 FWHM = G2pwd.getgamFW(g,s) 352 365 self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,s,g,FWHM,Prfo,i)) 353 self.CloseFile() 354 print(hist+' reflections written to file '+self.fullpath) 355 366 356 367 class ExportSASDCSV(G2IO.ExportBaseclass): 357 368 '''Used to create a csv file for a small angle data set
Note: See TracChangeset
for help on using the changeset viewer.