Changeset 1127 for trunk/exports


Ignore:
Timestamp:
Oct 29, 2013 11:42:23 AM (8 years ago)
Author:
toby
Message:

more export changes to catch up to data structure updates; update docs; change RF2 to use superscript since 2 is not working -- at least on Mac

Location:
trunk/exports
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_CIF.py

    r1126 r1127  
    11561156            'Write out the selected single crystal histogram info'
    11571157            histblk = self.Histograms[histlbl]
     1158
    11581159            #refprx = '_refln.' # mm
    11591160            refprx = '_refln_' # normal
     
    12001201                dmin = min(dmin,ref[4])
    12011202                WriteCIFitem(s)
    1202             WriteReflStat(refcount,hklmin,hklmax,dmin,dmax)
    1203             hId = histblk['hId']
    1204             pfx = '0:'+str(hId)+':'
    1205             WriteCIFitem('_reflns_wR_factor_obs    ','%.4f'%(histblk['wR']/100.))
    1206             WriteCIFitem('_reflns_R_F_factor_obs   ','%.4f'%(histblk[pfx+'Rf']/100.))
    1207             WriteCIFitem('_reflns_R_Fsqd_factor_obs','%.4f'%(histblk[pfx+'Rf^2']/100.))
     1203            if not self.quickmode: # statistics only in a full CIF
     1204                WriteReflStat(refcount,hklmin,hklmax,dmin,dmax)
     1205                hId = histblk[0]['hId']
     1206                pfx = '0:'+str(hId)+':'
     1207                WriteCIFitem('_reflns_wR_factor_obs    ','%.4f'%(histblk[0]['wR']/100.))
     1208                WriteCIFitem('_reflns_R_F_factor_obs   ','%.4f'%(histblk[0][pfx+'Rf']/100.))
     1209                WriteCIFitem('_reflns_R_Fsqd_factor_obs','%.4f'%(histblk[0][pfx+'Rf^2']/100.))
    12081210        def EditAuthor(event=None):
    12091211            'dialog to edit the CIF author info'
     
    15651567        self.quickmode = False
    15661568        phasenam = None # include all phases
    1567         if self.mode != "full" or len(self.powderDict) + len(self.xtalDict) == 0:
    1568             self.quickmode = True
    1569             oneblock = True
    1570             if len(self.Phases) == 0:
     1569        if self.mode == "simple" and self.currentExportType == 'phase':
     1570            if len(self.Phases) == 0: # this check is probably not needed
    15711571                self.G2frame.ErrorDialog(
    15721572                    'No phase present',
    15731573                    'Cannot create a coordinates CIF with no phases')
    15741574                return
    1575             elif len(self.Phases) > 1: # quick mode: get selected phase
     1575            self.quickmode = True
     1576            oneblock = True
     1577            if len(self.Phases) > 1: # quick mode: get selected phase
    15761578                phasenam = self.phasenam[0]
    1577         # will this require a multiblock CIF?
     1579        elif self.mode == "simple": # powder/single xtal data export
     1580            self.quickmode = True
     1581            oneblock = True
     1582        # Project export: will this require a multiblock CIF?
    15781583        elif len(self.Phases) > 1:
    15791584            oneblock = False
     
    15831588            oneblock = True
    15841589
    1585         # make sure needed infomation is present
     1590        # make sure required information is present
    15861591        # get CIF author name -- required for full CIFs
    15871592        try:
  • trunk/exports/G2export_csv.py

    r1123 r1127  
    192192        for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])):
    193193            for (
    194                 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,eqlist,phaselist,Icorr,FFdict
    195                 ) in histblk['Reflection Lists'][phasenam]:
     194                h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr
     195                ) in histblk['Reflection Lists'][phasenam]['RefList']:
    196196                self.Write(fmt.format(h,k,l,pos,Fobs,Fcalc,phase,mult,i))
    197197        self.CloseFile()
     
    229229        fmt = "{:.0f},{:.0f},{:.0f},{:.3f},{:.2f},{:.4f},{:.2f},{:.2f},{:.0f}"
    230230        for (
    231             h,k,l,mult,dsp,Fobs,sigFobs,Fcalc,FobsT,FcalcT,phase,eqlist,phaselist,Icorr,FFdict
    232             ) in histblk['Data']:
     231            h,k,l,mult,dsp,Fobs,sigFobs,Fcalc,FobsT,FcalcT,phase,Icorr
     232            ) in histblk['Data']['RefList']:
    233233            self.Write(fmt.format(h,k,l,dsp,Fobs,sigFobs,Fcalc,phase,mult))
    234234        self.CloseFile()
  • trunk/exports/G2export_examples.py

    r1123 r1127  
    195195            self.Write(80*'=')
    196196            for (
    197                 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,eqlist,phaselist,Icorr,FFdict
    198                 ) in histblk['Reflection Lists'][phasenam]:
     197                h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr
     198                ) in histblk['Reflection Lists'][phasenam]['RefList']:
    199199                self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult))
    200200        self.CloseFile()
     
    237237        self.Write(80*'=')
    238238        for (
    239             h,k,l,mult,dsp,Fobs,sigFobs,Fcalc,FobsT,FcalcT,phase,eqlist,phaselist,Icorr,FFdict
    240             ) in histblk['Data']:
     239            h,k,l,mult,dsp,Fobs,sigFobs,Fcalc,FobsT,FcalcT,phase,Icorr
     240            ) in histblk['Data']['RefList']:
    241241            self.Write(fmt.format(hklfmt.format(h,k,l),dsp,Fobs,sigFobs,Fcalc,phase,mult))
    242242        self.CloseFile()
Note: See TracChangeset for help on using the changeset viewer.