Ignore:
Timestamp:
Mar 25, 2015 3:42:15 PM (7 years ago)
Author:
vondreele
Message:

fix exports of reflection csv & txt files to work for CW & TOF data as well as
3 & (3+1) symmetries
fix Det-X --> Det-Y
remove a Yield - caused crash
fix c-unique & a-unique monoclinit cell refinement & display
fix cif readers for phase

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_csv.py

    r1761 r1762  
    246246        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
    247247            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 #"))
     248            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
     249            if phasDict.get('Super',False):
     250                WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","phase #"))
    250251                fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
    251252                refList = phasDict['RefList']
    252253                for refItem in refList:
    253                     h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
     254                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13]
    254255                    self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,i))               
    255256            else:
    256                 WriteList(self,("h","k","l","2-theta","F_obs","F_calc","phase","mult","phase #"))
     257                WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","phase #"))
    257258                fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
    258259                refList = phasDict['RefList']
    259260                for refItem in refList:
    260                     h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:11]
     261                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
    261262                    self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
    262263        self.CloseFile()
     
    289290        hist = self.histnam[0] # there should only be one histogram, in any case take the 1st
    290291        histblk = self.Histograms[hist]
    291         WriteList(self,("h","k","l","d-space","F_obs","sig(Fobs)","F_calc","phase","mult"))
    292         fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.2f},{:.4f},{:.2f},{:.2f},{:.0f}"
    293         for (
    294             h,k,l,mult,dsp,Fobs,sigFobs,Fcalc,FobsT,FcalcT,phase,Icorr
    295             ) in histblk['Data']['RefList']:
    296             self.Write(fmt.format(h,k,l,dsp,Fobs,sigFobs,Fcalc,phase,mult))
     292        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
     293            phasDict = histblk['Reflection Lists'][phasenam]
     294            tname = {'T':'TOF','C':'2-theta'}[phasDict['Type'][2]]
     295            if phasDict.get('Super',False):
     296                WriteList(self,("h","k","l","m",tname,"F_obs","F_calc","phase","mult","phase #"))
     297                fmt = "{:.0f},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     298                refList = phasDict['RefList']
     299                for refItem in refList:
     300                    h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:13]
     301                    self.Write(fmt.format(h,k,l,m,pos,Fobs,Fcalc,phase,mult,i))               
     302            else:
     303                WriteList(self,("h","k","l",tname,"F_obs","F_calc","phase","mult","phase #"))
     304                fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f},{:.2f},{:.0f},{:d}"
     305                refList = phasDict['RefList']
     306                for refItem in refList:
     307                    h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr = refItem[:12]
     308                    self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
    297309        self.CloseFile()
    298310        print(str(hist)+' written to file '+str(self.fullname))                       
Note: See TracChangeset for help on using the changeset viewer.