source: trunk/examples/zoo/group/group.py

Last change on this file was 6021, checked in by ldelgass, 8 years ago

Merge UQ and fixes from 1.4 branch

File size: 1.2 KB
Line 
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
11import Rappture
12import 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
19rx = Rappture.PyXml(sys.argv[1])
20
21re = rx['input.group.(models).(recomb).current'].value
22tn = rx['input.group.(models).(tau).(taun).current'].value
23tp = rx['input.group.(models).(tau).(taup).current'].value
24
25temp = rx['input.group.(ambient).(temp).current'].value
26lat = rx['input.group.(ambient).(loc).(lat).current'].value
27lon = rx['input.group.(ambient).(loc).(long).current'].value
28
29rx['output.log'] = """Models:
30  Recombination: %s
31  taun = %s
32  taup = %s
33
34Ambient:
35  tempK = %s
36  lat, long = (%s, %s)
37""" % (re, tn, tp, temp, lat, lon)
38
39# save the updated XML describing the run...
40rx.close()
Note: See TracBrowser for help on using the repository browser.