Changeset 1127


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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1122 r1127  
    20342034                            name += '-1'
    20352035                    self.Histograms[name] = {}
     2036                    # the main info goes into Data, but the 0th
     2037                    # element contains refinement results, carry
     2038                    # that over too now.
    20362039                    self.Histograms[name]['Data'] = self.G2frame.PatternTree.GetItemPyData(item)[1]
     2040                    self.Histograms[name][0] = self.G2frame.PatternTree.GetItemPyData(item)[0]
    20372041                    item2, cookie2 = self.G2frame.PatternTree.GetFirstChild(item)
    20382042                    while item2:
  • trunk/GSASIIgrid.py

    r1126 r1127  
    32533253                mainSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,' For phase '+name+':'))
    32543254                mainSizer.Add(wx.StaticText(G2frame.dataDisplay,-1,
    3255                     ' Unweighted phase residuals RF^2: %.3f%%, RF: %.3f%% on %d reflections  '% \
     3255                    u' Unweighted phase residuals RF\u00b2: %.3f%%, RF: %.3f%% on %d reflections  '% \
    32563256                    (data[0][pfx+'Rf^2'],data[0][pfx+'Rf'],data[0][value])))
    32573257    mainSizer.Add((5,5),)
  • trunk/GSASIIobj.py

    r1126 r1127  
    353353Reflection Lists              \           A dict with an entry for each phase in the
    354354                                          histogram. The contents of each dict item
    355                                           is a list of reflections as described in the
    356                                           :ref:`Powder Reflections <PowderRefl_table>`
     355                                          is a dict containing reflections, as described in
     356                                          the :ref:`Powder Reflections <PowderRefl_table>`
    357357                                          description.
    358358Instrument Parameters         \           A list containing two dicts where the possible
     
    457457   single: Data object descriptions; Powder Reflections
    458458   
    459 For every phase in a histogram, the ``Reflection Lists`` value is a list of
    460 reflections. The items in that list are documented below.
     459For every phase in a histogram, the ``Reflection Lists`` value is a dict
     460one element of which is `'RefList'`, which is a np.array containing
     461reflections. The columns in that array are documented below.
    461462
    462463==========  ====================================================
     
    472473 9           :math:`F_{calc}^2`
    473474 10          reflection phase, in degrees
    474  11          the equivalent reflections as a (m x 3)
    475              np.array, where m is 0.5 * multiplicity. Note
    476              that Freidel pairs, (-h,-k-,l), are not
    477              included.
    478  12          phase shift for each of the equivalent
    479              reflections as a length (m) array
    480  13          intensity correction for reflection, this times
     475 11          intensity correction for reflection, this times
    481476             :math:`F_{obs}^2` or :math:`F_{calc}^2` gives Iobs or Icalc
    482  14          dict with the form factor (f or b) by atom type
    483              symbol at the reflection position.
    484477==========  ====================================================
    485478
     
    490483
    491484.. index::
    492    single: Single Crytsal data object description
     485   single: Single Crystal data object description
    493486   single: Data object descriptions; Single crystal data
    494487
     
    508501======================  ===============  ====================================================
    509502Data
    510                                           A list of lists, where each inner item
    511                                           is an individual reflection
     503                                          A dict that contains the
     504                                          reflection table,
    512505                                          as described in the
    513506                                          :ref:`Single Crystal Reflections
     
    549542   single: Data object descriptions; Single Crystal Reflections
    550543   
    551 For every phase in a histogram, the ``Reflection Lists`` value is a list of
    552 reflections. The items in that list are documented below.
     544For every simgle crystal a histogram, the ``'Data'`` item contains
     545the structure factors as an np.array in item `'RefList'`.
     546The columns in that array are documented below.
    553547
    554548==========  ====================================================
     
    564558 9           :math:`F_{calc}^2T`
    565559 10          reflection phase, in degrees
    566  11          the equivalent reflections as a (m x 3)
    567              np.array.
    568  12          phase shift for each of the equivalent
    569              reflections as a length (m) array
    570  13          intensity correction for reflection, this times
     560 11          intensity correction for reflection, this times
    571561             :math:`F_{obs}^2` or :math:`F_{calc}^2`
    572562             gives Iobs or Icalc
    573              (not used in single crystals?)
    574  14          dict with the form factor (f or b) by atom type
    575              symbol at the reflection position.
    576563==========  ====================================================
    577564
  • 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.