Changeset 1181


Ignore:
Timestamp:
Jan 2, 2014 2:18:25 PM (10 years ago)
Author:
toby
Message:

bypass format bug, add histogram prms to parmDict, more docs

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1176 r1181  
    28042804        also the histograms used in each phase.
    28052805
    2806         :returns: (phaseRIdList, usedHistograms) where
    2807 
    2808           *
    2809           ,phaseRIdList,usedHistograms
     2806        :returns: (phaseRIdList, usedHistograms) where
     2807
     2808          * phaseRIdList is a list of random Id values for each phase
     2809          * usedHistograms is a dict where the keys are the phase names
     2810            and the values for each key are a list of the histogram names
     2811            used in each phase.
    28102812        '''
    28112813        phaseRIdList = []
     
    29142916        different than the parmDict used in the refinement, which only has
    29152917        values.
     2918
     2919        Note that similar things are done in
     2920        :meth:`GSASIIIO.ExportBaseclass.loadParmDict` (from the tree) and
     2921        :func:`GSASIIstrMain.Refine` and :func:`GSASIIstrMain.SeqRefine` (from
     2922        a GPX file).
    29162923
    29172924        :returns: (parmDict,varyList) where:
     
    29492956            else:
    29502957                parmDict[parm] = [parmDict[parm],'F']
     2958        # for i in parmDict: print i,'\t',parmDict[i]
     2959        # fl = open('parmDict.dat','wb')
     2960        # import cPickle
     2961        # cPickle.dump(parmDict,fl,1)
     2962        # fl.close()
    29512963        return parmDict,varyList
    29522964
  • trunk/GSASIIobj.py

    r1179 r1181  
    808808======================  ======================  ====================================================
    809809
     810Parameter Dictionary
     811-------------------------
     812
     813.. _parmDict_table:
     814
     815.. index::
     816   single: Parameter dictionary
     817
     818The parameter dictionary contains all of the variable parameters for the refinement.
     819The dictionary keys are the name of the parameter (<phase>:<hist>:<name>:<atom>).
     820It is prepared in two ways. When loaded from the tree
     821(in :meth:`GSASII.GSASII.MakeLSParmDict` and
     822:meth:`GSASIIIO.ExportBaseclass.loadParmDict`),
     823the values are lists with two elements: ``[value, refine flag]``
     824
     825When loaded from the GPX file (in
     826:func:`GSASIIstrMain.Refine` and :func:`GSASIIstrMain.SeqRefine`), the value in the
     827dict is the actual parameter value (usually a float, but sometimes a
     828letter or string flag value (such as I or A for iso/anisotropic).
     829
     830
    810831*Classes and routines*
    811832----------------------
     
    838859    :param str lbl: the input label
    839860    :param list labellist: the labels that have already been encountered
    840     :returns: lbl if not found in labellist or lbl with ``_1-9` (or
     861    :returns: lbl if not found in labellist or lbl with ``_1-9`` (or
    841862      ``_10-99``, etc.) appended at the end
    842863    '''
     
    921942    This is called in two places (only) :func:`GSASIIstrIO.GetUsedHistogramsAndPhases`
    922943    (which loads the histograms and phases from a GPX file) and
    923     :meth:`GSASII.GSASII.GetUsedHistogramsAndPhases`
     944    :meth:`GSASII.GSASII.GetUsedHistogramsAndPhasesfromTree`
    924945    (which loads the histograms and phases from the data tree.)
    925946
  • trunk/GSASIIpy3.py

    r1177 r1181  
    7373        decimals = maxdigits[0] - 1
    7474        fmt = "{" + (":{:d}.{:d}g".format(maxdigits[0],decimals))+"}"
    75     print fmt,val
    76     return fmt.format(val).strip()
     75    try:
     76        return fmt.format(val).strip()
     77    except ValueError as err:
     78        print 'FormatValue Error with val,maxdigits,fmt=',val,maxdigits,fmt
     79        return str(val)
  • trunk/GSASIIstrIO.py

    r1175 r1181  
    22202220        sampDict = {hfx+'Gonio. radius':Sample['Gonio. radius'],hfx+'Omega':Sample['Omega'],
    22212221            hfx+'Chi':Sample['Chi'],hfx+'Phi':Sample['Phi']}
     2222        for key in ('Temperature','Pressure','FreePrm1','FreePrm2','FreePrm3'):
     2223            if key in Sample:
     2224                sampDict[hfx+key] = Sample[key]
    22222225        Type = Sample['Type']
    22232226        if 'Bragg' in Type:             #Bragg-Brentano
Note: See TracChangeset for help on using the changeset viewer.