[yt-svn] commit/yt: ngoldbaum: Merged in chummels/yt (pull request #2450)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Nov 30 10:13:13 PST 2016
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/6b9446812391/
Changeset: 6b9446812391
Branch: yt
User: ngoldbaum
Date: 2016-11-30 18:12:47+00:00
Summary: Merged in chummels/yt (pull request #2450)
Adding check for negative column densities in absorption spectrum with warning.
Affected #: 1 file
diff -r 1c3b1ee859420671a78a52e0d964026f0be3a068 -r 6b9446812391efa134dc3d39266ea3cbd83422aa yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
--- a/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py
@@ -390,6 +390,9 @@
# and deposit the lines into the spectrum
for line in parallel_objects(self.line_list, njobs=njobs):
column_density = field_data[line['field_name']] * field_data['dl']
+ if (column_density < 0).any():
+ mylog.warn("Setting negative densities for field %s to 0! Bad!" % line['field_name'])
+ np.clip(column_density, 0, np.inf, out=column_density)
if (column_density == 0).all():
mylog.info("Not adding line %s: insufficient column density" % line['label'])
continue
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