[yt-svn] commit/yt: 8 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jan 19 08:54:22 PST 2017


8 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/d719d563de23/
Changeset:   d719d563de23
Branch:      yt
User:        c... at pingouin.local
Date:        2017-01-12 15:50:01+00:00
Summary:     [bugfix] ramses better detection of cosmo

A cosmological simulation is detected whenever the (conformal) time is < 0, hence a non-cosmological simulation has a time >= 0 but not > 0 (the first output is at t=0).
Affected #:  1 file

diff -r f0e3737e931b639bb75836a44ed42bb1477ab3e7 -r d719d563de23fd8c05217e5365ed55b0cd08adde yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -630,7 +630,7 @@
         # This is likely not true, but it's not clear how to determine the boundary conditions
         self.periodicity = (True, True, True)
         # These conditions seem to always be true for non-cosmological datasets
-        if rheader["time"] > 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
+        if rheader["time"] >= 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
             self.cosmological_simulation = 0
             self.current_redshift = 0
             self.hubble_constant = 0


https://bitbucket.org/yt_analysis/yt/commits/741de682fbb9/
Changeset:   741de682fbb9
Branch:      yt
User:        cphyc
Date:        2017-01-12 15:54:21+00:00
Summary:     [bugfix] RAMSES: detect correctly cosmo simulation

Cosmo simulation show their output time in conformal unit with t<0, so a non-cosmological
simulation has t>=0 (not t>0).
Affected #:  1 file

diff -r ec92132823b016f9056f53d166e7262bca2275a7 -r 741de682fbb9eeb5fd4ceedcc27860e626c71b2a yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -630,7 +630,7 @@
         # This is likely not true, but it's not clear how to determine the boundary conditions
         self.periodicity = (True, True, True)
         # These conditions seem to always be true for non-cosmological datasets
-        if rheader["time"] > 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
+        if rheader["time"] >= 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
             self.cosmological_simulation = 0
             self.current_redshift = 0
             self.hubble_constant = 0


https://bitbucket.org/yt_analysis/yt/commits/f40bf12ead72/
Changeset:   f40bf12ead72
Branch:      yt
User:        cphyc
Date:        2017-01-12 15:55:34+00:00
Summary:     Merge
Affected #:  0 files



https://bitbucket.org/yt_analysis/yt/commits/131cf4b77892/
Changeset:   131cf4b77892
Branch:      yt
User:        cphyc
Date:        2017-01-17 13:17:12+00:00
Summary:     Merged yt_analysis/yt into yt
Affected #:  1 file

diff -r f40bf12ead721282fff5ed68b7b8bf3e6cc3211c -r 131cf4b77892d16fd87ff198af8cf2ff18cd95fa yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1283,9 +1283,9 @@
     field_parameters : dictionary
          A dictionary of field parameters than can be accessed by derived
          fields.
-    data_source : YTSelectionContainer Object
-         Object to be used for data selection.  Defaults to a region covering
-         the entire simulation.
+    data_source: YTSelectionContainer object
+         Object to be used for data selection. Defaults to ds.all_data(), a 
+         region covering the full domain
 
     Examples
     --------
@@ -1460,6 +1460,9 @@
     field_parameters : dictionary
          A dictionary of field parameters than can be accessed by derived
          fields.
+    data_source: YTSelectionContainer object
+         Object to be used for data selection. Defaults to ds.all_data(), a 
+         region covering the full domain
 
     Examples
     --------
@@ -1587,8 +1590,8 @@
          A dictionary of field parameters than can be accessed by derived
          fields.
     data_source : YTSelectionContainer Object
-         Object to be used for data selection.  Defaults to a region covering
-         the entire simulation.
+         Object to be used for data selection.  Defaults ds.all_data(), a 
+         region covering the full domain.
     """
 
     _plot_type = 'OffAxisSlice'
@@ -1626,13 +1629,17 @@
     def __init__(self, center, ds, normal_vector, width, fields,
                  interpolated, resolution = (800,800), weight=None,
                  volume=None, no_ghost=False, le=None, re=None,
-                 north_vector=None, method="integrate"):
+                 north_vector=None, method="integrate",
+                 data_source=None):
         self.center = center
         self.ds = ds
         self.axis = 4 # always true for oblique data objects
         self.normal_vector = normal_vector
         self.width = width
-        self.dd = ds.all_data()
+        if data_source is None:
+            self.dd = ds.all_data()
+        else:
+            self.dd = data_source
         fields = self.dd._determine_fields(fields)
         self.fields = fields
         self.interpolated = interpolated
@@ -1737,6 +1744,9 @@
          just a straight summation of the field along the given axis. WARNING:
          This should only be used for uniform resolution grid datasets, as other
          datasets may result in unphysical images.
+    data_source: YTSelectionContainer object
+         Object to be used for data selection. Defaults to ds.all_data(), a 
+         region covering the full domain
     """
     _plot_type = 'OffAxisProjection'
     _frb_generator = OffAxisProjectionFixedResolutionBuffer
@@ -1745,7 +1755,8 @@
                  depth=(1, '1'), axes_unit=None, weight_field=None,
                  max_level=None, north_vector=None, right_handed=True,
                  volume=None, no_ghost=False, le=None, re=None,
