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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Nov 30 10:13:16 PST 2016


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/a43ef2fb0790/
Changeset:   a43ef2fb0790
Branch:      yt
User:        chummels
Date:        2016-11-30 01:04:33+00:00
Summary:     Adding check for negative column densities in absorption spectrum with warning.
Affected #:  1 file

diff -r 0bfebdb21e22a03f91a11dff8d455ee17e885e92 -r a43ef2fb0790bd3d294d6116f2f735df4fa57cff 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


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