[yt-svn] commit/yt: xarthisius: Make sure that {xyz}_field's units match bins' units during profile creation

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jul 21 08:45:54 PDT 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/dda861e88caf/
Changeset:   dda861e88caf
Branch:      yt
User:        xarthisius
Date:        2016-07-21 14:54:26+00:00
Summary:     Make sure that {xyz}_field's units match bins' units during profile creation
Affected #:  1 file

diff -r 1f83a250683eb8980e246c964f616814364f68b2 -r dda861e88caf4443bf2713470cbe2964a283e565 yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -429,6 +429,7 @@
         rv = self._get_data(chunk, fields)
         if rv is None: return
         fdata, wdata, (bf_x,) = rv
+        bf_x.convert_to_units(self.field_info[self.x_field].output_units)
         bin_ind = np.digitize(bf_x, self.x_bins) - 1
         new_bin_profile1d(bin_ind, wdata, fdata,
                       storage.weight_values, storage.values,
@@ -534,7 +535,9 @@
         rv = self._get_data(chunk, fields)
         if rv is None: return
         fdata, wdata, (bf_x, bf_y) = rv
+        bf_x.convert_to_units(self.field_info[self.x_field].output_units)
         bin_ind_x = np.digitize(bf_x, self.x_bins) - 1
+        bf_y.convert_to_units(self.field_info[self.y_field].output_units)
         bin_ind_y = np.digitize(bf_y, self.y_bins) - 1
         new_bin_profile2d(bin_ind_x, bin_ind_y, wdata, fdata,
                       storage.weight_values, storage.values,
@@ -796,8 +799,11 @@
         rv = self._get_data(chunk, fields)
         if rv is None: return
         fdata, wdata, (bf_x, bf_y, bf_z) = rv
+        bf_x.convert_to_units(self.field_info[self.x_field].output_units)
         bin_ind_x = np.digitize(bf_x, self.x_bins) - 1
+        bf_y.convert_to_units(self.field_info[self.y_field].output_units)
         bin_ind_y = np.digitize(bf_y, self.y_bins) - 1
+        bf_z.convert_to_units(self.field_info[self.z_field].output_units)
         bin_ind_z = np.digitize(bf_z, self.z_bins) - 1
         new_bin_profile3d(bin_ind_x, bin_ind_y, bin_ind_z, wdata, fdata,
                       storage.weight_values, storage.values,

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