[Yt-svn] yt: added pf["Time"] to Orion. yt stats now works properly for O...
hg at spacepope.org
hg at spacepope.org
Thu Jun 3 17:59:41 PDT 2010
hg Repository: yt
details: yt/rev/6064b1b160ea
changeset: 1728:6064b1b160ea
user: J.S. Oishi <jsoishi at gmail.com>
date:
Thu Jun 03 17:59:33 2010 -0700
description:
added pf["Time"] to Orion. yt stats now works properly for Orion data.
diffstat:
yt/lagos/OutputTypes.py | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r d74f191d9663 -r 6064b1b160ea yt/lagos/OutputTypes.py
--- a/yt/lagos/OutputTypes.py Thu Jun 03 15:23:06 2010 -0700
+++ b/yt/lagos/OutputTypes.py Thu Jun 03 17:59:33 2010 -0700
@@ -487,9 +487,8 @@
StaticOutput.__init__(self, plotname.rstrip("/"),
data_style='orion_native')
self.field_info = self._fieldinfo_class()
+ self._parse_header_file()
- # self.directory is the directory ENCLOSING the pltNNNN directory
-
# These should maybe not be hardcoded?
self.parameters["HydroMethod"] = 'orion' # always PPM DE
self.parameters["InitialTime"] = 0. # FIX ME!!!
@@ -574,7 +573,21 @@
self.fparameters[param] = t[0]
else:
self.fparameters[param] = t
-
+
+ def _parse_header_file(self):
+ """
+ Parses the BoxLib header file to get any parameters stored
+ there. Hierarchy information is read out of this file in
+ OrionHierarchy.
+
+ Currently, only Time is read here.
+ """
+ header_file = open(os.path.join(self.fullplotdir,'Header'))
+ lines = header_file.readlines()
+ header_file.close()
+ n_fields = int(lines[1])
+ self.parameters["Time"] = float(lines[3+n_fields])
+
def _set_units(self):
"""
More information about the yt-svn
mailing list