Changeset 3102


Ignore:
Timestamp:
Sep 28, 2017 11:17:17 AM (5 years ago)
Author:
toby
Message:

docs for G2scripting; start thinking about how to postpone G2path.SetBinary?

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIscriptable.py

    r3098 r3102  
    1010"""
    1111*GSASIIscriptable: Scripting Tools*
    12 -----------------------------------
     12======================================
    1313
    1414Routines for reading, writing, modifying and creating GSAS-II project (.gpx) files.
     
    2929=====================
    3030
    31 There are three classes of refinement parameters:
    32 
    33     * Histogram. Turned on and off through :func:`G2PwdrData.set_refinements`
    34       and :func:`G2PwdrData.clear_refinements`
    35     * Phase. Turned on and off through :func:`G2Phase.set_refinements`
     31There are three types of refinement parameters:
     32
     33    * Histogram: These can be turned on and off through
     34      :meth:`G2PwdrData.set_refinements` and :func:`G2PwdrData.clear_refinements`
     35    * Phase: Turned on and off through :func:`G2Phase.set_refinements`
    3636      and :func:`G2Phase.clear_refinements`
    37     * Histogram-and-phase (HAP). Turned on and off through
     37    * Histogram-and-phase (HAP): Turned on and off through
    3838      :func:`G2Phase.set_HAP_refinements` and :func:`G2Phase.clear_HAP_refinements`
    3939
     40These parameters can be combined and set by :meth:`G2Project.do_refinements`
     41or :meth:`G2Project.set_refinement`.
    4042
    4143============================
     
    6769    some_histogram.clear_refinements(params['clear'])
    6870
    69 .. tabularcolumns:: |l|p|p|
    70 
    71 ===================== ====================  ====================
     71.. tabularcolumns:: |l|l|p{3.5in}|
     72
     73===================== ====================  =================================================
    7274key                   subkey                explanation
    73 ===================== ====================  ====================
     75===================== ====================  =================================================
    7476Limits                                      The 2-theta range of values to consider. Can
    7577                                            be either a dictionary of 'low' and/or 'high',
     
    102104\                     Polariz.              Polarization parameter
    103105\                     Lam                   Lambda, the incident wavelength
    104 ===================== ====================  ====================
    105 
     106===================== ====================  =================================================
    106107
    107108.. _Phase_parameters_table:
     
    124125    some_histogram.set_refinements(params)
    125126
    126 .. tabularcolumns:: |l|p|
    127 
    128 ===================== ====================
     127.. tabularcolumns:: |l|p{4.5in}|
     128
     129===================== ============================================
    129130key                   explanation
    130 ===================== ====================
     131===================== ============================================
    131132Cell                  Whether or not to refine the unit cell.
    132133Atoms                 Dictionary of atoms and refinement flags.
     
    138139                      and 'U' for Debye-Waller factor
    139140LeBail                Enables LeBail intensity extraction.
    140 ===================== ====================
     141===================== ============================================
    141142
    142143.. _HAP_parameters_table:
     
    160161    some_phase.set_HAP_refinements(params)
    161162
    162 .. tabularcolumns:: |l|p|p|
    163 
    164 ===================== ========================================
     163.. tabularcolumns:: |l|l|p{3.5in}|
     164
     165===================== ====================  =================================================
    165166key                   subkey                 explanation
    166 ===================== ========================================
     167===================== ====================  =================================================
    167168Babinet                                      Should be a **list** of the following
    168169                                             subkeys. If not, assumes both
     
    189190Use                                          Boolean, True to refine
    190191Scale                                        Phase fraction; Boolean, True to refine
    191 ===================== =====================  ====================
     192===================== ====================  =================================================
     193
    192194
    193195============================
     
    212214
    213215import GSASIIpath
    214 GSASIIpath.SetBinaryPath(False) # would rather have this in __name__ == '__main__' stanza
     216GSASIIpath.SetBinaryPath(True)  # for now, this is needed before some of these modules can be imported
    215217import GSASIIobj as G2obj
    216218import GSASIIpwd as G2pwd
     
    223225PwdrDataReaders = []
    224226PhaseReaders = []
    225 
    226227
    227228def LoadG2fil():
     
    858859    >>> phase = proj.phase('name of phase')
    859860
    860     New data can also be loaded via :func:`~G2Project.add_phase` and
    861     :func:`~G2Project.add_powder_histogram`.
     861    New data can also be loaded via :meth:`~G2Project.add_phase` and
     862    :meth:`~G2Project.add_powder_histogram`.
    862863
    863864    >>> hist = proj.add_powder_histogram('some_data_file.chi',
     
    866867
    867868    Parameters for Rietveld refinement can be turned on and off as well.
    868     See :func:`~G2Project.set_refinement`, :func:`~G2Project.refine`,
    869     :func:`~G2Project.iter_refinements`, :func:`~G2Project.do_refinements`.
     869    See :meth:`~G2Project.set_refinement`, :meth:`~G2Project.refine`,
     870    :meth:`~G2Project.iter_refinements`, :meth:`~G2Project.do_refinements`.
    870871    """
    871872    def __init__(self, gpxfile=None, author=None, filename=None):
     
    10341035        .. seealso::
    10351036
    1036             :func:`~G2Project.histogram`
    1037             :func:`~G2Project.phase`"""
     1037            :meth:`G2Project.histogram`
     1038            :meth:`G2Project.phase`"""
    10381039        hist = self.histogram(histogram)
    10391040        phase = self.phase(phase)
     
    10891090
    10901091        .. seealso::
    1091             :func:`~GSASIIscriptable.G2Project.histograms`
    1092             :func:`~GSASIIscriptable.G2Project.phase`
    1093             :func:`~GSASIIscriptable.G2Project.phases`
     1092            :meth:`G2Project.histograms`
     1093            :meth:`G2Project.phase`
     1094            :meth:`G2Project.phases`
    10941095            """
    10951096        if isinstance(histname, G2PwdrData):
     
    11131114
    11141115        .. seealso::
    1115             :func:`~GSASIIscriptable.G2Project.histograms`
    1116             :func:`~GSASIIscriptable.G2Project.phase`
    1117             :func:`~GSASIIscriptable.G2Project.phases`
     1116            :meth:`G2Project.histograms`
     1117            :meth:`G2Project.phase`
     1118            :meth:`G2Project.phases`
    11181119            """
    11191120        output = []
     
    11331134
    11341135        .. seealso::
    1135             :func:`~GSASIIscriptable.G2Project.histograms`
    1136             :func:`~GSASIIscriptable.G2Project.phase`
    1137             :func:`~GSASIIscriptable.G2Project.phases`
     1136            :meth:`G2Project.histograms`
     1137            :meth:`G2Project.phase`
     1138            :meth:`G2Project.phases`
    11381139            """
    11391140        phases = self.data['Phases']
     
    11581159
    11591160        .. seealso::
    1160             :func:`~GSASIIscriptable.G2Project.histogram`
    1161             :func:`~GSASIIscriptable.G2Project.histograms`
    1162             :func:`~GSASIIscriptable.G2Project.phase`
     1161            :meth:`G2Project.histogram`
     1162            :meth:`G2Project.histograms`
     1163            :meth:`G2Project.phase`
    11631164            """
    11641165        for obj in self.names:
     
    12551256
    12561257        .. seealso::
    1257             :func:`~G2PwdrData.set_refinements`
    1258             :func:`~G2PwdrData.clear_refinements`
    1259             :func:`~G2Phase.set_refinements`
    1260             :func:`~G2Phase.clear_refinements`
    1261             :func:`~G2Phase.set_HAP_refinements`
    1262             :func:`~G2Phase.clear_HAP_refinements`"""
     1258            :meth:`G2PwdrData.set_refinements`
     1259            :meth:`G2PwdrData.clear_refinements`
     1260            :meth:`G2Phase.set_refinements`
     1261            :meth:`G2Phase.clear_refinements`
     1262            :meth:`G2Phase.set_HAP_refinements`
     1263            :meth:`G2Phase.clear_HAP_refinements`"""
    12631264
    12641265        if histogram == 'all':
     
    13491350            string variable specifiers, or arguments for :meth:`make_var_obj`
    13501351        :param str type: A string constraint type specifier. See
    1351             :class:`~GSASIIscriptable.G2Project.add_constraint_raw`
     1352            :class:`G2Project.add_constraint_raw`
    13521353
    13531354        """
     
    17651766
    17661767        .. seealso::
    1767             :func:`~GSASIIscriptable.G2Phase.atom`
     1768            :meth:`G2Phase.atom`
    17681769            :class:`G2AtomRecord`
    17691770        """
     
    18001801
    18011802        .. seealso::
    1802            :func:`~G2Phase.get_cell_and_esd`
     1803           :meth:`G2Phase.get_cell_and_esd`
    18031804
    18041805        """
     
    18161817
    18171818        .. seealso::
    1818            :func:`~G2Phase.get_cell`
     1819           :meth:`G2Phase.get_cell`
    18191820
    18201821        """
     
    21702171
    21712172def dump(args):
    2172     """The dump subcommand"""
     2173    """The dump subcommand. This is intended to be called by the :func:`main` routine.
     2174    This is typically called by invoking this script with a subcommand::
     2175
     2176       python GSASIIscriptable.py dump <file.gpx>
     2177    """
    21732178    if not args.histograms and not args.phases:
    21742179        args.raw = True
     
    22952300        * :func:`seqrefine`
    22962301        * :func:`export`
    2297         * :func:`browse`
     2302        * browse (:func:`IPyBrowse`)
     2303
     2304    These commands are typically called by invoking this script with a subcommand,
     2305    for example::
     2306
     2307       python GSASIIscriptable.py dump <file.gpx>
     2308       
    22982309
    22992310    .. seealso::
     
    23032314        :func:`seqrefine`
    23042315        :func:`export`
    2305         :func:`browse`
     2316        :func:`IPyBrowse`
    23062317    '''
    23072318    parser = argparse.ArgumentParser()
  • trunk/GSASIIspc.py

    r3097 r3102  
    2424import GSASIIpath
    2525GSASIIpath.SetVersionNumber("$Revision$")
    26 import pyspg
    2726
    2827npsind = lambda x: np.sin(x*np.pi/180.)
     
    7069        SGSymbol = SGSymbol.replace(':',' ')    #get rid of ':' in R space group symbols from some cif files
    7170    SGSymbol = SGSymbol.split(':')[0]   #remove :1/2 setting symbol from some cif files
     71    import pyspg
    7272    SGInfo = pyspg.sgforpy(SGSymbol)
    7373    SGData['SpGrp'] = SGSymbol.strip().lower().capitalize()
     
    17501750    Cen = np.array([cen for cen in SGData['SGCen']],order='F')
    17511751   
     1752    import pyspg
    17521753    Nuniq,Uniq,iabsnt,mulp = pyspg.genhklpy(hklf,len(Ops),OpM,OpT,SGData['SGInv'],len(Cen),Cen)
    17531754    h,k,l,f = Uniq
  • trunk/docs/source/GSASIIscripts.rst

    r3000 r3102  
    1 *GSAS-II Scripts*
    2 =================
    3 
    41.. automodule:: GSASIIscriptable
    52    :members:
     3
     4*GSAS-II Misc Scripts*
     5======================
    66
    77.. automodule:: testDeriv
  • trunk/help/gsasII.html

    r2833 r3102  
    64646464
    64656465<h4 style='margin-left:0.25in'><a name=Data></a><u><span style='mso-fareast-font-family:
    6466 "Times New Roman"'>Data sets<span class=MsoHyperlink><span style='color:#5B9BD5;
     6466"Times New Roman"'>Data<span class=MsoHyperlink><span style='color:#5B9BD5;
    64676467mso-themecolor:accent1'><o:p></o:p></span></span></span></u></h4>
    64686468
     
    72747274<hr size=2 width="100%" align=center>
    72757275
    7276 <!-- hhmts start -->Last modified: Fri May 12 18:18:37 CDT 2017 <!-- hhmts end -->
     7276<!-- hhmts start -->Last modified: Thu Sep 28 11:14:02 CDT 2017 <!-- hhmts end -->
    72777277
    72787278</div>
Note: See TracChangeset for help on using the changeset viewer.