Ignore:
Timestamp:
Dec 16, 2013 10:43:01 AM (9 years ago)
Author:
toby
Message:

update imports to provide error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sphinxdocs/build/html/_modules/GSASIIobj.html

    r1112 r1168  
    5151           
    5252  <h1>Source code for GSASIIobj</h1><div class="highlight"><pre>
    53 <span class="c"># TODO: change this to assemble the look-up tables of atoms, phases and hists from the tree</span>
    54 <span class="c"># and then save/unsave those values in __init__ &amp; __str__, etc. </span>
     53<span class="c"># -*- coding: utf-8 -*-</span>
     54<span class="c">#GSASIIobj - data objects for GSAS-II</span>
     55<span class="c">########### SVN repository information ###################</span>
     56<span class="c"># $Date: 2013-11-22 16:24:29 -0600 (Fri, 22 Nov 2013) $</span>
     57<span class="c"># $Author: toby $</span>
     58<span class="c"># $Revision: 1147 $</span>
     59<span class="c"># $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/GSASIIobj.py $</span>
     60<span class="c"># $Id: GSASIIobj.py 1147 2013-11-22 22:24:29Z toby $</span>
     61<span class="c">########### SVN repository information ###################</span>
    5562
    5663<span class="sd">&#39;&#39;&#39;</span>
     
    5865<span class="sd">=========================</span>
    5966
    60 <span class="sd">This module defines and/or documents the data structures used in GSAS-II.</span>
    61 
     67<span class="sd">This module defines and/or documents the data structures used in GSAS-II, as well</span>
     68<span class="sd">as provides misc. support routines. </span>
    6269
    6370<span class="sd">Constraints Tree Item</span>
     
    7885<span class="sd">Note that the contents of each dict item is a List where each element in the</span>
    7986<span class="sd">list is a :ref:`constraint definition objects &lt;Constraint_definitions_table&gt;`.</span>
     87<span class="sd">The constraints in this form are converted in</span>
     88<span class="sd">:func:`GSASIIstrIO.ProcessConstraints` to the form used in :mod:`GSASIImapvars`</span>
    8089
    8190<span class="sd">The keys in the Constraints dict are:</span>
     
    106115<span class="sd">   single: Data object descriptions; Constraint Definition</span>
    107116
    108 <span class="sd">Each constraint is defined as a list using a series of terms of form</span>
    109 
    110 <span class="sd">::</span>
    111 
    112 <span class="sd">[[&lt;mult1&gt;, &lt;var1&gt;], [&lt;mult2&gt;, &lt;var2&gt;],..., &lt;fixed val&gt;, &lt;vary flag&gt;, &lt;cons type&gt;]</span>
    113 
    114 <span class="sd">Where the variable pair list item containing two values [&lt;mult&gt;, &lt;var&gt;], </span>
     117<span class="sd">Each constraint is defined as an item in a list. Each constraint is of form::</span>
     118
     119<span class="sd">[[&lt;mult1&gt;, &lt;var1&gt;], [&lt;mult2&gt;, &lt;var2&gt;],..., &lt;fixedval&gt;, &lt;varyflag&gt;, &lt;constype&gt;]</span>
     120
     121<span class="sd">Where the variable pair list item containing two values [&lt;mult&gt;, &lt;var&gt;], where: </span>
    115122
    116123<span class="sd">  * &lt;mult&gt; is a multiplier for the constraint (float)</span>
    117 <span class="sd">  * &lt;var&gt; is the name of the variable (str) (or to be implemented a :class:`VarName` object.)</span>
     124<span class="sd">  * &lt;var&gt; a :class:`G2VarObj` object (previously a str variable name of form</span>
     125<span class="sd">      &#39;p:h:name[:at]&#39;)</span>
    118126
    119127<span class="sd">Note that the last three items in the list play a special role:</span>
    120128
    121 <span class="sd"> * &lt;fixed val&gt; is the fixed value for a constraint equation or is None</span>
    122 <span class="sd"> * &lt;vary flag&gt; is True, False or None and is intended to use to indicate if new variables</span>
     129<span class="sd"> * &lt;fixedval&gt; is the fixed value for a `constant equation` (``constype=c``)</span>
     130<span class="sd">   constraint or is None. For a `New variable` (``constype=f``) constraint,</span>
     131<span class="sd">   a variable name can be specified as a str (used for externally</span>
     132<span class="sd">   generated constraints)</span>
     133<span class="sd"> * &lt;varyflag&gt; is True or False for `New variable` (``constype=f``) constraints</span>
     134<span class="sd">   or is None. This will be implemented in the future to indicate if these variables</span>
    123135<span class="sd">   should be refined.</span>
    124 <span class="sd"> * &lt;cons type&gt; is one of four letters, &#39;e&#39;, &#39;c&#39;, &#39;h&#39;, &#39;f&#39; that determines the type of constraint.</span>
     136<span class="sd"> * &lt;constype&gt; is one of four letters, &#39;e&#39;, &#39;c&#39;, &#39;h&#39;, &#39;f&#39; that determines the type of constraint:</span>
    125137
    126138<span class="sd">    * &#39;e&#39; defines a set of equivalent variables. Only the first variable is refined (if the</span>
    127139<span class="sd">      appropriate refine flag is set) and and all other equivalent variables in the list</span>
    128 <span class="sd">      are generated from that variable. The vary flag for those variables is ignored.</span>
    129 <span class="sd">    * &#39;c&#39; defines a constraint equation of form, :math:`m_1 \\times var_1 + m_2 \\times var_2 + ... = c`</span>
    130 <span class="sd">    * &#39;h&#39; defines a variable to hold (not vary). Any variable on this list is not varied, even if its refinement</span>
    131 <span class="sd">      flag is set. This is of particular value when needing to hold one or more variables in a set such as</span>
     140<span class="sd">      are generated from that variable, using the appropriate multipliers. </span>
     141<span class="sd">    * &#39;c&#39; defines a constraint equation of form,</span>
     142<span class="sd">      :math:`m_1 \\times var_1 + m_2 \\times var_2 + ... = c`</span>
     143<span class="sd">    * &#39;h&#39; defines a variable to hold (not vary). Any variable on this list is not varied,</span>
     144<span class="sd">      even if its refinement flag is set. Only one [mult,var] pair is allowed in a hold</span>
     145<span class="sd">      constraint and the mult value is ignored.</span>
     146<span class="sd">      This is of particular value when needing to hold one or more variables where a</span>
     147<span class="sd">      single flag controls a set of variables such as, coordinates, </span>
    132148<span class="sd">      the reciprocal metric tensor or anisotropic displacement parameter. </span>
    133 <span class="sd">    * &#39;f&#39; defines a relationship to define a new variable according to relationship </span>
     149<span class="sd">    * &#39;f&#39; defines a new variable (function) according to relationship </span>
    134150<span class="sd">      :math:`newvar = m_1 \\times var_1 + m_2 \\times var_2 + ...`</span>
    135151
     
    200216<span class="sd">  \         F000N            neutron F(000) intensity (float)</span>
    201217<span class="sd">  \         Mydir            directory of current .gpx file (str)</span>
    202 <span class="sd">  \         MCSA controls    ?</span>
    203 <span class="sd">  \         Cell             List with 7 items: cell refinement flag (bool)</span>
     218<span class="sd">  \         MCSA controls    Monte Carlo-Simulated Annealing controls (dict)</span>
     219<span class="sd">  \         Cell             List with 8 items: cell refinement flag (bool)</span>
    204220<span class="sd">                             a, b, c, (Angstrom, float)</span>
    205221<span class="sd">                             alpha, beta &amp; gamma (degrees, float)</span>
    206 <span class="sd">  \         Type             for now &#39;nuclear&#39; (str)</span>
     222<span class="sd">                             volume (A^3, float)</span>
     223<span class="sd">  \         Type             &#39;nuclear&#39; or &#39;macromolecular&#39; for now (str)</span>
    207224<span class="sd">  \         Map              dict of map parameters</span>
    208225<span class="sd">  \         SH Texture       dict of spherical harmonic preferred orientation </span>
     
    216233<span class="sd">  \         Pawley neg wt    Restraint value for negative Pawley intensities</span>
    217234<span class="sd">                             (float)</span>
    218 <span class="sd">  \         Flip             Charge flip controls dict?</span>
    219 <span class="sd">  \         Data plot type   ?</span>
     235<span class="sd">  \         Flip             dict of Charge flip controls </span>
     236<span class="sd">  \         Data plot type   data plot type (&#39;Mustrain&#39;, &#39;Size&#39; or </span>
     237<span class="sd">                             &#39;Preferred orientation&#39;) for powder data (str)</span>
    220238<span class="sd">  \         Mass             Mass of unit cell contents in g/mol</span>
    221239<span class="sd">  \         POhkl            March-Dollase preferred orientation direction</span>
    222 <span class="sd">  \         Z                ?</span>
    223 <span class="sd">  \         vdWRadii         ?</span>
     240<span class="sd">  \         Z                dict of atomic numbers for each atom type </span>
     241<span class="sd">  \         vdWRadii         dict of van der Waals radii for each atom type </span>
    224242<span class="sd">  \         Color            Colors for atoms (list of (r,b,g) triplets)</span>
    225243<span class="sd">  \         AtomTypes        List of atom types</span>
     
    229247<span class="sd">  \         Pawley dmin      maximum Q (as d-space) to use for Pawley </span>
    230248<span class="sd">                             extraction (float)</span>
    231 <span class="sd">  \         BondRadii        Radius for each atom used to compute </span>
     249<span class="sd">  \         BondRadii        Default radius for each atom used to compute </span>
    232250<span class="sd">                             interatomic distances (list of floats)</span>
    233 <span class="sd">  \         AngleRadii       Radius for each atom used to compute </span>
     251<span class="sd">  \         AngleRadii       Default radius for each atom used to compute </span>
    234252<span class="sd">                             interatomic angles (list of floats)</span>
     253<span class="sd">  \         DisAglCtls       Dict with distance/angle search controls,</span>
     254<span class="sd">                             which has keys &#39;Name&#39;, &#39;AtomTypes&#39;,</span>
     255<span class="sd">                             &#39;BondRadii&#39;, &#39;AngleRadii&#39; which are as above</span>
     256<span class="sd">                             except are possibly edited. Also contains</span>
     257<span class="sd">                             &#39;Factors&#39;, which is a 2 element list with</span>
     258<span class="sd">                             a multiplier for bond and angle search range</span>
     259<span class="sd">                             [typically (0.85,0.85)].</span>
    235260<span class="sd">ranId           \            unique random number Id for phase (int)</span>
    236261<span class="sd">pId             \            Phase Id number for current project (int).</span>
     
    243268<span class="sd">\           ballScale        Size of spheres in ball-and-stick display (float)</span>
    244269<span class="sd">\           bondList         dict with bonds</span>
    245 <span class="sd">\           contourLevel     ? (float)</span>
     270<span class="sd">\           contourLevel     map contour level in e/A^3 (float)</span>
    246271<span class="sd">\           showABC          Flag to show view point triplet (bool). True=show.</span>
    247272<span class="sd">\           viewDir          cartesian viewing direction (np.array with three</span>
     
    255280<span class="sd">\           sizeH            Size ratio for H atoms (float) </span>
    256281<span class="sd">\           bondRadius       Size of binds in A (float)</span>
    257 <span class="sd">\           atomPtrs         ? (list)</span>
     282<span class="sd">\           atomPtrs         positions of x, type, site sym, ADP flag in Draw Atoms (list)</span>
    258283<span class="sd">\           viewPoint        list of lists. First item in list is [x,y,z]</span>
    259284<span class="sd">                             in fractional coordinates for the center of</span>
    260 <span class="sd">                             the plot. Second item ?.</span>
     285<span class="sd">                             the plot. Second item list of previous &amp; current </span>
     286<span class="sd">                             atom number viewed (may be [0,0])</span>
    261287<span class="sd">\           showHydrogen     Flag to control plotting of H atoms.</span>
    262288<span class="sd">\           unitCellBox      Flag to control display of the unit cell.</span>
     
    272298<span class="sd">                             are located that are within r(Ra+Rb) and (Ra+Rb)/r</span>
    273299<span class="sd">                             where Ra and Rb are the atomic radii.</span>
    274 <span class="sd">\           oldxy            ? (list with two floats)</span>
     300<span class="sd">\           oldxy            previous view point (list with two floats)</span>
    275301<span class="sd">\           cameraPos        Viewing position in A for plot (float)</span>
    276 <span class="sd">\           depthFog         ? (bool)</span>
     302<span class="sd">\           depthFog         True if use depthFog on plot - set currently as False (bool)</span>
    277303<span class="sd">RBModels        \            Rigid body assignments (note Rigid body definitions</span>
    278304<span class="sd">                             are stored in their own main top-level tree entry.)</span>
     
    283309<span class="sd">                             parameters for items such as scale factors,</span>
    284310<span class="sd">                             size and strain parameters. (dict)</span>
    285 <span class="sd">MCSA            \            Monte-Carlo simulated annealing parameters</span>
     311<span class="sd">MCSA            \            Monte-Carlo simulated annealing parameters (dict)</span>
     312<span class="sd">\           </span>
    286313<span class="sd">==========  ===============  ====================================================</span>
    287314
    288 <span class="sd">Space Group Objects</span>
     315<span class="sd">Rigid Body Objects</span>
     316<span class="sd">------------------</span>
     317
     318<span class="sd">.. _RBData_table:</span>
     319
     320<span class="sd">.. index::</span>
     321<span class="sd">   single: Rigid Body Data description</span>
     322<span class="sd">   single: Data object descriptions; Rigid Body Data</span>
     323<span class="sd">   </span>
     324<span class="sd">Rigid body descriptions are available for two types of rigid bodies: &#39;Vector&#39; </span>
     325<span class="sd">and &#39;Residue&#39;. Vector rigid bodies are developed by a sequence of translations each</span>
     326<span class="sd">with a refinable magnitude and Residue rigid bodies are described as Cartesian coordinates</span>
     327<span class="sd">with defined refinable torsion angles.</span>
     328
     329<span class="sd">.. tabularcolumns:: |l|l|p{4in}|</span>
     330
     331<span class="sd">==========  ===============  ====================================================</span>
     332<span class="sd">  key         sub-key        explanation</span>
     333<span class="sd">==========  ===============  ====================================================</span>
     334<span class="sd">Vector      RBId             vector rigid bodies (dict of dict)</span>
     335<span class="sd">\           AtInfo           Drad, Color: atom drawing radius &amp; color for each atom type (dict)</span>
     336<span class="sd">\           RBname           Name assigned by user to rigid body (str)</span>
     337<span class="sd">\           VectMag          vector magnitudes in A (list)</span>
     338<span class="sd">\           rbXYZ            Cartesian coordinates for Vector rigid body (list of 3 float)</span>
     339<span class="sd">\           rbRef            3 assigned reference atom nos. in rigid body for origin </span>
     340<span class="sd">                             definition, use center of atoms flag (list of 3 int &amp; 1 bool)</span>
     341<span class="sd">\           VectRef          refinement flags for VectMag values (list of bool)</span>
     342<span class="sd">\           rbTypes          Atom types for each atom in rigid body (list of str)</span>
     343<span class="sd">\           rbVect           Cartesian vectors for each translation used to build rigid body (list of lists)</span>
     344<span class="sd">\           useCount         Number of times rigid body is used in any structure (int)</span>
     345<span class="sd">Residue     RBId             residue rigid bodies (dict of dict)</span>
     346<span class="sd">\           AtInfo           Drad, Color: atom drawing radius &amp; color for each atom type(dict)</span>
     347<span class="sd">\           RBname           Name assigned by user to rigid body (str)</span>
     348<span class="sd">\           rbXYZ            Cartesian coordinates for Residue rigid body (list of 3 float)</span>
     349<span class="sd">\           rbTypes          Atom types for each atom in rigid body (list of str)</span>
     350<span class="sd">\           atNames          Names of each atom in rigid body (e.g. C1,N2...) (list of str)</span>
     351<span class="sd">\           rbRef            3 assigned reference atom nos. in rigid body for origin </span>
     352<span class="sd">                             definition, use center of atoms flag (list of 3 int &amp; 1 bool)</span>
     353<span class="sd">\           rbSeq            Orig,Piv,angle,Riding (list): definition of internal rigid body</span>
     354<span class="sd">                             torsion; origin atom (int), pivot atom (int), torsion angle (float),</span>
     355<span class="sd">                             riding atoms (list of int)</span>
     356<span class="sd">\           SelSeq           [int,int] used by SeqSizer to identify objects</span>
     357<span class="sd">\           useCount         Number of times rigid body is used in any structure (int)</span>
     358<span class="sd">RBIds           \            unique Ids generated upon creation of each rigid body (dict)</span>
     359<span class="sd">\           Vector           Ids for each Vector rigid body (list)</span>
     360<span class="sd">\           Residue          Ids for each Residue rigid body (list)</span>
     361<span class="sd">==========  ===============  ====================================================</span>
     362
     363<span class="sd">Space Group Objects </span>
    289364<span class="sd">-------------------</span>
    290365
     
    292367
    293368<span class="sd">.. index::</span>
    294 <span class="sd">   single: SGData description</span>
    295 <span class="sd">   single: Data object descriptions; SGData</span>
     369<span class="sd">   single: Space Group Data description</span>
     370<span class="sd">   single: Data object descriptions; Space Group Data</span>
    296371
    297372<span class="sd">Space groups are interpreted by :func:`GSASIIspc.SpcGroup` </span>
    298 <span class="sd">and the information is placed in a SGdata object,</span>
     373<span class="sd">and the information is placed in a SGdata object </span>
    299374<span class="sd">which is a dict with these keys:</span>
    300375
     
    348423<span class="sd">atoms are contained in a list of atom records (list) in</span>
    349424<span class="sd">``phasedict[&#39;Atoms&#39;]``. Also needed to read atom information </span>
    350 <span class="sd">are four pointers, ``cx,ct,cs,cia = phasedict[&#39;General&#39;][&#39;AtomPtrs&#39;]``,</span>
    351 <span class="sd">which define locations in the atom record, as shown below. </span>
     425<span class="sd">are four pointers, ``cx,ct,cs,cia = phasedict[&#39;General&#39;][&#39;atomPtrs&#39;]``,</span>
     426<span class="sd">which define locations in the atom record, as shown below. Items shown are </span>
     427<span class="sd">always present; additional ones for macromolecular phases are marked &#39;mm&#39;</span>
    352428
    353429<span class="sd">.. tabularcolumns:: |l|p{4.5in}|</span>
     
    356432<span class="sd">location         explanation</span>
    357433<span class="sd">==============   ====================================================</span>
    358 <span class="sd">cx,cx+1,cx+2      the x,y and z coordinates</span>
    359 <span class="sd">cx+3              fractional occupancy (also cs-1)</span>
    360 <span class="sd">ct-1              atom label</span>
    361 <span class="sd">ct                atom type</span>
    362 <span class="sd">ct+1              refinement flags</span>
    363 <span class="sd">cs                site symmetry string</span>
    364 <span class="sd">cs+1              site multiplicity</span>
     434<span class="sd">ct-4              mm - residue number (str)</span>
     435<span class="sd">ct-3              mm - residue name (e.g. ALA) (str)</span>
     436<span class="sd">ct-2              mm - chain label (str)</span>
     437<span class="sd">ct-1              atom label (str)</span>
     438<span class="sd">ct                atom type (str)</span>
     439<span class="sd">ct+1              refinement flags; combination of &#39;F&#39;, &#39;X&#39;, &#39;U&#39; (str)</span>
     440<span class="sd">cx,cx+1,cx+2      the x,y and z coordinates (3 floats)</span>
     441<span class="sd">cs                site symmetry (str)</span>
     442<span class="sd">cs+1              site multiplicity (int)</span>
    365443<span class="sd">cia               ADP flag: Isotropic (&#39;I&#39;) or Anisotropic (&#39;A&#39;)</span>
    366 <span class="sd">cia+1             Uiso</span>
    367 <span class="sd">cia+2...cia+6     U11, U22, U33, U12, U13, U23</span>
     444<span class="sd">cia+1             Uiso (float)</span>
     445<span class="sd">cia+2...cia+6     U11, U22, U33, U12, U13, U23 (6 floats)</span>
     446<span class="sd">atom[-1]                unique atom identifier (int)</span>
     447<span class="sd">==============   ====================================================</span>
     448
     449<span class="sd">Drawing Atom Records</span>
     450<span class="sd">--------------------</span>
     451
     452<span class="sd">.. _Drawing_atoms_table:</span>
     453
     454<span class="sd">.. index::</span>
     455<span class="sd">   single: Drawing atoms record description</span>
     456<span class="sd">   single: Data object descriptions; Drawing atoms record</span>
     457
     458
     459<span class="sd">If ``phasedict`` points to the phase information in the data tree, then</span>
     460<span class="sd">drawing atoms are contained in a list of drawing atom records (list) in</span>
     461<span class="sd">``phasedict[&#39;Drawing&#39;][&#39;Atoms&#39;]``. Also needed to read atom information </span>
     462<span class="sd">are four pointers, ``cx,ct,cs,ci = phasedict[&#39;Drawing&#39;][&#39;AtomPtrs&#39;]``,</span>
     463<span class="sd">which define locations in the atom record, as shown below. Items shown are </span>
     464<span class="sd">always present; additional ones for macromolecular phases are marked &#39;mm&#39;</span>
     465
     466<span class="sd">.. tabularcolumns:: |l|p{4.5in}|</span>
     467
     468<span class="sd">==============   ====================================================</span>
     469<span class="sd">location         explanation</span>
     470<span class="sd">==============   ====================================================</span>
     471<span class="sd">ct-4              mm - residue number (str)</span>
     472<span class="sd">ct-3              mm - residue name (e.g. ALA) (str)</span>
     473<span class="sd">ct-2              mm - chain label (str)</span>
     474<span class="sd">ct-1              atom label (str)</span>
     475<span class="sd">ct                atom type (str)</span>
     476<span class="sd">cx,cx+1,cx+2      the x,y and z coordinates (3 floats)</span>
     477<span class="sd">cs-1              Sym Op symbol; sym. op number + unit cell id (e.g. &#39;1,0,-1&#39;) (str)</span>
     478<span class="sd">cs                atom drawing style; e.g. &#39;balls &amp; sticks&#39; (str)</span>
     479<span class="sd">cs+1              atom label style (e.g. &#39;name&#39;) (str)</span>
     480<span class="sd">cs+2              atom color (RBG triplet) (int)</span>
     481<span class="sd">cs+3              ADP flag: Isotropic (&#39;I&#39;) or Anisotropic (&#39;A&#39;)</span>
     482<span class="sd">cs+4              Uiso (float)</span>
     483<span class="sd">cs+5...cs+11      U11, U22, U33, U12, U13, U23 (6 floats)</span>
     484<span class="sd">ci                unique atom identifier; matches source atom Id in Atom Records (int)</span>
    368485<span class="sd">==============   ====================================================</span>
    369486
     
    381498<span class="sd">diffraction data for that information are directly associated with</span>
    382499<span class="sd">that tree item and there are a series of children to that item. The</span>
    383 <span class="sd">routine :func:`~GSASII.GSASII.GetUsedHistogramsAndPhasesfromTree` will</span>
     500<span class="sd">routines :func:`GSASII.GSASII.GetUsedHistogramsAndPhasesfromTree`</span>
     501<span class="sd">and :func:`GSASIIstrIO.GetUsedHistogramsAndPhases` will</span>
    384502<span class="sd">load this information into a dictionary where the child tree name is</span>
    385503<span class="sd">used as a key, and the information in the main entry is assigned</span>
     
    398516<span class="sd">Reflection Lists              \           A dict with an entry for each phase in the</span>
    399517<span class="sd">                                          histogram. The contents of each dict item</span>
    400 <span class="sd">                                          is a list of reflections as described in the</span>
    401 <span class="sd">                                          :ref:`Powder Reflections &lt;PowderRefl_table&gt;`</span>
     518<span class="sd">                                          is a dict containing reflections, as described in</span>
     519<span class="sd">                                          the :ref:`Powder Reflections &lt;PowderRefl_table&gt;`</span>
    402520<span class="sd">                                          description.</span>
    403521<span class="sd">Instrument Parameters         \           A list containing two dicts where the possible</span>
     
    502620<span class="sd">   single: Data object descriptions; Powder Reflections</span>
    503621<span class="sd">   </span>
    504 <span class="sd">For every phase in a histogram, the ``Reflection Lists`` value is a list of</span>
    505 <span class="sd">reflections. The items in that list are documented below.</span>
     622<span class="sd">For every phase in a histogram, the ``Reflection Lists`` value is a dict</span>
     623<span class="sd">one element of which is `&#39;RefList&#39;`, which is a np.array containing</span>
     624<span class="sd">reflections. The columns in that array are documented below.</span>
    506625
    507626<span class="sd">==========  ====================================================</span>
     
    517636<span class="sd"> 9           :math:`F_{calc}^2`</span>
    518637<span class="sd"> 10          reflection phase, in degrees</span>
    519 <span class="sd"> 11          the equivalent reflections as a (m x 3) </span>
    520 <span class="sd">             np.array, where m is 0.5 * multiplicity. Note</span>
    521 <span class="sd">             that Freidel pairs, (-h,-k-,l), are not</span>
    522 <span class="sd">             included. </span>
    523 <span class="sd"> 12          phase shift for each of the equivalent</span>
    524 <span class="sd">             reflections as a length (m) array</span>
    525 <span class="sd"> 13          intensity correction for reflection, this times</span>
     638<span class="sd"> 11          intensity correction for reflection, this times</span>
    526639<span class="sd">             :math:`F_{obs}^2` or :math:`F_{calc}^2` gives Iobs or Icalc </span>
    527 <span class="sd"> 14          dict with the form factor (f or b) by atom type</span>
    528 <span class="sd">             symbol at the reflection position.</span>
    529640<span class="sd">==========  ====================================================</span>
    530641
     
    535646
    536647<span class="sd">.. index::</span>
    537 <span class="sd">   single: Single Crytsal data object description</span>
     648<span class="sd">   single: Single Crystal data object description</span>
    538649<span class="sd">   single: Data object descriptions; Single crystal data</span>
    539650
     
    542653<span class="sd">diffraction data for that information are directly associated with</span>
    543654<span class="sd">that tree item and there are a series of children to that item. The</span>
    544 <span class="sd">routine :func:`~GSASII.GSASII.GetUsedHistogramsAndPhasesfromTree` will</span>
     655<span class="sd">routines :func:`GSASII.GSASII.GetUsedHistogramsAndPhasesfromTree`</span>
     656<span class="sd">and :func:`GSASIIstrIO.GetUsedHistogramsAndPhases` will</span>
    545657<span class="sd">load this information into a dictionary where the child tree name is</span>
    546658<span class="sd">used as a key, and the information in the main entry is assigned</span>
     
    552664<span class="sd">  key                      sub-key        explanation</span>
    553665<span class="sd">======================  ===============  ====================================================</span>
    554 <span class="sd">Data</span>
    555 <span class="sd">                                          A list of lists, where each inner item</span>
    556 <span class="sd">                                          is an individual reflection</span>
     666<span class="sd">Data                          \           A dict that contains the </span>
     667<span class="sd">                                          reflection table,</span>
    557668<span class="sd">                                          as described in the</span>
    558669<span class="sd">                                          :ref:`Single Crystal Reflections</span>
     
    583694<span class="sd">hId                           \           The number assigned to the histogram when</span>
    584695<span class="sd">                                          the project is loaded or edited (can change)</span>
     696<span class="sd">ranId                         \           A random number id for the histogram</span>
     697<span class="sd">                                          that does not change</span>
    585698<span class="sd">======================  ===============  ====================================================</span>
    586699
     
    594707<span class="sd">   single: Data object descriptions; Single Crystal Reflections</span>
    595708<span class="sd">   </span>
    596 <span class="sd">For every phase in a histogram, the ``Reflection Lists`` value is a list of</span>
    597 <span class="sd">reflections. The items in that list are documented below.</span>
     709<span class="sd">For every simgle crystal a histogram, the ``&#39;Data&#39;`` item contains</span>
     710<span class="sd">the structure factors as an np.array in item `&#39;RefList&#39;`.</span>
     711<span class="sd">The columns in that array are documented below.</span>
    598712
    599713<span class="sd">==========  ====================================================</span>
     
    609723<span class="sd"> 9           :math:`F_{calc}^2T`</span>
    610724<span class="sd"> 10          reflection phase, in degrees</span>
    611 <span class="sd"> 11          the equivalent reflections as a (m x 3) </span>
    612 <span class="sd">             np.array.</span>
    613 <span class="sd"> 12          phase shift for each of the equivalent</span>
    614 <span class="sd">             reflections as a length (m) array</span>
    615 <span class="sd"> 13          intensity correction for reflection, this times</span>
     725<span class="sd"> 11          intensity correction for reflection, this times</span>
    616726<span class="sd">             :math:`F_{obs}^2` or :math:`F_{calc}^2`</span>
    617727<span class="sd">             gives Iobs or Icalc</span>
    618 <span class="sd">             (not used in single crystals?)</span>
    619 <span class="sd"> 14          dict with the form factor (f or b) by atom type</span>
    620 <span class="sd">             symbol at the reflection position.</span>
    621728<span class="sd">==========  ====================================================</span>
    622729
     
    626733
    627734<span class="sd">&#39;&#39;&#39;</span>
     735<span class="kn">import</span> <span class="nn">random</span> <span class="kn">as</span> <span class="nn">ran</span>
     736<span class="kn">import</span> <span class="nn">sys</span>
    628737<span class="kn">import</span> <span class="nn">GSASIIpath</span>
    629 <span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1077 $&quot;</span><span class="p">)</span>
    630 
    631 <div class="viewcode-block" id="LoadHistogramIDs"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.LoadHistogramIDs">[docs]</a><span class="k">def</span> <span class="nf">LoadHistogramIDs</span><span class="p">(</span><span class="n">histList</span><span class="p">,</span><span class="n">idList</span><span class="p">):</span>
    632     <span class="sd">&#39;&#39;&#39;Save the Id values for a series of histograms&#39;&#39;&#39;</span>
    633     <span class="n">VarName</span><span class="o">.</span><span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;hists&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
    634     <span class="k">for</span> <span class="n">h</span><span class="p">,</span><span class="n">i</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">histList</span><span class="p">,</span><span class="n">idList</span><span class="p">):</span>
    635         <span class="n">VarName</span><span class="o">.</span><span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;hists&#39;</span><span class="p">][</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">h</span>
     738<span class="kn">import</span> <span class="nn">GSASIImath</span> <span class="kn">as</span> <span class="nn">G2mth</span>
     739
     740<span class="n">GSASIIpath</span><span class="o">.</span><span class="n">SetVersionNumber</span><span class="p">(</span><span class="s">&quot;$Revision: 1147 $&quot;</span><span class="p">)</span>
     741
     742<span class="n">DefaultControls</span> <span class="o">=</span> <span class="p">{</span>
     743    <span class="s">&#39;deriv type&#39;</span><span class="p">:</span><span class="s">&#39;analytic Hessian&#39;</span><span class="p">,</span>    <span class="c">#default controls</span>
     744    <span class="s">&#39;min dM/M&#39;</span><span class="p">:</span><span class="mf">0.0001</span><span class="p">,</span><span class="s">&#39;shift factor&#39;</span><span class="p">:</span><span class="mf">1.</span><span class="p">,</span><span class="s">&#39;max cyc&#39;</span><span class="p">:</span><span class="mi">3</span><span class="p">,</span><span class="s">&#39;F**2&#39;</span><span class="p">:</span><span class="bp">True</span><span class="p">,</span>
     745    <span class="s">&#39;minF/sig&#39;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span>
     746    <span class="s">&#39;Author&#39;</span><span class="p">:</span><span class="s">&#39;no name&#39;</span><span class="p">,</span>
     747    <span class="s">&#39;FreeVar1&#39;</span><span class="p">:</span><span class="s">&#39;Sample humidity (%)&#39;</span><span class="p">,</span>
     748    <span class="s">&#39;FreeVar2&#39;</span><span class="p">:</span><span class="s">&#39;Sample voltage (V)&#39;</span><span class="p">,</span>
     749    <span class="s">&#39;FreeVar3&#39;</span><span class="p">:</span><span class="s">&#39;Applied load (MN)&#39;</span><span class="p">,</span>
     750    <span class="p">}</span>
     751<span class="sd">&#39;&#39;&#39;Values to be used as defaults for the initial contents of the ``Controls``</span>
     752<span class="sd">data tree item.</span>
     753<span class="sd">&#39;&#39;&#39;</span>
     754
     755<div class="viewcode-block" id="MakeUniqueLabel"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.MakeUniqueLabel">[docs]</a><span class="k">def</span> <span class="nf">MakeUniqueLabel</span><span class="p">(</span><span class="n">lbl</span><span class="p">,</span><span class="n">labellist</span><span class="p">):</span>
     756    <span class="sd">&#39;&#39;&#39;Make sure that every a label is unique against a list by adding</span>
     757<span class="sd">    digits at the end until it is not found in list.</span>
     758
     759<span class="sd">    :param str lbl: the input label</span>
     760<span class="sd">    :param list labellist: the labels that have already been encountered</span>
     761<span class="sd">    :returns: lbl if not found in labellist or lbl with ``_1-9` (or</span>
     762<span class="sd">      ``_10-99``, etc.) appended at the end</span>
     763<span class="sd">    &#39;&#39;&#39;</span>
     764    <span class="n">lbl</span> <span class="o">=</span> <span class="n">lbl</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
     765    <span class="k">if</span> <span class="ow">not</span> <span class="n">lbl</span><span class="p">:</span> <span class="c"># deal with a blank label</span>
     766        <span class="n">lbl</span> <span class="o">=</span> <span class="s">&#39;_1&#39;</span>
     767    <span class="k">if</span> <span class="n">lbl</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">labellist</span><span class="p">:</span>
     768        <span class="n">labellist</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">lbl</span><span class="p">)</span>
     769        <span class="k">return</span> <span class="n">lbl</span>
     770    <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span>
     771    <span class="n">prefix</span> <span class="o">=</span> <span class="n">lbl</span>
     772    <span class="k">if</span> <span class="s">&#39;_&#39;</span> <span class="ow">in</span> <span class="n">lbl</span><span class="p">:</span>
     773        <span class="n">prefix</span> <span class="o">=</span> <span class="n">lbl</span><span class="p">[:</span><span class="n">lbl</span><span class="o">.</span><span class="n">rfind</span><span class="p">(</span><span class="s">&#39;_&#39;</span><span class="p">)]</span>
     774        <span class="n">suffix</span> <span class="o">=</span> <span class="n">lbl</span><span class="p">[</span><span class="n">lbl</span><span class="o">.</span><span class="n">rfind</span><span class="p">(</span><span class="s">&#39;_&#39;</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span><span class="p">:]</span>
     775        <span class="k">try</span><span class="p">:</span>
     776            <span class="n">i</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">suffix</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span>
     777        <span class="k">except</span><span class="p">:</span> <span class="c"># suffix could not be parsed</span>
     778            <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span>
     779            <span class="n">prefix</span> <span class="o">=</span> <span class="n">lbl</span>
     780    <span class="k">while</span> <span class="n">prefix</span><span class="o">+</span><span class="s">&#39;_&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="ow">in</span> <span class="n">labellist</span><span class="p">:</span>
     781        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
     782    <span class="k">else</span><span class="p">:</span>
     783        <span class="n">lbl</span> <span class="o">=</span> <span class="n">prefix</span><span class="o">+</span><span class="s">&#39;_&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
     784        <span class="n">labellist</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">lbl</span><span class="p">)</span>
     785    <span class="k">return</span> <span class="n">lbl</span>
    636786</div>
    637 <span class="k">def</span> <span class="nf">LoadPhaseIDs</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    638     <span class="k">pass</span>
    639 
    640 <div class="viewcode-block" id="VarName"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.VarName">[docs]</a><span class="k">class</span> <span class="nc">VarName</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
    641     <span class="sd">&#39;&#39;&#39;Defines a GSAS-II variable either using the phase/atom/histogram</span>
    642 <span class="sd">    unique Id numbers or using a character string that specifies</span>
    643 <span class="sd">    variables by phase/atom/histogram number (which can change).</span>
    644 <span class="sd">    Note that :func:`LoadID` should be used to (re)load the current Ids</span>
    645 <span class="sd">    before creating or later using the VarName object.</span>
    646 
    647 <span class="sd">    A :class:`VarName` object can be created with a single parameter:</span>
    648 <span class="sd">    </span>
    649 <span class="sd">    :param str varname: a single value can be used to create a :class:`VarName`</span>
    650 <span class="sd">      object. The string must be of form &quot;p:h:var&quot; or &quot;p:h:var:a&quot;, where</span>
    651 
    652 <span class="sd">     * p is the phase number (which may be left blank); </span>
    653 <span class="sd">     * h is the histogram number (which may be left blank); </span>
    654 <span class="sd">     * a is the atom number (which may be left blank in which case the third colon is omitted).</span>
    655 
    656 <span class="sd">    Alternately, a :class:`VarName` object can be created with exactly four positional parameters:</span>
    657 
    658 <span class="sd">    :param int phasenum: The number for the phase</span>
    659 <span class="sd">    :param int histnum: The number for the histogram</span>
    660 <span class="sd">    :param str varname: a single value can be used to create a :class:`VarName`</span>
    661 <span class="sd">    :param int atomnum: The number for the atom</span>
     787<span class="n">PhaseIdLookup</span> <span class="o">=</span> <span class="p">{}</span>
     788<span class="sd">&#39;&#39;&#39;dict listing phase name and random Id keyed by sequential phase index as a str;</span>
     789<span class="sd">best to access this using :func:`LookupPhaseName`</span>
     790<span class="sd">&#39;&#39;&#39;</span>
     791<span class="n">PhaseRanIdLookup</span> <span class="o">=</span> <span class="p">{}</span>
     792<span class="sd">&#39;&#39;&#39;dict listing phase sequential index keyed by phase random Id;</span>
     793<span class="sd">best to access this using :func:`LookupPhaseId`</span>
     794<span class="sd">&#39;&#39;&#39;</span>
     795<span class="n">HistIdLookup</span> <span class="o">=</span> <span class="p">{}</span>
     796<span class="sd">&#39;&#39;&#39;dict listing histogram name and random Id, keyed by sequential histogram index as a str;</span>
     797<span class="sd">best to access this using :func:`LookupHistName`</span>
     798<span class="sd">&#39;&#39;&#39;</span>
     799<span class="n">HistRanIdLookup</span> <span class="o">=</span> <span class="p">{}</span>
     800<span class="sd">&#39;&#39;&#39;dict listing histogram sequential index keyed by histogram random Id;</span>
     801<span class="sd">best to access this using :func:`LookupHistId`</span>
     802<span class="sd">&#39;&#39;&#39;</span>
     803<span class="n">AtomIdLookup</span> <span class="o">=</span> <span class="p">{}</span>
     804<span class="sd">&#39;&#39;&#39;dict listing for each phase index as a str, the atom label and atom random Id,</span>
     805<span class="sd">keyed by atom sequential index as a str;</span>
     806<span class="sd">best to access this using :func:`LookupAtomLabel`</span>
     807<span class="sd">&#39;&#39;&#39;</span>
     808<span class="n">AtomRanIdLookup</span> <span class="o">=</span> <span class="p">{}</span>
     809<span class="sd">&#39;&#39;&#39;dict listing for each phase the atom sequential index keyed by atom random Id;</span>
     810<span class="sd">best to access this using :func:`LookupAtomId`</span>
     811<span class="sd">&#39;&#39;&#39;</span>
     812<span class="n">ShortPhaseNames</span> <span class="o">=</span> <span class="p">{}</span>
     813<span class="sd">&#39;&#39;&#39;a dict containing a possibly shortened and when non-unique numbered</span>
     814<span class="sd">version of the phase name. Keyed by the phase sequential index.</span>
     815<span class="sd">&#39;&#39;&#39;</span>
     816<span class="n">ShortHistNames</span> <span class="o">=</span> <span class="p">{}</span>
     817<span class="sd">&#39;&#39;&#39;a dict containing a possibly shortened and when non-unique numbered</span>
     818<span class="sd">version of the histogram name. Keyed by the histogram sequential index.</span>
     819<span class="sd">&#39;&#39;&#39;</span>
     820
     821<span class="n">VarDesc</span> <span class="o">=</span> <span class="p">{}</span>
     822<span class="sd">&#39;&#39;&#39; This dictionary lists descriptions for GSAS-II variables,</span>
     823<span class="sd">as set in :func:`CompileVarDesc`. See that function for a description</span>
     824<span class="sd">for how keys and values are written.</span>
     825<span class="sd">&#39;&#39;&#39;</span>
     826
     827<span class="n">reVarDesc</span> <span class="o">=</span> <span class="p">{}</span>
     828<span class="sd">&#39;&#39;&#39; This dictionary lists descriptions for GSAS-II variables with</span>
     829<span class="sd">the same values as :attr:`VarDesc` except that keys have been compiled as</span>
     830<span class="sd">regular expressions. Initialized in :func:`CompileVarDesc`.</span>
     831<span class="sd">&#39;&#39;&#39;</span>
     832
     833<div class="viewcode-block" id="IndexAllIds"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.IndexAllIds">[docs]</a><span class="k">def</span> <span class="nf">IndexAllIds</span><span class="p">(</span><span class="n">Histograms</span><span class="p">,</span><span class="n">Phases</span><span class="p">):</span>
     834    <span class="sd">&#39;&#39;&#39;Scan through the used phases &amp; histograms and create an index</span>
     835<span class="sd">    to the random numbers of phases, histograms and atoms. While doing this,</span>
     836<span class="sd">    confirm that assigned random numbers are unique -- just in case lightning</span>
     837<span class="sd">    strikes twice in the same place.</span>
     838
     839<span class="sd">    Note: this code assumes that the atom random Id (ranId) is the last </span>
     840<span class="sd">    element each atom record.</span>
     841
     842<span class="sd">    This is called in two places (only) :func:`GSASIIstrIO.GetUsedHistogramsAndPhases`</span>
     843<span class="sd">    (which loads the histograms and phases from a GPX file) and</span>
     844<span class="sd">    :meth:`GSASII.GSASII.GetUsedHistogramsAndPhases`</span>
     845<span class="sd">    (which loads the histograms and phases from the data tree.)</span>
     846
     847<span class="sd">    TODO: do we need a lookup for rigid body variables?</span>
     848<span class="sd">    &#39;&#39;&#39;</span>
     849    <span class="c"># process phases and atoms</span>
     850    <span class="n">PhaseIdLookup</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
     851    <span class="n">PhaseRanIdLookup</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>   
     852    <span class="n">AtomIdLookup</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
     853    <span class="n">AtomRanIdLookup</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
     854    <span class="n">ShortPhaseNames</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
     855    <span class="k">for</span> <span class="n">ph</span> <span class="ow">in</span> <span class="n">Phases</span><span class="p">:</span>
     856        <span class="n">cx</span><span class="p">,</span><span class="n">ct</span><span class="p">,</span><span class="n">cs</span><span class="p">,</span><span class="n">cia</span> <span class="o">=</span> <span class="n">Phases</span><span class="p">[</span><span class="n">ph</span><span class="p">][</span><span class="s">&#39;General&#39;</span><span class="p">][</span><span class="s">&#39;AtomPtrs&#39;</span><span class="p">]</span>
     857        <span class="n">ranId</span> <span class="o">=</span> <span class="n">Phases</span><span class="p">[</span><span class="n">ph</span><span class="p">][</span><span class="s">&#39;ranId&#39;</span><span class="p">]</span>
     858        <span class="k">while</span> <span class="n">ranId</span> <span class="ow">in</span> <span class="n">PhaseRanIdLookup</span><span class="p">:</span>
     859            <span class="c"># Found duplicate random Id! note and reassign</span>
     860            <span class="k">print</span> <span class="p">(</span><span class="s">&quot;</span><span class="se">\n\n</span><span class="s">*** Phase &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">ph</span><span class="p">)</span><span class="o">+</span><span class="s">&quot; has repeated ranId. Fixing.</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
     861            <span class="n">Phases</span><span class="p">[</span><span class="n">ph</span><span class="p">][</span><span class="s">&#39;ranId&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">ranId</span> <span class="o">=</span> <span class="n">ran</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">sys</span><span class="o">.</span><span class="n">maxint</span><span class="p">)</span>
     862        <span class="n">pId</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">Phases</span><span class="p">[</span><span class="n">ph</span><span class="p">][</span><span class="s">&#39;pId&#39;</span><span class="p">])</span>
     863        <span class="n">PhaseIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">ph</span><span class="p">,</span><span class="n">ranId</span><span class="p">)</span>
     864        <span class="n">PhaseRanIdLookup</span><span class="p">[</span><span class="n">ranId</span><span class="p">]</span> <span class="o">=</span> <span class="n">pId</span>
     865        <span class="n">shortname</span> <span class="o">=</span> <span class="n">ph</span><span class="p">[:</span><span class="mi">10</span><span class="p">]</span>
     866        <span class="k">while</span> <span class="n">shortname</span> <span class="ow">in</span> <span class="n">ShortPhaseNames</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
     867            <span class="n">shortname</span> <span class="o">=</span> <span class="n">ph</span><span class="p">[:</span><span class="mi">8</span><span class="p">]</span> <span class="o">+</span> <span class="s">&#39; (&#39;</span><span class="o">+</span> <span class="n">pId</span> <span class="o">+</span> <span class="s">&#39;)&#39;</span>
     868        <span class="n">ShortPhaseNames</span><span class="p">[</span><span class="n">pId</span><span class="p">]</span> <span class="o">=</span> <span class="n">shortname</span>
     869        <span class="n">AtomIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
     870        <span class="n">AtomRanIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
     871        <span class="k">for</span> <span class="n">iatm</span><span class="p">,</span><span class="n">at</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">Phases</span><span class="p">[</span><span class="n">ph</span><span class="p">][</span><span class="s">&#39;Atoms&#39;</span><span class="p">]):</span>
     872            <span class="n">ranId</span> <span class="o">=</span> <span class="n">at</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
     873            <span class="k">while</span> <span class="n">ranId</span> <span class="ow">in</span> <span class="n">AtomRanIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">]:</span> <span class="c"># check for dups</span>
     874                <span class="k">print</span> <span class="p">(</span><span class="s">&quot;</span><span class="se">\n\n</span><span class="s">*** Phase &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">ph</span><span class="p">)</span><span class="o">+</span><span class="s">&quot; atom &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">iatm</span><span class="p">)</span><span class="o">+</span><span class="s">&quot; has repeated ranId. Fixing.</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
     875                <span class="n">at</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">ranId</span> <span class="o">=</span> <span class="n">ran</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">sys</span><span class="o">.</span><span class="n">maxint</span><span class="p">)</span>
     876            <span class="n">AtomRanIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">][</span><span class="n">ranId</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">iatm</span><span class="p">)</span>
     877            <span class="k">if</span> <span class="n">Phases</span><span class="p">[</span><span class="n">ph</span><span class="p">][</span><span class="s">&#39;General&#39;</span><span class="p">][</span><span class="s">&#39;Type&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;macromolecular&#39;</span><span class="p">:</span>
     878                <span class="n">label</span> <span class="o">=</span> <span class="s">&#39;</span><span class="si">%s</span><span class="s">_</span><span class="si">%s</span><span class="s">_</span><span class="si">%s</span><span class="s">_</span><span class="si">%s</span><span class="s">&#39;</span><span class="o">%</span><span class="p">(</span><span class="n">at</span><span class="p">[</span><span class="n">ct</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span><span class="n">at</span><span class="p">[</span><span class="n">ct</span><span class="o">-</span><span class="mi">3</span><span class="p">],</span><span class="n">at</span><span class="p">[</span><span class="n">ct</span><span class="o">-</span><span class="mi">4</span><span class="p">],</span><span class="n">at</span><span class="p">[</span><span class="n">ct</span><span class="o">-</span><span class="mi">2</span><span class="p">])</span>
     879            <span class="k">else</span><span class="p">:</span>
     880                <span class="n">label</span> <span class="o">=</span> <span class="n">at</span><span class="p">[</span><span class="n">ct</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
     881            <span class="n">AtomIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">][</span><span class="nb">str</span><span class="p">(</span><span class="n">iatm</span><span class="p">)]</span> <span class="o">=</span> <span class="p">(</span><span class="n">label</span><span class="p">,</span><span class="n">ranId</span><span class="p">)</span>
     882    <span class="c"># process histograms</span>
     883    <span class="n">HistIdLookup</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
     884    <span class="n">HistRanIdLookup</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
     885    <span class="n">ShortHistNames</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
     886    <span class="k">for</span> <span class="n">hist</span> <span class="ow">in</span> <span class="n">Histograms</span><span class="p">:</span>
     887        <span class="n">ranId</span> <span class="o">=</span> <span class="n">Histograms</span><span class="p">[</span><span class="n">hist</span><span class="p">][</span><span class="s">&#39;ranId&#39;</span><span class="p">]</span>
     888        <span class="k">while</span> <span class="n">ranId</span> <span class="ow">in</span> <span class="n">HistRanIdLookup</span><span class="p">:</span>
     889            <span class="c"># Found duplicate random Id! note and reassign</span>
     890            <span class="k">print</span> <span class="p">(</span><span class="s">&quot;</span><span class="se">\n\n</span><span class="s">*** Histogram &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">hist</span><span class="p">)</span><span class="o">+</span><span class="s">&quot; has repeated ranId. Fixing.</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">)</span>
     891            <span class="n">Histograms</span><span class="p">[</span><span class="n">hist</span><span class="p">][</span><span class="s">&#39;ranId&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">ranId</span> <span class="o">=</span> <span class="n">ran</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">sys</span><span class="o">.</span><span class="n">maxint</span><span class="p">)</span>
     892        <span class="n">hId</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">Histograms</span><span class="p">[</span><span class="n">hist</span><span class="p">][</span><span class="s">&#39;hId&#39;</span><span class="p">])</span>
     893        <span class="n">HistIdLookup</span><span class="p">[</span><span class="n">hId</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">hist</span><span class="p">,</span><span class="n">ranId</span><span class="p">)</span>
     894        <span class="n">HistRanIdLookup</span><span class="p">[</span><span class="n">ranId</span><span class="p">]</span> <span class="o">=</span> <span class="n">hId</span>
     895        <span class="n">shortname</span> <span class="o">=</span> <span class="n">hist</span><span class="p">[:</span><span class="mi">15</span><span class="p">]</span>
     896        <span class="k">while</span> <span class="n">shortname</span> <span class="ow">in</span> <span class="n">ShortHistNames</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
     897            <span class="n">shortname</span> <span class="o">=</span> <span class="n">hist</span><span class="p">[:</span><span class="mi">11</span><span class="p">]</span> <span class="o">+</span> <span class="s">&#39; (&#39;</span><span class="o">+</span> <span class="n">hId</span> <span class="o">+</span> <span class="s">&#39;)&#39;</span>
     898        <span class="n">ShortHistNames</span><span class="p">[</span><span class="n">hId</span><span class="p">]</span> <span class="o">=</span> <span class="n">shortname</span>
     899</div>
     900<div class="viewcode-block" id="LookupAtomId"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.LookupAtomId">[docs]</a><span class="k">def</span> <span class="nf">LookupAtomId</span><span class="p">(</span><span class="n">pId</span><span class="p">,</span><span class="n">ranId</span><span class="p">):</span>
     901    <span class="sd">&#39;&#39;&#39;Get the atom number from a phase and atom random Id</span>
     902
     903<span class="sd">    :param int/str pId: the sequential number of the phase</span>
     904<span class="sd">    :param int ranId: the random Id assigned to an atom</span>
     905
     906<span class="sd">    :returns: the index number of the atom (str)</span>
     907<span class="sd">    &#39;&#39;&#39;</span>
     908    <span class="k">if</span> <span class="ow">not</span> <span class="n">AtomRanIdLookup</span><span class="p">:</span>
     909        <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span><span class="s">&#39;Error: LookupAtomId called before IndexAllIds was run&#39;</span>
     910    <span class="k">if</span> <span class="n">pId</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">pId</span> <span class="o">==</span> <span class="s">&#39;&#39;</span><span class="p">:</span>
     911        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: phase is invalid (None or blank)&#39;</span>
     912    <span class="n">pId</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">pId</span><span class="p">)</span>
     913    <span class="k">if</span> <span class="n">pId</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">AtomRanIdLookup</span><span class="p">:</span>
     914        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupAtomId does not have phase &#39;</span><span class="o">+</span><span class="n">pId</span>
     915    <span class="k">if</span> <span class="n">ranId</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">AtomRanIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">]:</span>
     916        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupAtomId, ranId &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">ranId</span><span class="p">)</span><span class="o">+</span><span class="s">&#39; not in AtomRanIdLookup[&#39;</span><span class="o">+</span><span class="n">pId</span><span class="o">+</span><span class="s">&#39;]&#39;</span>
     917    <span class="k">return</span> <span class="n">AtomRanIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">][</span><span class="n">ranId</span><span class="p">]</span>
     918</div>
     919<div class="viewcode-block" id="LookupAtomLabel"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.LookupAtomLabel">[docs]</a><span class="k">def</span> <span class="nf">LookupAtomLabel</span><span class="p">(</span><span class="n">pId</span><span class="p">,</span><span class="n">index</span><span class="p">):</span>
     920    <span class="sd">&#39;&#39;&#39;Get the atom label from a phase and atom index number</span>
     921
     922<span class="sd">    :param int/str pId: the sequential number of the phase</span>
     923<span class="sd">    :param int index: the index of the atom in the list of atoms</span>
     924
     925<span class="sd">    :returns: the label for the atom (str) and the random Id of the atom (int)</span>
     926<span class="sd">    &#39;&#39;&#39;</span>
     927    <span class="k">if</span> <span class="ow">not</span> <span class="n">AtomIdLookup</span><span class="p">:</span>
     928        <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span><span class="s">&#39;Error: LookupAtomLabel called before IndexAllIds was run&#39;</span>
     929    <span class="k">if</span> <span class="n">pId</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">pId</span> <span class="o">==</span> <span class="s">&#39;&#39;</span><span class="p">:</span>
     930        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: phase is invalid (None or blank)&#39;</span>
     931    <span class="n">pId</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">pId</span><span class="p">)</span>
     932    <span class="k">if</span> <span class="n">pId</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">AtomIdLookup</span><span class="p">:</span>
     933        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupAtomLabel does not have phase &#39;</span><span class="o">+</span><span class="n">pId</span>
     934    <span class="k">if</span> <span class="n">index</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">AtomIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">]:</span>
     935        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupAtomLabel, ranId &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">index</span><span class="p">)</span><span class="o">+</span><span class="s">&#39; not in AtomRanIdLookup[&#39;</span><span class="o">+</span><span class="n">pId</span><span class="o">+</span><span class="s">&#39;]&#39;</span>
     936    <span class="k">return</span> <span class="n">AtomIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">][</span><span class="n">index</span><span class="p">]</span>
     937</div>
     938<div class="viewcode-block" id="LookupPhaseId"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.LookupPhaseId">[docs]</a><span class="k">def</span> <span class="nf">LookupPhaseId</span><span class="p">(</span><span class="n">ranId</span><span class="p">):</span>
     939    <span class="sd">&#39;&#39;&#39;Get the phase number and name from a phase random Id</span>
     940
     941<span class="sd">    :param int ranId: the random Id assigned to a phase</span>
     942<span class="sd">    :returns: the sequential Id (pId) number for the phase (str)</span>
     943<span class="sd">    &#39;&#39;&#39;</span>
     944    <span class="k">if</span> <span class="ow">not</span> <span class="n">PhaseRanIdLookup</span><span class="p">:</span>
     945        <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span><span class="s">&#39;Error: LookupPhaseId called before IndexAllIds was run&#39;</span>
     946    <span class="k">if</span> <span class="n">ranId</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">PhaseRanIdLookup</span><span class="p">:</span>
     947        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupPhaseId does not have ranId &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">ranId</span><span class="p">)</span>
     948    <span class="k">return</span> <span class="n">PhaseRanIdLookup</span><span class="p">[</span><span class="n">ranId</span><span class="p">]</span>
     949</div>
     950<div class="viewcode-block" id="LookupPhaseName"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.LookupPhaseName">[docs]</a><span class="k">def</span> <span class="nf">LookupPhaseName</span><span class="p">(</span><span class="n">pId</span><span class="p">):</span>
     951    <span class="sd">&#39;&#39;&#39;Get the phase number and name from a phase Id</span>
     952
     953<span class="sd">    :param int/str pId: the sequential assigned to a phase</span>
     954<span class="sd">    :returns:  (phase,ranId) where phase is the name of the phase (str)</span>
     955<span class="sd">      and ranId is the random # id for the phase (int)</span>
     956<span class="sd">    &#39;&#39;&#39;</span>
     957    <span class="k">if</span> <span class="ow">not</span> <span class="n">PhaseIdLookup</span><span class="p">:</span>
     958        <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span><span class="s">&#39;Error: LookupPhaseName called before IndexAllIds was run&#39;</span>
     959    <span class="k">if</span> <span class="n">pId</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">pId</span> <span class="o">==</span> <span class="s">&#39;&#39;</span><span class="p">:</span>
     960        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: phase is invalid (None or blank)&#39;</span>
     961    <span class="n">pId</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">pId</span><span class="p">)</span>
     962    <span class="k">if</span> <span class="n">pId</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">PhaseIdLookup</span><span class="p">:</span>
     963        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupPhaseName does not have index &#39;</span><span class="o">+</span><span class="n">pId</span>
     964    <span class="k">return</span> <span class="n">PhaseIdLookup</span><span class="p">[</span><span class="n">pId</span><span class="p">]</span>
     965</div>
     966<div class="viewcode-block" id="LookupHistId"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.LookupHistId">[docs]</a><span class="k">def</span> <span class="nf">LookupHistId</span><span class="p">(</span><span class="n">ranId</span><span class="p">):</span>
     967    <span class="sd">&#39;&#39;&#39;Get the histogram number and name from a histogram random Id</span>
     968
     969<span class="sd">    :param int ranId: the random Id assigned to a histogram</span>
     970<span class="sd">    :returns: the sequential Id (hId) number for the histogram (str)</span>
     971<span class="sd">    &#39;&#39;&#39;</span>
     972    <span class="k">if</span> <span class="ow">not</span> <span class="n">HistRanIdLookup</span><span class="p">:</span>
     973        <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span><span class="s">&#39;Error: LookupHistId called before IndexAllIds was run&#39;</span>
     974    <span class="k">if</span> <span class="n">ranId</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">HistRanIdLookup</span><span class="p">:</span>
     975        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupHistId does not have ranId &#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">ranId</span><span class="p">)</span>
     976    <span class="k">return</span> <span class="n">HistRanIdLookup</span><span class="p">[</span><span class="n">ranId</span><span class="p">]</span>
     977</div>
     978<div class="viewcode-block" id="LookupHistName"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.LookupHistName">[docs]</a><span class="k">def</span> <span class="nf">LookupHistName</span><span class="p">(</span><span class="n">hId</span><span class="p">):</span>
     979    <span class="sd">&#39;&#39;&#39;Get the histogram number and name from a histogram Id</span>
     980
     981<span class="sd">    :param int/str hId: the sequential assigned to a histogram</span>
     982<span class="sd">    :returns:  (hist,ranId) where hist is the name of the histogram (str)</span>
     983<span class="sd">      and ranId is the random # id for the histogram (int)</span>
     984<span class="sd">    &#39;&#39;&#39;</span>
     985    <span class="k">if</span> <span class="ow">not</span> <span class="n">HistIdLookup</span><span class="p">:</span>
     986        <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span><span class="s">&#39;Error: LookupHistName called before IndexAllIds was run&#39;</span>
     987    <span class="k">if</span> <span class="n">hId</span> <span class="ow">is</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">hId</span> <span class="o">==</span> <span class="s">&#39;&#39;</span><span class="p">:</span>
     988        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: histogram is invalid (None or blank)&#39;</span>
     989    <span class="n">hId</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">hId</span><span class="p">)</span>
     990    <span class="k">if</span> <span class="n">hId</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">HistIdLookup</span><span class="p">:</span>
     991        <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span><span class="s">&#39;Error: LookupHistName does not have index &#39;</span><span class="o">+</span><span class="n">hId</span>
     992    <span class="k">return</span> <span class="n">HistIdLookup</span><span class="p">[</span><span class="n">hId</span><span class="p">]</span>
     993</div>
     994<div class="viewcode-block" id="fmtVarDescr"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.fmtVarDescr">[docs]</a><span class="k">def</span> <span class="nf">fmtVarDescr</span><span class="p">(</span><span class="n">varname</span><span class="p">):</span>
     995    <span class="sd">&#39;&#39;&#39;Return a string with a more complete description for a GSAS-II variable </span>
     996
     997<span class="sd">    TODO: This will not handle rigid body parameters yet</span>
     998
     999<span class="sd">    :param str name: A full G2 variable name with 2 or 3</span>
     1000<span class="sd">       colons (&lt;p&gt;:&lt;h&gt;:name[:&lt;a&gt;])</span>
     1001<span class="sd">       </span>
     1002<span class="sd">    :returns: a string with the description</span>
     1003<span class="sd">    &#39;&#39;&#39;</span>
     1004   
     1005    <span class="n">l</span> <span class="o">=</span> <span class="n">getVarDescr</span><span class="p">(</span><span class="n">varname</span><span class="p">)</span>
     1006    <span class="k">if</span> <span class="ow">not</span> <span class="n">l</span><span class="p">:</span>
     1007        <span class="k">return</span> <span class="s">&quot;invalid variable name (&quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">varname</span><span class="p">)</span><span class="o">+</span><span class="s">&quot;)!&quot;</span>
     1008
     1009    <span class="k">if</span> <span class="ow">not</span> <span class="n">l</span><span class="p">[</span><span class="mi">4</span><span class="p">]:</span>
     1010        <span class="n">l</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;(variable needs a definition!)&quot;</span>
     1011
     1012    <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
     1013    <span class="k">if</span> <span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span> <span class="c"># HAP: keep short</span>
     1014        <span class="n">lbl</span> <span class="o">=</span> <span class="n">ShortPhaseNames</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="s">&#39;? #&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
     1015        <span class="n">hlbl</span> <span class="o">=</span> <span class="n">ShortHistNames</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span><span class="s">&#39;? #&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
     1016        <span class="k">if</span> <span class="n">hlbl</span><span class="p">[:</span><span class="mi">4</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;HKLF&#39;</span><span class="p">:</span>
     1017            <span class="n">hlbl</span> <span class="o">=</span> <span class="s">&#39;Xtl=&#39;</span><span class="o">+</span><span class="n">hlbl</span><span class="p">[</span><span class="mi">5</span><span class="p">:]</span>
     1018        <span class="k">elif</span> <span class="n">hlbl</span><span class="p">[:</span><span class="mi">4</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;PWDR&#39;</span><span class="p">:</span>
     1019            <span class="n">hlbl</span> <span class="o">=</span> <span class="s">&#39;Pwd=&#39;</span><span class="o">+</span><span class="n">hlbl</span><span class="p">[</span><span class="mi">5</span><span class="p">:]</span>
     1020        <span class="k">else</span><span class="p">:</span>
     1021            <span class="n">hlbl</span> <span class="o">=</span> <span class="s">&#39;Hist=&#39;</span><span class="o">+</span><span class="n">hlbl</span>
     1022        <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;Ph=&quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">lbl</span><span class="p">)</span><span class="o">+</span><span class="s">&quot; * &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">hlbl</span><span class="p">)</span><span class="o">+</span><span class="s">&quot;: &quot;</span>
     1023    <span class="k">elif</span> <span class="n">l</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span> <span class="c"># atom parameter, </span>
     1024        <span class="n">lbl</span> <span class="o">=</span> <span class="n">ShortPhaseNames</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="s">&#39;phase?&#39;</span><span class="p">)</span>
     1025        <span class="k">try</span><span class="p">:</span>
     1026            <span class="n">albl</span> <span class="o">=</span> <span class="n">LookupAtomLabel</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="n">l</span><span class="p">[</span><span class="mi">3</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span>
     1027        <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
     1028            <span class="n">albl</span> <span class="o">=</span> <span class="s">&#39;Atom?&#39;</span>
     1029        <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;Atom &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">albl</span><span class="p">)</span><span class="o">+</span><span class="s">&quot; in &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">lbl</span><span class="p">)</span><span class="o">+</span><span class="s">&quot;: &quot;</span>
     1030    <span class="k">elif</span> <span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
     1031        <span class="n">lbl</span> <span class="o">=</span> <span class="n">ShortPhaseNames</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span><span class="s">&#39;phase?&#39;</span><span class="p">)</span>
     1032        <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;Phase &quot;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">lbl</span><span class="p">)</span><span class="o">+</span><span class="s">&quot;: &quot;</span>
     1033    <span class="k">elif</span> <span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
     1034        <span class="n">hlbl</span> <span class="o">=</span> <span class="n">ShortHistNames</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span><span class="s">&#39;? #&#39;</span><span class="o">+</span><span class="nb">str</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span>
     1035        <span class="k">if</span> <span class="n">hlbl</span><span class="p">[:</span><span class="mi">4</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;HKLF&#39;</span><span class="p">:</span>
     1036            <span class="n">hlbl</span> <span class="o">=</span> <span class="s">&#39;Xtl=&#39;</span><span class="o">+</span><span class="n">hlbl</span><span class="p">[</span><span class="mi">5</span><span class="p">:]</span>
     1037        <span class="k">elif</span> <span class="n">hlbl</span><span class="p">[:</span><span class="mi">4</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;PWDR&#39;</span><span class="p">:</span>
     1038            <span class="n">hlbl</span> <span class="o">=</span> <span class="s">&#39;Pwd=&#39;</span><span class="o">+</span><span class="n">hlbl</span><span class="p">[</span><span class="mi">5</span><span class="p">:]</span>
     1039        <span class="k">else</span><span class="p">:</span>
     1040            <span class="n">hlbl</span> <span class="o">=</span> <span class="s">&#39;Hist=&#39;</span><span class="o">+</span><span class="n">hlbl</span>
     1041        <span class="n">s</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">hlbl</span><span class="p">)</span><span class="o">+</span><span class="s">&quot;: &quot;</span>   
     1042    <span class="k">if</span> <span class="ow">not</span> <span class="n">s</span><span class="p">:</span>
     1043        <span class="n">s</span> <span class="o">=</span> <span class="s">&#39;Global: &#39;</span>
     1044    <span class="n">s</span> <span class="o">+=</span> <span class="n">l</span><span class="p">[</span><span class="mi">4</span><span class="p">]</span>
     1045    <span class="k">return</span> <span class="n">s</span>
     1046</div>
     1047<div class="viewcode-block" id="getVarDescr"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.getVarDescr">[docs]</a><span class="k">def</span> <span class="nf">getVarDescr</span><span class="p">(</span><span class="n">varname</span><span class="p">):</span>
     1048    <span class="sd">&#39;&#39;&#39;Return a short description for a GSAS-II variable </span>
     1049
     1050<span class="sd">    :param str name: A full G2 variable name with 2 or 3</span>
     1051<span class="sd">       colons (&lt;p&gt;:&lt;h&gt;:name[:&lt;a&gt;])</span>
     1052<span class="sd">      </span>
     1053<span class="sd">    :returns: a five element list as [`p`,`h`,`name`,`a`,`description`],</span>
     1054<span class="sd">      where `p`, `h`, `a` are str values or `None`, for the phase number,</span>
     1055<span class="sd">      the histogram number and the atom number; `name` will always be</span>
     1056<span class="sd">      an str; and `description` is str or `None`.</span>
     1057<span class="sd">      If the variable name is incorrectly formed (for example, wrong</span>
     1058<span class="sd">      number of colons), `None` is returned instead of a list.</span>
     1059<span class="sd">    &#39;&#39;&#39;</span>
     1060    <span class="n">l</span> <span class="o">=</span> <span class="n">varname</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;:&#39;</span><span class="p">)</span>
     1061    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">l</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
     1062        <span class="n">l</span> <span class="o">+=</span> <span class="p">[</span><span class="bp">None</span><span class="p">]</span>
     1063    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">l</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">4</span><span class="p">:</span>
     1064        <span class="k">return</span> <span class="bp">None</span>
     1065    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">3</span><span class="p">):</span>
     1066        <span class="k">if</span> <span class="n">l</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="s">&quot;&quot;</span><span class="p">:</span>
     1067            <span class="n">l</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="bp">None</span>
     1068    <span class="n">l</span> <span class="o">+=</span> <span class="p">[</span><span class="n">getDescr</span><span class="p">(</span><span class="n">l</span><span class="p">[</span><span class="mi">2</span><span class="p">])]</span>
     1069    <span class="k">return</span> <span class="n">l</span>
     1070    </div>
     1071<div class="viewcode-block" id="CompileVarDesc"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.CompileVarDesc">[docs]</a><span class="k">def</span> <span class="nf">CompileVarDesc</span><span class="p">():</span>
     1072    <span class="sd">&#39;&#39;&#39;Set the values in the variable description lookup table (:attr:`VarDesc`)</span>
     1073<span class="sd">    into :attr:`reVarDesc`. This is called in :func:`getDescr` so the initialization</span>
     1074<span class="sd">    is always done before use.</span>
     1075
     1076<span class="sd">    Note that keys may contain regular expressions, where &#39;[xyz]&#39;</span>
     1077<span class="sd">    matches &#39;x&#39; &#39;y&#39; or &#39;z&#39; (equivalently &#39;[x-z]&#39; describes this as range of values).</span>
     1078<span class="sd">    &#39;.*&#39; matches any string. For example::</span>
     1079
     1080<span class="sd">    &#39;AUiso&#39;:&#39;Atomic isotropic displacement parameter&#39;,</span>
     1081
     1082<span class="sd">    will match variable ``&#39;p::AUiso:a&#39;``.</span>
     1083<span class="sd">    If parentheses are used in the key, the contents of those parentheses can be</span>
     1084<span class="sd">    used in the value, such as::</span>
     1085
     1086<span class="sd">    &#39;AU([123][123])&#39;:&#39;Atomic anisotropic displacement parameter U\\1&#39;,</span>
     1087
     1088<span class="sd">    will match ``AU11``, ``AU23``,.. and `U11`, `U23` etc will be displayed</span>
     1089<span class="sd">    in the value when used.</span>
    6621090<span class="sd">    </span>
    6631091<span class="sd">    &#39;&#39;&#39;</span>
    6641092    <span class="kn">import</span> <span class="nn">re</span>
    665     <span class="n">IDdict</span> <span class="o">=</span> <span class="p">{}</span>
    666     <span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;phases&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
    667     <span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;hists&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
    668     <span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;atoms&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
    669     <span class="c"># This dictionary lists descriptions for GSAS-II variables.</span>
    670     <span class="c"># Note that keys may contain regular expressions, where &#39;[xyz]&#39;</span>
    671     <span class="c"># matches &#39;x&#39; &#39;y&#39; or &#39;z&#39; (equivalently &#39;[x-z]&#39; describes this as range of values).</span>
    672     <span class="c"># &#39;.*&#39; matches any string</span>
    673     <span class="n">VarDesc</span> <span class="o">=</span> <span class="p">{</span>
     1093    <span class="k">if</span> <span class="n">reVarDesc</span><span class="p">:</span> <span class="k">return</span> <span class="c"># already done</span>
     1094    <span class="k">for</span> <span class="n">key</span><span class="p">,</span><span class="n">value</span> <span class="ow">in</span> <span class="p">{</span>
    6741095        <span class="c"># Phase vars (p::&lt;var&gt;)</span>
    675         <span class="s">&#39;A[0-5]&#39;</span> <span class="p">:</span> <span class="s">&#39;Reciprocal metric tensor component&#39;</span><span class="p">,</span>
     1096        <span class="s">&#39;A([0-5])&#39;</span> <span class="p">:</span> <span class="s">&#39;Reciprocal metric tensor component </span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
    6761097        <span class="s">&#39;Vol&#39;</span> <span class="p">:</span> <span class="s">&#39;Unit cell volume????&#39;</span><span class="p">,</span>
    6771098        <span class="c"># Atom vars (p::&lt;var&gt;:a)</span>
    678         <span class="s">&#39;dA[xyz]&#39;</span> <span class="p">:</span> <span class="s">&#39;change to atomic position&#39;</span><span class="p">,</span>
     1099        <span class="s">&#39;dA([xyz])&#39;</span> <span class="p">:</span> <span class="s">&#39;change to atomic position </span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
    6791100        <span class="s">&#39;AUiso&#39;</span><span class="p">:</span><span class="s">&#39;Atomic isotropic displacement parameter&#39;</span><span class="p">,</span>
    680         <span class="s">&#39;AU[123][123]&#39;</span><span class="p">:</span><span class="s">&#39;Atomic anisotropic displacement parameter&#39;</span><span class="p">,</span>
    681         <span class="s">&#39;AFrac&#39;</span><span class="p">:</span> <span class="s">&#39;Atomic occupancy parameter&#39;</span><span class="p">,</span>
     1101        <span class="s">&#39;AU([123][123])&#39;</span><span class="p">:</span><span class="s">&#39;Atomic anisotropic displacement parameter U</span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
     1102        <span class="s">&#39;Afrac&#39;</span><span class="p">:</span> <span class="s">&#39;Atomic occupancy parameter&#39;</span><span class="p">,</span>
    6821103        <span class="c"># Hist &amp; Phase (HAP) vars (p:h:&lt;var&gt;)</span>
    683         <span class="s">&#39;Bab[AU]&#39;</span><span class="p">:</span> <span class="s">&#39;Babinet solvent scattering coef.&#39;</span><span class="p">,</span>
    684         <span class="s">&#39;D[123][123]&#39;</span> <span class="p">:</span> <span class="s">&#39;Anisotropic strain coef.&#39;</span><span class="p">,</span>
     1104        <span class="s">&#39;Bab([AU])&#39;</span><span class="p">:</span> <span class="s">&#39;Babinet solvent scattering coef. </span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
     1105        <span class="s">&#39;D([123][123])&#39;</span> <span class="p">:</span> <span class="s">&#39;Anisotropic strain coef. </span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
    6851106        <span class="s">&#39;Extinction&#39;</span> <span class="p">:</span> <span class="s">&#39;Extinction coef.&#39;</span><span class="p">,</span>
    6861107        <span class="s">&#39;MD&#39;</span> <span class="p">:</span> <span class="s">&#39;March-Dollase coef.&#39;</span><span class="p">,</span>
     
    6911112        <span class="c">#Histogram vars (:h:&lt;var&gt;)</span>
    6921113        <span class="s">&#39;Absorption&#39;</span> <span class="p">:</span> <span class="s">&#39;Absorption coef.&#39;</span><span class="p">,</span>
    693         <span class="s">&#39;Displace[XY]&#39;</span> <span class="p">:</span> <span class="s">&#39;Debye-Scherrer sample displacement&#39;</span><span class="p">,</span>
     1114        <span class="s">&#39;Displace([XY])&#39;</span> <span class="p">:</span> <span class="s">&#39;Debye-Scherrer sample displacement </span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
    6941115        <span class="s">&#39;Lam&#39;</span> <span class="p">:</span> <span class="s">&#39;Wavelength&#39;</span><span class="p">,</span>
    695         <span class="s">&#39;Polariz&#39;</span> <span class="p">:</span> <span class="s">&#39;Polarization correction&#39;</span><span class="p">,</span>
     1116        <span class="s">&#39;Polariz\.&#39;</span> <span class="p">:</span> <span class="s">&#39;Polarization correction&#39;</span><span class="p">,</span>
    6961117        <span class="s">&#39;SH/L&#39;</span> <span class="p">:</span> <span class="s">&#39;FCJ peak asymmetry correction&#39;</span><span class="p">,</span>
    6971118        <span class="s">&#39;Scale&#39;</span> <span class="p">:</span> <span class="s">&#39;Histogram scale factor&#39;</span><span class="p">,</span>
    698         <span class="s">&#39;[UVW]&#39;</span> <span class="p">:</span> <span class="s">&#39;Gaussian instrument broadening&#39;</span><span class="p">,</span>
    699         <span class="s">&#39;[XY]&#39;</span> <span class="p">:</span> <span class="s">&#39;Cauchy instrument broadening&#39;</span><span class="p">,</span>
     1119        <span class="s">&#39;([UVW])&#39;</span> <span class="p">:</span> <span class="s">&#39;Gaussian instrument broadening </span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
     1120        <span class="s">&#39;([XY])&#39;</span> <span class="p">:</span> <span class="s">&#39;Cauchy instrument broadening </span><span class="se">\\</span><span class="s">1&#39;</span><span class="p">,</span>
    7001121        <span class="s">&#39;Zero&#39;</span> <span class="p">:</span> <span class="s">&#39;Debye-Scherrer zero correction&#39;</span><span class="p">,</span>
    7011122        <span class="s">&#39;nDebye&#39;</span> <span class="p">:</span> <span class="s">&#39;Debye model background corr. terms&#39;</span><span class="p">,</span>
    702         <span class="s">&#39;nPeaks&#39;</span> <span class="p">:</span> <span class="s">&#39;Fixed peak  background corr. terms&#39;</span><span class="p">,</span>
     1123        <span class="s">&#39;nPeaks&#39;</span> <span class="p">:</span> <span class="s">&#39;Fixed peak background corr. terms&#39;</span><span class="p">,</span>
    7031124        <span class="c"># Global vars (::&lt;var&gt;)</span>
    704         <span class="p">}</span>
     1125        <span class="p">}</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
     1126        <span class="n">VarDesc</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
     1127        <span class="n">reVarDesc</span><span class="p">[</span><span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="n">key</span><span class="p">)]</span> <span class="o">=</span> <span class="n">value</span>
     1128</div>
     1129<div class="viewcode-block" id="getDescr"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.getDescr">[docs]</a><span class="k">def</span> <span class="nf">getDescr</span><span class="p">(</span><span class="n">name</span><span class="p">):</span>
     1130    <span class="sd">&#39;&#39;&#39;Return a short description for a GSAS-II variable </span>
     1131
     1132<span class="sd">    :param str name: The descriptive part of the variable name without colons (:)</span>
     1133<span class="sd">      </span>
     1134<span class="sd">    :returns: a short description or None if not found</span>
     1135<span class="sd">    &#39;&#39;&#39;</span>
     1136
     1137    <span class="n">CompileVarDesc</span><span class="p">()</span> <span class="c"># compile the regular expressions, if needed</span>
     1138    <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">reVarDesc</span><span class="p">:</span>
     1139        <span class="n">m</span> <span class="o">=</span> <span class="n">key</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
     1140        <span class="k">if</span> <span class="n">m</span><span class="p">:</span>
     1141            <span class="k">return</span> <span class="n">m</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">reVarDesc</span><span class="p">[</span><span class="n">key</span><span class="p">])</span>
     1142    <span class="k">return</span> <span class="bp">None</span>
     1143</div>
     1144<span class="k">def</span> <span class="nf">_lookup</span><span class="p">(</span><span class="n">dic</span><span class="p">,</span><span class="n">key</span><span class="p">):</span>
     1145    <span class="sd">&#39;&#39;&#39;Lookup a key in a dictionary, where None returns an empty string</span>
     1146<span class="sd">    but an unmatched key returns a question mark. Used in :class:`G2VarObj`</span>
     1147<span class="sd">    &#39;&#39;&#39;</span>
     1148    <span class="k">if</span> <span class="n">key</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
     1149        <span class="k">return</span> <span class="s">&quot;&quot;</span>
     1150    <span class="k">else</span><span class="p">:</span>
     1151        <span class="k">return</span> <span class="n">dic</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">,</span><span class="s">&#39;?&#39;</span><span class="p">)</span>
     1152
     1153<div class="viewcode-block" id="G2VarObj"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.G2VarObj">[docs]</a><span class="k">class</span> <span class="nc">G2VarObj</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
     1154    <span class="sd">&#39;&#39;&#39;Defines a GSAS-II variable either using the phase/atom/histogram</span>
     1155<span class="sd">    unique Id numbers or using a character string that specifies</span>
     1156<span class="sd">    variables by phase/atom/histogram number (which can change).</span>
     1157<span class="sd">    Note that :func:`LoadID` should be used to (re)load the current Ids</span>
     1158<span class="sd">    before creating or later using the G2VarObj object.</span>
     1159
     1160<span class="sd">    A :class:`G2VarObj` object can be created with a single parameter:</span>
     1161<span class="sd">    </span>
     1162<span class="sd">    :param str/tuple varname: a single value can be used to create a :class:`G2VarObj`</span>
     1163<span class="sd">      object. If a string, it must be of form &quot;p:h:var&quot; or &quot;p:h:var:a&quot;, where</span>
     1164
     1165<span class="sd">     * p is the phase number (which may be left blank); </span>
     1166<span class="sd">     * h is the histogram number (which may be left blank); </span>
     1167<span class="sd">     * a is the atom number (which may be left blank in which case the third colon is omitted).</span>
     1168
     1169<span class="sd">      Alternately a single tuple of form (Phase,Histogram,VarName,AtomID) can be used, where</span>
     1170<span class="sd">      Phase, Histogram, and AtomID are None or are ranId values and VarName is a string.     </span>
     1171
     1172<span class="sd">    If four positional arguments are supplied, they are:</span>
     1173
     1174<span class="sd">    :param str/int phasenum: The number for the phase</span>
     1175<span class="sd">    :param str/int histnum: The number for the histogram</span>
     1176<span class="sd">    :param str varname: a single value can be used to create a :class:`G2VarObj`</span>
     1177<span class="sd">    :param str/int atomnum: The number for the atom</span>
     1178<span class="sd">    </span>
     1179<span class="sd">    &#39;&#39;&#39;</span>
     1180    <span class="n">IDdict</span> <span class="o">=</span> <span class="p">{}</span>
     1181    <span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;phases&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
     1182    <span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;hists&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
     1183    <span class="n">IDdict</span><span class="p">[</span><span class="s">&#39;atoms&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
    7051184    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="o">*</span><span class="n">args</span><span class="p">):</span>
    7061185        <span class="bp">self</span><span class="o">.</span><span class="n">phase</span> <span class="o">=</span> <span class="bp">None</span>
     
    7081187        <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
    7091188        <span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="o">=</span> <span class="bp">None</span>
    710         <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
     1189        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">list</span> <span class="ow">or</span> <span class="nb">type</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">tuple</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span>
     1190            <span class="bp">self</span><span class="o">.</span><span class="n">phase</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">histogram</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
     1191        <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="s">&#39;:&#39;</span> <span class="ow">in</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>           
    7111192            <span class="n">lst</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;:&#39;</span><span class="p">)</span>
    712             <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span> <span class="s">&quot;Need to look up IDs&quot;</span>
    713             <span class="bp">self</span><span class="o">.</span><span class="n">phase</span> <span class="o">=</span> <span class="n">lst</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
    714             <span class="bp">self</span><span class="o">.</span><span class="n">histogram</span> <span class="o">=</span> <span class="n">lst</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
     1193            <span class="bp">self</span><span class="o">.</span><span class="n">phase</span> <span class="o">=</span> <span class="n">PhaseIdLookup</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">lst</span><span class="p">[</span><span class="mi">0</span><span class="p">],[</span><span class="bp">None</span><span class="p">,</span><span class="bp">None</span><span class="p">])[</span><span class="mi">1</span><span class="p">]</span>
     1194            <span class="bp">self</span><span class="o">.</span><span class="n">histogram</span> <span class="o">=</span> <span class="n">HistIdLookup</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">lst</span><span class="p">[</span><span class="mi">1</span><span class="p">],[</span><span class="bp">None</span><span class="p">,</span><span class="bp">None</span><span class="p">])[</span><span class="mi">1</span><span class="p">]</span>
    7151195            <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">lst</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
    7161196            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">lst</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">3</span><span class="p">:</span>
    717                 <span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="o">=</span> <span class="n">lst</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span>
     1197                <span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="o">=</span> <span class="n">AtomIdLookup</span><span class="p">[</span><span class="n">lst</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">lst</span><span class="p">[</span><span class="mi">3</span><span class="p">],[</span><span class="bp">None</span><span class="p">,</span><span class="bp">None</span><span class="p">])[</span><span class="mi">1</span><span class="p">]</span>
    7181198        <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span>
    719             <span class="bp">self</span><span class="o">.</span><span class="n">phase</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
    720             <span class="bp">self</span><span class="o">.</span><span class="n">histogram</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
     1199            <span class="bp">self</span><span class="o">.</span><span class="n">phase</span> <span class="o">=</span> <span class="n">PhaseIdLookup</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]),[</span><span class="bp">None</span><span class="p">,</span><span class="bp">None</span><span class="p">])[</span><span class="mi">1</span><span class="p">]</span>
     1200            <span class="bp">self</span><span class="o">.</span><span class="n">histogram</span> <span class="o">=</span> <span class="n">HistIdLookup</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]),[</span><span class="bp">None</span><span class="p">,</span><span class="bp">None</span><span class="p">])[</span><span class="mi">1</span><span class="p">]</span>
    7211201            <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
    722             <span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span>
     1202            <span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="o">=</span> <span class="n">AtomIdLookup</span><span class="p">[</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">3</span><span class="p">]),[</span><span class="bp">None</span><span class="p">,</span><span class="bp">None</span><span class="p">])[</span><span class="mi">1</span><span class="p">]</span>
    7231203        <span class="k">else</span><span class="p">:</span>
    7241204            <span class="k">raise</span> <span class="ne">Exception</span><span class="p">,</span><span class="s">&quot;Incorrectly called GSAS-II parameter name&quot;</span>
    7251205
     1206        <span class="c">#print &quot;DEBUG: created &quot;,self.phase,self.histogram,self.name,self.atom</span>
     1207
    7261208    <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    727         <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">()</span>
    728 
    729 <div class="viewcode-block" id="VarName.name"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.VarName.name">[docs]</a>    <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    730         <span class="sd">&#39;&#39;&#39;Formats the GSAS-II variable name as a &quot;traditional&quot; string (p:h:&lt;var&gt;:a)</span>
     1209        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">varname</span><span class="p">()</span>
     1210
     1211<div class="viewcode-block" id="G2VarObj.varname"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.G2VarObj.varname">[docs]</a>    <span class="k">def</span> <span class="nf">varname</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
     1212        <span class="sd">&#39;&#39;&#39;Formats the GSAS-II variable name as a &quot;traditional&quot; GSAS-II variable </span>
     1213<span class="sd">        string (p:h:&lt;var&gt;:a) or (p:h:&lt;var&gt;)</span>
    7311214
    7321215<span class="sd">        :returns: the variable name as a str</span>
    7331216<span class="sd">        &#39;&#39;&#39;</span>
    734         <span class="k">def</span> <span class="nf">_fmt</span><span class="p">(</span><span class="n">val</span><span class="p">):</span>
    735             <span class="k">if</span> <span class="n">val</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
    736                 <span class="k">return</span> <span class="s">&quot;&quot;</span>
    737             <span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="n">val</span><span class="p">)</span>
    738         <span class="k">return</span> <span class="n">_fmt</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">phase</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span> <span class="o">+</span> <span class="n">_fmt</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">histogram</span><span class="p">)</span> <span class="o">+</span> <span class="n">_fmt</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="o">+</span> <span class="n">_fmt</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">atom</span><span class="p">)</span>
    739 </div>
     1217        <span class="n">ph</span> <span class="o">=</span> <span class="n">_lookup</span><span class="p">(</span><span class="n">PhaseRanIdLookup</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">phase</span><span class="p">)</span>
     1218        <span class="n">hist</span> <span class="o">=</span> <span class="n">_lookup</span><span class="p">(</span><span class="n">HistRanIdLookup</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">histogram</span><span class="p">)</span>
     1219        <span class="n">s</span> <span class="o">=</span> <span class="p">(</span><span class="n">ph</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span> <span class="o">+</span> <span class="n">hist</span> <span class="o">+</span> <span class="s">&quot;:&quot;</span> <span class="o">+</span>
     1220             <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">))</span>
     1221        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">atom</span><span class="p">:</span>
     1222            <span class="k">if</span> <span class="n">ph</span> <span class="ow">in</span> <span class="n">AtomRanIdLookup</span><span class="p">:</span>
     1223                <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;:&quot;</span> <span class="o">+</span> <span class="n">AtomRanIdLookup</span><span class="p">[</span><span class="n">ph</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">atom</span><span class="p">,</span><span class="s">&#39;?&#39;</span><span class="p">)</span>
     1224            <span class="k">else</span><span class="p">:</span>
     1225                <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;:?&quot;</span>
     1226        <span class="k">return</span> <span class="n">s</span>
     1227    </div>
    7401228    <span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    7411229        <span class="sd">&#39;&#39;&#39;Return the detailed contents of the object</span>
    7421230<span class="sd">        &#39;&#39;&#39;</span>
    743         <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
    744         <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">phase</span><span class="p">:</span>
    745             <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;Phase: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">phase</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;; &quot;</span>
    746 
    747         <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">histogram</span><span class="p">:</span>
    748             <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;Histogram: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">histogram</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;; &quot;</span>
    749            
    750         <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
    751             <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;Variable name: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;; &quot;</span>
    752 
    753         <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">atom</span><span class="p">:</span>
    754             <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;Atom number: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">atom</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;; &quot;</span>
    755 
    756         <span class="k">return</span> <span class="n">s</span><span class="o">+</span><span class="s">&quot;(&quot;</span><span class="o">+</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">()</span><span class="o">+</span><span class="s">&quot;)&quot;</span>
    757 
    758     <span class="k">def</span> <span class="nf">getDescr</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    759         <span class="sd">&#39;&#39;&#39;Return a short description for a GSAS-II variable </span>
    760 
    761 <span class="sd">        :returns: a short description or &#39;no definition&#39; if not found</span>
    762 <span class="sd">        &#39;&#39;&#39;</span>
    763         <span class="c"># iterating over uncompiled regular expressions is not terribly fast,</span>
    764         <span class="c"># but this routine should not need to be all that speedy</span>
    765         <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">VarDesc</span><span class="p">:</span>
    766             <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">):</span>
    767                 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">VarDesc</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
    768         <span class="k">return</span> <span class="s">&#39;no definition&#39;</span>
    769 
    770 <div class="viewcode-block" id="VarName.getDescr"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.VarName.getDescr">[docs]</a>    <span class="k">def</span> <span class="nf">getDescr</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    771         <span class="sd">&#39;&#39;&#39;Return a short description for a GSAS-II variable </span>
    772 
    773 <span class="sd">        :returns: a short description or &#39;no definition&#39; if not found</span>
    774 <span class="sd">        &#39;&#39;&#39;</span>
    775         <span class="c"># iterating over uncompiled regular expressions is not terribly fast,</span>
    776         <span class="c"># but this routine should not need to be all that speedy</span>
    777         <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">VarDesc</span><span class="p">:</span>
    778             <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">):</span>
    779                 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">VarDesc</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
    780         <span class="k">return</span> <span class="s">&#39;no definition&#39;</span>
    781 </div>
    782 <div class="viewcode-block" id="VarName.fullDescr"><a class="viewcode-back" href="../GSASIIobj.html#GSASIIobj.VarName.fullDescr">[docs]</a>    <span class="k">def</span> <span class="nf">fullDescr</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    783         <span class="sd">&#39;&#39;&#39;Return a longer description for a GSAS-II variable </span>
    784 
    785 <span class="sd">        :returns: a short description or &#39;no definition&#39; if not found</span>
    786 <span class="sd">        &#39;&#39;&#39;</span>
    787         <span class="c"># iterating over uncompiled regular expressions is not terribly fast,</span>
    788         <span class="c"># but this routine should not need to be all that speedy</span>
    789         <span class="nb">str</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">()</span>
    790        
    791         <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">VarDesc</span><span class="p">:</span>
    792             <span class="k">if</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">):</span>
    793                 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">VarDesc</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
    794         <span class="k">return</span> <span class="s">&#39;no definition&#39;</span>
    795 
    796 </div>
     1231        <span class="n">s</span> <span class="o">=</span> <span class="s">&quot;&lt;&quot;</span>
     1232        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">phase</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
     1233            <span class="n">ph</span> <span class="o">=</span>  <span class="n">_lookup</span><span class="p">(</span><span class="n">PhaseRanIdLookup</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">phase</span><span class="p">)</span>
     1234            <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;Phase: rId=&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">phase</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; (#&quot;</span><span class="o">+</span> <span class="n">ph</span> <span class="o">+</span> <span class="s">&quot;); &quot;</span>
     1235        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">histogram</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
     1236            <span class="n">hist</span> <span class="o">=</span> <span class="n">_lookup</span><span class="p">(</span><span class="n">HistRanIdLookup</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">histogram</span><span class="p">)</span>
     1237            <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;Histogram: rId=&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">histogram</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot; (#&quot;</span><span class="o">+</span> <span class="n">hist</span> <span class="o">+</span> <span class="s">&quot;); &quot;</span>
     1238        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
     1239            <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot;Atom rId=&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">atom</span><span class="p">)</span>
     1240            <span class="k">if</span> <span class="n">ph</span> <span class="ow">in</span> <span class="n">AtomRanIdLookup</span><span class="p">:</span>
     1241                <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot; (#&quot;</span> <span class="o">+</span> <span class="n">AtomRanIdLookup</span><span class="p">[</span><span class="n">ph</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">atom</span><span class="p">,</span><span class="s">&#39;?&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;); &quot;</span>
     1242            <span class="k">else</span><span class="p">:</span>
     1243                <span class="n">s</span> <span class="o">+=</span> <span class="s">&quot; (#? -- not found!); &quot;</span>
     1244        <span class="n">s</span> <span class="o">+=</span> <span class="s">&#39;Variable name=&quot;&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;&quot;&gt;&#39;</span>
     1245        <span class="k">return</span> <span class="n">s</span><span class="o">+</span><span class="s">&quot;(&quot;</span><span class="o">+</span><span class="bp">self</span><span class="o">.</span><span class="n">varname</span><span class="p">()</span><span class="o">+</span><span class="s">&quot;)&quot;</span>
     1246
     1247    <span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
     1248        <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
     1249            <span class="k">return</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">phase</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">phase</span> <span class="ow">and</span>
     1250                    <span class="bp">self</span><span class="o">.</span><span class="n">histogram</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">histogram</span> <span class="ow">and</span>
     1251                    <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">name</span> <span class="ow">and</span>
     1252                    <span class="bp">self</span><span class="o">.</span><span class="n">atom</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">atom</span><span class="p">)</span>
     1253        <span class="k">return</span> <span class="bp">False</span>
     1254
    7971255    <span class="k">def</span> <span class="nf">_show</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
    7981256        <span class="s">&#39;For testing, shows the current lookup table&#39;</span>
Note: See TracChangeset for help on using the changeset viewer.