[yt-svn] commit/yt: xarthisius: Merged in jzuhone/yt-3.x/yt-3.0 (pull request #1003)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Jul 10 00:08:23 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/cbc8aad03100/
Changeset: cbc8aad03100
Branch: yt-3.0
User: xarthisius
Date: 2014-07-10 09:08:15
Summary: Merged in jzuhone/yt-3.x/yt-3.0 (pull request #1003)
FLASH magnetic field units are incorrect
Affected #: 1 file
diff -r c6b09204f3e728a7d3611ffc16a962ad037ddbee -r cbc8aad0310012de974ce8f194f18b48cd82073a yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -210,9 +210,9 @@
self.parameters["Time"] = 1. # default unit is 1...
def _set_code_unit_attributes(self):
- if "cgs" in (self.parameters.get('pc_unitsbase', "").lower(),
- self.parameters.get('unitsystem', "").lower()):
- b_factor = 1
+
+ if self['unitsystem'].lower() == "cgs":
+ b_factor = 1.0
elif self['unitsystem'].lower() == "si":
b_factor = np.sqrt(4*np.pi/1e7)
elif self['unitsystem'].lower() == "none":
@@ -227,6 +227,7 @@
length_factor = 1.0
temperature_factor = 1.0
self.magnetic_unit = self.quan(b_factor, "gauss")
+
self.length_unit = self.quan(length_factor, "cm")
self.mass_unit = self.quan(1.0, "g")
self.time_unit = self.quan(1.0, "s")
@@ -234,7 +235,8 @@
self.temperature_unit = self.quan(temperature_factor, "K")
# Still need to deal with:
#self.conversion_factors['temp'] = (1.0 + self.current_redshift)**-2.0
-
+ self.unit_registry.modify("code_magnetic", self.magnetic_unit)
+
def set_code_units(self):
super(FLASHDataset, self).set_code_units()
self.unit_registry.modify("code_temperature",
@@ -247,9 +249,9 @@
for tpname, pval in zip(self._handle[nn][:,'name'],
self._handle[nn][:,'value']):
if tpname.strip() == pname:
- if ptype == "string" :
+ if ptype == "string":
return pval.strip()
- else :
+ else:
return pval
raise KeyError(pname)
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list