Changeset 4327 for trunk


Ignore:
Timestamp:
Feb 24, 2020 4:38:19 PM (4 years ago)
Author:
toby
Message:

misc doc updates

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIobj.py

    r4326 r4327  
    173173  \         BondRadii           (list of floats) Default radius for each atom used to compute
    174174                                interatomic distances
    175   \         Cell                (list with 8 items, all float, except first
    176                                 item is bool) cell refinement flag,
    177                                 a, b, c, (:math:`\\AA`)
    178                                 alpha, beta & gamma (degrees)
    179                                 volume (:math:`\AA^3`)
     175  \         Cell                Unit cell parameters & ref. flag
     176                                (list with 8 items. All but first item are float.)
     177
     178                                 0: cell refinement flag (True/False),
     179                                 1-3: a, b, c, (:math:`\\AA`)
     180                                 4-6: alpha, beta & gamma, (degrees)
     181                                 7: volume (:math:`\\AA^3`)
    180182  \         Color               (list of (r,b,g) triplets) Colors for atoms
    181183  \         Compare             (dict) Polygon comparison parameters
  • trunk/GSASIIscriptable.py

    r4326 r4327  
    948948        img.saveControls(os.path.splitext(img.name)[0]+'.imctrl')
    949949    gpx.save()
     950
     951.. _HistExport:
     952
     953--------------------
     954Histogram Export
     955--------------------
     956
     957This example shows how to export a series of histograms from a collection of
     958.gpx (project) files. The Python ``glob()`` function is used to find all files
     959matching a wildcard in the specified directory (``dataloc``). For each file
     960there is a loop over histograms in that project and for each histogram
     961:meth:`G2PwdrData.Export` is called to write out the contents of that histogram
     962as CSV (comma-separated variable) file that contains data positions,
     963observed, computed and backgroun intensities as well as weighting for each
     964point and Q. Note that for the Export call, there is more than one choice of
     965exporter that can write ``.csv`` extension files, so the export hint must
     966be specified.
     967
     968.. code-block::  python
     969
     970    import os,sys,glob
     971    sys.path.insert(0,'/Users/toby/software/G2/GSASII')  # change this
     972    import GSASIIscriptable as G2sc
     973
     974    dataloc = "/Users/toby/Scratch/"                 # where to find data
     975    PathWrap = lambda fil: os.path.join(dataloc,fil) # EZ way 2 add dir to filename
     976
     977    for f in glob.glob(PathWrap('bkg*.gpx')):  # put filename prefix here
     978        print(f)
     979        gpx = G2sc.G2Project(f)
     980        for i,h in enumerate(gpx.histograms()):
     981            hfil = os.path.splitext(f)[0]+'_'+str(i) # file to write
     982            print('\t',h.name,hfil+'.csv')
     983            h.Export(hfil,'.csv','histogram CSV')
    950984
    951985.. _CommandlineInterface:
Note: See TracChangeset for help on using the changeset viewer.