Changeset 4433 for trunk/exports


Ignore:
Timestamp:
May 25, 2020 3:08:15 PM (17 months ago)
Author:
toby
Message:

fix problem where histogram has reflections, but is not in phase; alternate atom selection -- in progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_CIF.py

    r4411 r4433  
    13381338            # compute maximum intensity reflection
    13391339            Imax = 0
     1340            phaselist = []
    13401341            for phasenam in histblk['Reflection Lists']:
    1341                 scale = self.Phases[phasenam]['Histograms'][histlbl]['Scale'][0]
     1342                try:
     1343                    scale = self.Phases[phasenam]['Histograms'][histlbl]['Scale'][0]
     1344                except KeyError: # reflection table from removed phase?
     1345                    continue
     1346                phaselist.append(phasenam)
    13421347                refList = np.asarray(histblk['Reflection Lists'][phasenam]['RefList'])
    13431348                I100 = scale*refList.T[8]*refList.T[11]
     
    13481353
    13491354            WriteCIFitem(self.fp, 'loop_')
    1350             if len(histblk['Reflection Lists'].keys()) > 1:
     1355            if len(phaselist) > 1:
    13511356                WriteCIFitem(self.fp, '   _pd_refln_phase_id')
    13521357            WriteCIFitem(self.fp, '   ' + refprx + 'index_h' +
     
    13651370            dmax = None
    13661371            dmin = None
    1367             for phasenam in histblk['Reflection Lists']:
     1372            for phasenam in phaselist:
    13681373                scale = self.Phases[phasenam]['Histograms'][histlbl]['Scale'][0]
    13691374                phaseid = self.Phases[phasenam]['pId']
     
    13801385                    if dmin is None:
    13811386                         dmax = dmin = ref[4]
    1382                     if len(histblk['Reflection Lists'].keys()) > 1:
     1387                    if len(phaselist) > 1:
    13831388                        s = PutInCol(phaseid,2)
    13841389                    else:
     
    13981403                    WriteCIFitem(self.fp, "  "+s)
    13991404
    1400             WriteReflStat(refcount,hklmin,hklmax,dmin,dmax,len(histblk['Reflection Lists']))
     1405            WriteReflStat(refcount,hklmin,hklmax,dmin,dmax,len(phaselist))
    14011406            WriteCIFitem(self.fp, '\n# POWDER DATA TABLE')
    14021407            # is data fixed step? If the step varies by <0.01% treat as fixed step
Note: See TracChangeset for help on using the changeset viewer.