-                 interpolated=False, fontsize=18, method="integrate"):
+                 interpolated=False, fontsize=18, method="integrate",
+                 data_source=None):
         (bounds, center_rot) = \
           get_oblique_window_parameters(normal,center,width,ds,depth=depth)
         fields = ensure_list(fields)[:]
@@ -1755,7 +1766,8 @@
         OffAxisProj = OffAxisProjectionDummyDataSource(
             center_rot, ds, normal, oap_width, fields, interpolated,
             weight=weight_field,  volume=volume, no_ghost=no_ghost,
-            le=le, re=re, north_vector=north_vector, method=method)
+            le=le, re=re, north_vector=north_vector, method=method,
+            data_source=data_source)
 
         validate_mesh_fields(OffAxisProj, fields)
 


https://bitbucket.org/yt_analysis/yt/commits/1e2f86e6e918/
Changeset:   1e2f86e6e918
Branch:      yt
User:        cphyc
Date:        2017-01-17 13:16:22+00:00
Summary:     Explicit unit of `cool´ field
Affected #:  1 file

diff -r b7b71a7c2e00c7a43b7e736a9111fe7d4051b7e8 -r 1e2f86e6e9186903047ac02c041c2b085dc30b50 yt/frontends/ramses/fields.py
--- a/yt/frontends/ramses/fields.py
+++ b/yt/frontends/ramses/fields.py
@@ -106,7 +106,7 @@
                 d = {'lognH': np.log10(_X*data["density"]/mh).ravel(),
                      'logT' : np.log10(data["temperature"]).ravel()}
                 rv = 10**interp_object(d).reshape(shape)
-                return rv
+                return data.ds.arr(rv, 'code_length**-3')
             self.add_field(name = name, sampling_type="cell", function=_func,
                                  units = "code_length**-3")
         avals = {}


https://bitbucket.org/yt_analysis/yt/commits/28d159374843/
Changeset:   28d159374843
Branch:      yt
User:        cphyc
Date:        2017-01-17 13:20:51+00:00
Summary:     Merge from yt_analysis/yt
Affected #:  1 file

diff -r 1e2f86e6e9186903047ac02c041c2b085dc30b50 -r 28d1593748433f4c650ebc915771d2ba09055f7b yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -630,7 +630,7 @@
         # This is likely not true, but it's not clear how to determine the boundary conditions
         self.periodicity = (True, True, True)
         # These conditions seem to always be true for non-cosmological datasets
-        if rheader["time"] > 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
+        if rheader["time"] >= 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
             self.cosmological_simulation = 0
             self.current_redshift = 0
             self.hubble_constant = 0


https://bitbucket.org/yt_analysis/yt/commits/5046ee3670b4/
Changeset:   5046ee3670b4
Branch:      yt
User:        cphyc
Date:        2017-01-19 13:42:39+00:00
Summary:     Add comment about unit
Affected #:  1 file

diff -r 28d1593748433f4c650ebc915771d2ba09055f7b -r 5046ee3670b4edaa23293b5580fa8a442cdb00a0 yt/frontends/ramses/fields.py
--- a/yt/frontends/ramses/fields.py
+++ b/yt/frontends/ramses/fields.py
@@ -106,6 +106,7 @@
                 d = {'lognH': np.log10(_X*data["density"]/mh).ravel(),
                      'logT' : np.log10(data["temperature"]).ravel()}
                 rv = 10**interp_object(d).reshape(shape)
+                # Return array in unit 'per volume' consistently with line below
                 return data.ds.arr(rv, 'code_length**-3')
             self.add_field(name = name, sampling_type="cell", function=_func,
                                  units = "code_length**-3")


https://bitbucket.org/yt_analysis/yt/commits/f00742795e09/
Changeset:   f00742795e09
Branch:      yt
User:        ngoldbaum
Date:        2017-01-19 16:53:52+00:00
Summary:     Merged in cphyc/yt (pull request #2491)

[bugfix] RAMSES detect correctly cosmo simulation
Affected #:  2 files

diff -r 771123590278f97c40911a6bc318174de90cdd0e -r f00742795e0970ba78ded9ea01644a6a40821b13 yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -630,7 +630,7 @@
         # This is likely not true, but it's not clear how to determine the boundary conditions
         self.periodicity = (True, True, True)
         # These conditions seem to always be true for non-cosmological datasets
-        if rheader["time"] > 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
+        if rheader["time"] >= 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
             self.cosmological_simulation = 0
             self.current_redshift = 0
             self.hubble_constant = 0

diff -r 771123590278f97c40911a6bc318174de90cdd0e -r f00742795e0970ba78ded9ea01644a6a40821b13 yt/frontends/ramses/fields.py
--- a/yt/frontends/ramses/fields.py
+++ b/yt/frontends/ramses/fields.py
@@ -106,7 +106,8 @@
                 d = {'lognH': np.log10(_X*data["density"]/mh).ravel(),
                      'logT' : np.log10(data["temperature"]).ravel()}
                 rv = 10**interp_object(d).reshape(shape)
-                return rv
+                # Return array in unit 'per volume' consistently with line below
+                return data.ds.arr(rv, 'code_length**-3')
             self.add_field(name = name, sampling_type="cell", function=_func,
                                  units = "code_length**-3")
         avals = {}

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