[yt-svn] commit/yt-3.0: 4 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Jul 15 08:52:06 PDT 2013


4 new commits in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/405f1633aafa/
Changeset:   405f1633aafa
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-07-05 16:54:57
Summary:     Adding boxlen to RAMSES units for mass and length.
Affected #:  1 file

diff -r 3deb823bc6b8beb1cfdaec903d7aa93759c2aa7a -r 405f1633aafae077ee8984a1e71357831ac02943 yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -393,11 +393,16 @@
         self.conversion_factors["y-velocity"] = vel_u
         self.conversion_factors["z-velocity"] = vel_u
         # Necessary to get the length units in, which are needed for Mass
-        self.conversion_factors['mass'] = rho_u * self.parameters['unit_l']**3
+        # We also have to multiply by the boxlength here to scale into our
+        # domain.
+        self.conversion_factors['mass'] = rho_u * \
+                self.parameters['unit_l']**3 * self.parameters['boxlen']
 
     def _setup_nounits_units(self):
         # Note that unit_l *already* converts to proper!
-        unit_l = self.parameters['unit_l']
+        # Also note that unit_l must be multiplied by the boxlen parameter to
+        # ensure we are correctly set up for the current domain.
+        unit_l = self.parameters['unit_l'] * self.parameters['boxlen']
         for unit in mpc_conversion.keys():
             self.units[unit] = unit_l * mpc_conversion[unit] / mpc_conversion["cm"]
             self.units['%sh' % unit] = self.units[unit] * self.hubble_constant


https://bitbucket.org/yt_analysis/yt-3.0/commits/dfdb820a7883/
Changeset:   dfdb820a7883
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-07-05 17:06:56
Summary:     Adding parenthesis for the mass factor.  Now (unit_l*boxlen)**3
Affected #:  1 file

diff -r 405f1633aafae077ee8984a1e71357831ac02943 -r dfdb820a788336a926ce25d1d686cbb304dc3066 yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -396,7 +396,7 @@
         # We also have to multiply by the boxlength here to scale into our
         # domain.
         self.conversion_factors['mass'] = rho_u * \
-                self.parameters['unit_l']**3 * self.parameters['boxlen']
+                (self.parameters['unit_l'] * self.parameters['boxlen'])**3
 
     def _setup_nounits_units(self):
         # Note that unit_l *already* converts to proper!


https://bitbucket.org/yt_analysis/yt-3.0/commits/b5581f3cf4fc/
Changeset:   b5581f3cf4fc
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-07-15 17:51:09
Summary:     Re-scaling particles to Oct domain and removing boxlen from particle_mass.
Affected #:  2 files

diff -r dfdb820a788336a926ce25d1d686cbb304dc3066 -r b5581f3cf4fcceabc4de41c198123fcd3dd784af yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -395,8 +395,7 @@
         # Necessary to get the length units in, which are needed for Mass
         # We also have to multiply by the boxlength here to scale into our
         # domain.
-        self.conversion_factors['mass'] = rho_u * \
-                (self.parameters['unit_l'] * self.parameters['boxlen'])**3
+        self.conversion_factors['mass'] = rho_u * self.parameters['unit_l']**3
 
     def _setup_nounits_units(self):
         # Note that unit_l *already* converts to proper!

diff -r dfdb820a788336a926ce25d1d686cbb304dc3066 -r b5581f3cf4fcceabc4de41c198123fcd3dd784af yt/frontends/ramses/io.py
--- a/yt/frontends/ramses/io.py
+++ b/yt/frontends/ramses/io.py
@@ -98,9 +98,13 @@
         f = open(subset.domain.part_fn, "rb")
         foffsets = subset.domain.particle_field_offsets
         tr = {}
-        #for field in sorted(fields, key=lambda a:foffsets[a]):
+        # We do *all* conversion into boxlen here.
+        # This means that no other conversions need to be applied to convert
+        # positions into the same domain as the octs themselves.
         for field in fields:
             f.seek(foffsets[field])
             dt = subset.domain.particle_field_types[field]
             tr[field] = fpu.read_vector(f, dt)
+            if field[1].startswith("particle_position"):
+                np.divide(tr[field], subset.domain.pf["boxlen"], tr[field])
         return tr


https://bitbucket.org/yt_analysis/yt-3.0/commits/44637ca2b97b/
Changeset:   44637ca2b97b
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-07-15 17:52:00
Summary:     Merged in MatthewTurk/yt-3.0 (pull request #62)

Adding boxlen to RAMSES units for mass and length.
Affected #:  2 files

diff -r a77773aebadb654bddb92def2556d997724a4622 -r 44637ca2b97b0a33b3986163ed4f1bfa7d3a3cbf yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -395,11 +395,15 @@
         self.conversion_factors["y-velocity"] = vel_u
         self.conversion_factors["z-velocity"] = vel_u
         # Necessary to get the length units in, which are needed for Mass
+        # We also have to multiply by the boxlength here to scale into our
+        # domain.
         self.conversion_factors['mass'] = rho_u * self.parameters['unit_l']**3
 
     def _setup_nounits_units(self):
         # Note that unit_l *already* converts to proper!
-        unit_l = self.parameters['unit_l']
+        # Also note that unit_l must be multiplied by the boxlen parameter to
+        # ensure we are correctly set up for the current domain.
+        unit_l = self.parameters['unit_l'] * self.parameters['boxlen']
         for unit in mpc_conversion.keys():
             self.units[unit] = unit_l * mpc_conversion[unit] / mpc_conversion["cm"]
             self.units['%sh' % unit] = self.units[unit] * self.hubble_constant

diff -r a77773aebadb654bddb92def2556d997724a4622 -r 44637ca2b97b0a33b3986163ed4f1bfa7d3a3cbf yt/frontends/ramses/io.py
--- a/yt/frontends/ramses/io.py
+++ b/yt/frontends/ramses/io.py
@@ -98,9 +98,13 @@
         f = open(subset.domain.part_fn, "rb")
         foffsets = subset.domain.particle_field_offsets
         tr = {}
-        #for field in sorted(fields, key=lambda a:foffsets[a]):
+        # We do *all* conversion into boxlen here.
+        # This means that no other conversions need to be applied to convert
+        # positions into the same domain as the octs themselves.
         for field in fields:
             f.seek(foffsets[field])
             dt = subset.domain.particle_field_types[field]
             tr[field] = fpu.read_vector(f, dt)
+            if field[1].startswith("particle_position"):
+                np.divide(tr[field], subset.domain.pf["boxlen"], tr[field])
         return tr

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

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