1 | # ---------------------------------------------------------------------- |
---|
2 | # EXAMPLE: Rappture <group> attributes |
---|
3 | # ====================================================================== |
---|
4 | # AUTHOR: Martin Hunt, Purdue University |
---|
5 | # Copyright (c) 2015 HUBzero Foundation, LLC |
---|
6 | # |
---|
7 | # See the file "license.terms" for information on usage and |
---|
8 | # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
9 | # ====================================================================== |
---|
10 | |
---|
11 | import Rappture |
---|
12 | import sys |
---|
13 | |
---|
14 | # uncomment these for debugging |
---|
15 | # sys.stdout = open('group.out', 'w') |
---|
16 | # sys.stderr = open('group.err', 'w') |
---|
17 | |
---|
18 | # open the XML file containing the run parameters |
---|
19 | rx = Rappture.PyXml(sys.argv[1]) |
---|
20 | |
---|
21 | re = rx['input.group.(models).(recomb).current'].value |
---|
22 | tn = rx['input.group.(models).(tau).(taun).current'].value |
---|
23 | tp = rx['input.group.(models).(tau).(taup).current'].value |
---|
24 | |
---|
25 | temp = rx['input.group.(ambient).(temp).current'].value |
---|
26 | lat = rx['input.group.(ambient).(loc).(lat).current'].value |
---|
27 | lon = rx['input.group.(ambient).(loc).(long).current'].value |
---|
28 | |
---|
29 | rx['output.log'] = """Models: |
---|
30 | Recombination: %s |
---|
31 | taun = %s |
---|
32 | taup = %s |
---|
33 | |
---|
34 | Ambient: |
---|
35 | tempK = %s |
---|
36 | lat, long = (%s, %s) |
---|
37 | """ % (re, tn, tp, temp, lat, lon) |
---|
38 | |
---|
39 | # save the updated XML describing the run... |
---|
40 | rx.close() |
---|