source: Tutorials/PythonScript/data/example.json @ 3207

Last change on this file since 3207 was 3207, checked in by toby, 5 years ago

New command-line tutorial

File size: 1.6 KB
Line 
1{"refinements": 
2  [
3    {"skip":true, "call":"SetParams"},
4    { "set": {"Background": {"no. coeffs": 3, "refine": true}}, 
5      "call":"HistStats", "output": "step4.gpx"}, 
6    { "set": {"Cell": true}, "call":"HistStats", "output": "step5.gpx"}, 
7    { "set": {"HStrain": true}, 
8      "histograms": [0], "phases": [0], "call":"HistStats", "output": "step6.gpx"}, 
9    { "set": {"Mustrain": {"type": "isotropic", "refine": true}, 
10             "Size": {"type": "isotropic", "refine": true}}, 
11      "histograms": [0], "call":"HistStats", "output": "step7.gpx"}, 
12    { "set": {"Sample Parameters": ["Shift"]}, 
13      "histograms": [0], "skip": true}, 
14    { "set": {"Atoms": {"all": "XU"}, 
15             "Sample Parameters": ["DisplaceX", "DisplaceY"]}, 
16      "histograms": [1], "call":"HistStats", "output": "step8.gpx"}, 
17    { "set": {"Limits": [16.0, 158.4]}, 
18      "histograms": [0], "skip": true}, 
19    { "set": {"Limits": [19.0, 153.0]}, 
20      "histograms": [1], "skip": true}, 
21    { "set": {"Instrument Parameters": ["U", "V", "W"]}, 
22      "call":"HistStats", "output": "step9.gpx"}
23  ],
24"code":
25  ["global HistStats",
26   "def HistStats(gpx):",
27   "    '''prints profile rfactors for all histograms'''",
28   "    print(u'*** profile Rwp, '+os.path.split(gpx.filename)[1])",
29   "    for hist in gpx.histograms():",
30   "        print('\t{:20s}: {:.2f}'.format(hist.name,hist.get_wR()))",
31   "    print()",
32   "global SetParams",
33   "def SetParams(proj): print('SetParams')",
34   "proj.data['Controls']['data']['max cyc'] = 8 # not in API",
35   "proj.histogram(1).data['Sample Parameters']['Gonio. radius'] = 650. # not in API"
36  ]
37}
Note: See TracBrowser for help on using the repository browser.