[yt-svn] commit/yt: bwkeller: Merged in chummels/yt (pull request #1880)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Nov 23 11:10:32 PST 2015
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/903268eb8d71/
Changeset: 903268eb8d71
Branch: yt
User: bwkeller
Date: 2015-11-23 19:10:26+00:00
Summary: Merged in chummels/yt (pull request #1880)
Adding mask to LightRay to assure output elements have non-zero density (a problem in some SPH datasets).
Affected #: 1 file
diff -r 25030d46ee18f7000c1d1199fbd78a678c9c3b99 -r 903268eb8d717ff3af3fc5acd7634f5db854a1b4 yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
--- a/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
+++ b/yt/analysis_modules/cosmological_observation/light_ray/light_ray.py
@@ -544,6 +544,11 @@
self.cosmology.t_from_z(ds["current_redshift"])
extra_attrs = {"data_type": "yt_light_ray"}
field_types = dict([(field, "grid") for field in data.keys()])
+ # Only return LightRay elements with non-zero density
+ if 'density' in data:
+ mask = data['density'] > 0
+ for key in data.keys():
+ data[key] = data[key][mask]
save_as_dataset(ds, filename, data, field_types=field_types,
extra_attrs=extra_attrs)
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