Changeset 1760 for trunk


Ignore:
Timestamp:
Mar 24, 2015 9:05:08 AM (8 years ago)
Author:
vondreele
Message:

fix csv exporter for reflection lists

Location:
trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      Exercises
  • trunk/exports/G2export_csv.py

    r1630 r1760  
    244244        self.Write('')
    245245        # note addition of a phase # flag at end (i)
    246         WriteList(self,("h","k","l","2-theta","F_obs","F_calc","phase","mult","phase #"))
    247         fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
    248246        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
    249             for (
    250                 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr
    251                 ) in histblk['Reflection Lists'][phasenam]['RefList']:
    252                 self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
     247            phasDict = histblk['Reflection Lists'][phasenam]
     248            if phasDict['Super']:
     249                WriteList(self,("h","k","l","m","2-theta","F_obs","F_calc","phase","mult","phase #"))
     250                fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     251                refList = phasDict['RefList']
     252                for (
     253                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x
     254                    ) in refList:
     255                    self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,i))               
     256            else:
     257                WriteList(self,("h","k","l","2-theta","F_obs","F_calc","phase","mult","phase #"))
     258                fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     259                refList = phasDict['RefList']
     260                for (
     261                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x
     262                    ) in refList:
     263                    self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
    253264        self.CloseFile()
    254265        print(str(hist)+'reflections written to file '+str(self.fullpath))
Note: See TracChangeset for help on using the changeset viewer.