[yt-svn] commit/yt: chummels: Merged in RicardaBeckmann/yt (pull request #1610)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Jul 16 10:08:54 PDT 2015
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/989be30f7b70/
Changeset: 989be30f7b70
Branch: yt
User: chummels
Date: 2015-07-16 17:08:41+00:00
Summary: Merged in RicardaBeckmann/yt (pull request #1610)
Updating units for ramses runs when boxlength matters
Affected #: 2 files
diff -r 7709f96fe34aabce6ade8b00bac40e866d218c08 -r 989be30f7b70fc8e144581d1882c1dac913b25f9 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -11,6 +11,7 @@
yt/analysis_modules/halo_finding/rockstar/rockstar_interface.c
yt/analysis_modules/ppv_cube/ppv_utils.c
yt/frontends/ramses/_ramses_reader.cpp
+yt/frontends/sph/smoothing_kernel.c
yt/geometry/fake_octree.c
yt/geometry/grid_container.c
yt/geometry/grid_visitors.c
@@ -40,6 +41,7 @@
yt/utilities/lib/mesh_utilities.c
yt/utilities/lib/misc_utilities.c
yt/utilities/lib/Octree.c
+yt/utilities/lib/GridTree.c
yt/utilities/lib/origami.c
yt/utilities/lib/pixelization_routines.c
yt/utilities/lib/png_writer.c
diff -r 7709f96fe34aabce6ade8b00bac40e866d218c08 -r 989be30f7b70fc8e144581d1882c1dac913b25f9 yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -491,13 +491,22 @@
"""
Generates the conversion to various physical _units based on the parameter file
"""
- # Note that unit_l *already* converts to proper!
- # Also note that unit_l must be multiplied by the boxlen parameter to
- # ensure we are correctly set up for the current domain.
- length_unit = self.parameters['unit_l']
- boxlen = self.parameters['boxlen']
- density_unit = self.parameters['unit_d']
- mass_unit = density_unit * (length_unit * boxlen)**3
+ #Please note that for all units given in the info file, the boxlen
+ #still needs to be folded in, as shown below!
+
+ boxlen=self.parameters['boxlen']
+ length_unit = self.parameters['unit_l'] * boxlen
+ density_unit = self.parameters['unit_d']/ boxlen**3
+
+ # In the mass unit, the factors of boxlen cancel back out, so this
+ #is equivalent to unit_d*unit_l**3
+
+ mass_unit = density_unit * length_unit**3
+
+ # Cosmological runs are done in lookback conformal time.
+ # To convert to proper time, the time unit is calculated from
+ # the expansion factor. This is not yet done here!
+
time_unit = self.parameters['unit_t']
magnetic_unit = np.sqrt(4*np.pi * mass_unit /
(time_unit**2 * length_unit))
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