Last change
on this file since 3209 was
3209,
checked in by toby, 5 years ago
|
Add simulation to scriptable & add to tutorial; add sphinx index to ctrlsGUI; remove path from RunGSASII.bat
|
-
Property svn:eol-style set to
native
|
File size:
1.0 KB
|
Rev | Line | |
---|
[3209] | 1 | '''Sample script to demonstrate use of GSASIIscriptable to simulate a powder pattern |
---|
| 2 | |
---|
| 3 | This script is described in this tutorial: |
---|
| 4 | https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/PythonScript/Scripting.htm |
---|
| 5 | ''' |
---|
| 6 | |
---|
| 7 | import os,sys |
---|
| 8 | sys.path.insert(0,'/Users/toby/software/G2/GSASII') |
---|
| 9 | import GSASIIscriptable as G2sc |
---|
| 10 | |
---|
| 11 | workdir = "/Users/toby/Scratch/PythonScript" |
---|
| 12 | datadir = "/Users/toby/software/G2/Tutorials/PythonScript/data" |
---|
| 13 | |
---|
| 14 | gpx = G2sc.G2Project(filename='PbSO4sim.gpx') # create a project |
---|
| 15 | |
---|
| 16 | # setup step 1: add a phase to the project |
---|
| 17 | phase0 = gpx.add_phase(os.path.join(datadir,"PbSO4-Wyckoff.cif"), |
---|
| 18 | phasename="PbSO4",fmthint='CIF') |
---|
| 19 | |
---|
| 20 | # setup step 2: add a simulated histogram and link it to the previous phase(s) |
---|
| 21 | hist1 = gpx.add_simulated_powder_histogram("PbSO4 simulation", |
---|
| 22 | os.path.join(datadir,"inst_d1a.prm"), |
---|
| 23 | 5.,120.,0.01, |
---|
| 24 | phases=gpx.phases()) |
---|
| 25 | gpx.data['Controls']['data']['max cyc'] = 0 # refinement not needed |
---|
| 26 | gpx.do_refinements([{}]) |
---|
| 27 | gpx.save() |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | |
---|
Note: See
TracBrowser
for help on using the repository browser.