[Yt-svn] yt-commit r393 - trunk/yt/lagos

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Mon Apr 7 14:16:28 PDT 2008


Author: mturk
Date: Mon Apr  7 14:16:25 2008
New Revision: 393
URL: http://yt.spacepope.org/changeset/393

Log:
Changed 'unitList' to 'mpc_conversion' to more accurately reflect what it
*does*.  Also moved the rate information to EnzoRateData.py.



Modified:
   trunk/yt/lagos/ClusterFiles.py
   trunk/yt/lagos/EnzoDefs.py
   trunk/yt/lagos/EnzoRateData.py
   trunk/yt/lagos/OutputTypes.py

Modified: trunk/yt/lagos/ClusterFiles.py
==============================================================================
--- trunk/yt/lagos/ClusterFiles.py	(original)
+++ trunk/yt/lagos/ClusterFiles.py	Mon Apr  7 14:16:25 2008
@@ -203,11 +203,11 @@
 CFfieldInfo["TurbMach"] = (cfTurbMach, r"$\rm{Turbulent Mach Number}$", False)
 
 def cfRAU(self):
-    return self["r"] * unitList["au"]
+    return self["r"] * mpc_conversion["au"]
 CFfieldInfo["RAU"] = (cfRAU, r"$R (\rm{AU})$", True)
 
 def cfRpc(self):
-    return self["r"] * unitList["pc"]
+    return self["r"] * mpc_conversion["pc"]
 CFfieldInfo["Rpc"] = (cfRpc, r"$R (\rm{pc})$", True)
 
 def cfRhoCGS(self):

Modified: trunk/yt/lagos/EnzoDefs.py
==============================================================================
--- trunk/yt/lagos/EnzoDefs.py	(original)
+++ trunk/yt/lagos/EnzoDefs.py	Mon Apr  7 14:16:25 2008
@@ -33,6 +33,7 @@
 
 axis_labels = [('y','z'),('x','z'),('x','y')]
 axis_names = {0: 'x', 1: 'y', 2: 'z', 4:''}
+inv_axis_names = {'x':0,'y':1,'z':2}
 
 vm_axis_names = {0:'x', 1:'y', 2:'z', 3:'dx', 4:'dy'}
 
@@ -70,32 +71,12 @@
                  "TopGridRank": int,
                 }
 
-unitList = {'mpc'   : 1e0,
-            'kpc'   : 1e3,
-            'pc'    : 1e6,
-            'au'    : 2.063e11,
-            'rsun'  : 2.2167e13,
-            'cm'    : 3.0857e24,
-            'miles' : 1.917e19}
+mpc_conversion = {'mpc'   : 1e0,
+                  'kpc'   : 1e3,
+                  'pc'    : 1e6,
+                  'au'    : 2.063e11,
+                  'rsun'  : 2.2167e13,
+                  'cm'    : 3.0857e24,
+                  'miles' : 1.917e19}
 
 axis_labels = [('y','z'),('x','z'),('x','y')]
-
-rates_out_key = \
-      [ "tgas", \
-        "k1", "k2", "k3", "k4", "k5", "k6", "k7", "k8", "k9", "k10", "k11",  \
-        "k12", "k13", "k14", "k15", "k16", "k17", "k18", "k19", "k21", "k22",\
-        "k23", "k50", "k51", "k52", "k53", "k54", "k55", "k56", \
-        "k13_1", "k13_2", "k13_3", "k13_4", "k13_5", "k13_6", "k13_7"         ]
-
-cool_out_key = \
-      [ "tgas", \
-        "ceHI", "ceHeI", "ceHeII", "ciHI", "ciHeI", "ciHeIS", "ciHeII",\
-        "reHII", "reHeII1", "reHeII2", "reHeIII", "brem", "comp", \
-        "gphdl", "gpldl", "cieco", "vibh", "hyd01k", "rotl", "roth", \
-        "h2k01", "hdlte", "hdlow", "hdc_1", "hdc_2", "hdc_3", "hdc_4", \
-        "hdc_5"]
-
-# Note that we default to CellMass as the weight
-
-field_weights = \
-    {"CellMass" : -999}

Modified: trunk/yt/lagos/EnzoRateData.py
==============================================================================
--- trunk/yt/lagos/EnzoRateData.py	(original)
+++ trunk/yt/lagos/EnzoRateData.py	Mon Apr  7 14:16:25 2008
@@ -25,6 +25,21 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 """
 
+rates_out_key = \
+      [ "tgas", \
+        "k1", "k2", "k3", "k4", "k5", "k6", "k7", "k8", "k9", "k10", "k11",  \
+        "k12", "k13", "k14", "k15", "k16", "k17", "k18", "k19", "k21", "k22",\
+        "k23", "k50", "k51", "k52", "k53", "k54", "k55", "k56", \
+        "k13_1", "k13_2", "k13_3", "k13_4", "k13_5", "k13_6", "k13_7"         ]
+
+cool_out_key = \
+      [ "tgas", \
+        "ceHI", "ceHeI", "ceHeII", "ciHI", "ciHeI", "ciHeIS", "ciHeII",\
+        "reHII", "reHeII1", "reHeII2", "reHeIII", "brem", "comp", \
+        "gphdl", "gpldl", "cieco", "vibh", "hyd01k", "rotl", "roth", \
+        "h2k01", "hdlte", "hdlow", "hdc_1", "hdc_2", "hdc_3", "hdc_4", \
+        "hdc_5"]
+
 from yt.lagos import *
 #from numarray import *
 #import numarray.nd_image as nd

Modified: trunk/yt/lagos/OutputTypes.py
==============================================================================
--- trunk/yt/lagos/OutputTypes.py	(original)
+++ trunk/yt/lagos/OutputTypes.py	Mon Apr  7 14:16:25 2008
@@ -184,18 +184,18 @@
         if not self.has_key("Time"):
             LengthUnit = 3.086e24 * box_proper
             self.conversion_factors["Time"] = LengthUnit / self["x-velocity"]
-        for unit in unitList.keys():
-            self.units[unit] = unitList[unit] * box_proper
-            self.units[unit+'h'] = unitList[unit] * box_proper * h
-            self.units[unit+'hcm'] = unitList[unit] * boxcm_cal
+        for unit in mpc_conversion:
+            self.units[unit] = mpc_conversion[unit] * box_proper
+            self.units[unit+'h'] = mpc_conversion[unit] * box_proper * h
+            self.units[unit+'hcm'] = mpc_conversion[unit] * boxcm_cal
 
     def __setup_getunits_units(self):
         # We are given LengthUnits, which is number of cm per box length
         # So we convert that to box-size in Mpc
         box_proper = 3.24077e-25 * self["LengthUnits"]
         self.units['aye']  = 1.0
-        for unit in unitList.keys():
-            self.units[unit] = unitList[unit] * box_proper
+        for unit in mpc_conversion.keys():
+            self.units[unit] = mpc_conversion[unit] * box_proper
 
     def __setup_nounits_units(self):
         z = 0
@@ -205,8 +205,8 @@
         if not self.has_key("TimeUnits"):
             mylog.warning("No time units.  Setting 1.0 = 1 second.")
             self.conversion_factors["Time"] = 1.0
-        for unit in unitList.keys():
-            self.units[unit] = unitList[unit] * box_proper
+        for unit in mpc_conversion.keys():
+            self.units[unit] = mpc_conversion[unit] * box_proper
 
     def _get_hierarchy(self):
         if self.__hierarchy == None:



More information about the yt-svn mailing list