- Timestamp:
- Feb 24, 2020 4:38:19 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIobj.py
r4326 r4327 173 173 \ BondRadii (list of floats) Default radius for each atom used to compute 174 174 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`) 180 182 \ Color (list of (r,b,g) triplets) Colors for atoms 181 183 \ Compare (dict) Polygon comparison parameters -
trunk/GSASIIscriptable.py
r4326 r4327 948 948 img.saveControls(os.path.splitext(img.name)[0]+'.imctrl') 949 949 gpx.save() 950 951 .. _HistExport: 952 953 -------------------- 954 Histogram Export 955 -------------------- 956 957 This 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 959 matching a wildcard in the specified directory (``dataloc``). For each file 960 there 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 962 as CSV (comma-separated variable) file that contains data positions, 963 observed, computed and backgroun intensities as well as weighting for each 964 point and Q. Note that for the Export call, there is more than one choice of 965 exporter that can write ``.csv`` extension files, so the export hint must 966 be 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') 950 984 951 985 .. _CommandlineInterface:
Note: See TracChangeset
for help on using the changeset viewer.