[yt-svn] commit/yt: ngoldbaum: Do not use logarithmic colorbar scaling if data is filled with NaNs.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Jun 24 09:54:56 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/9d49401f21e7/
Changeset: 9d49401f21e7
Branch: yt-3.0
User: ngoldbaum
Date: 2014-06-24 00:18:01
Summary: Do not use logarithmic colorbar scaling if data is filled with NaNs.
Affected #: 1 file
diff -r 90a72476866588cb0f92183e4f63daaef4f729ea -r 9d49401f21e703885835e9c01ff7295bdafadc85 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -805,12 +805,14 @@
msg = None
if zlim != (None, None):
pass
- elif image.max() == image.min():
+ elif np.nanmax(image) == np.nanmin(image):
msg = "Plot image for field %s has zero dynamic " \
- "range. Min = Max = %d." % (f, image.max())
- elif image.max() <= 0:
+ "range. Min = Max = %d." % (f, np.nanmax(image))
+ elif np.nanmax(image) <= 0:
msg = "Plot image for field %s has no positive " \
- "values. Max = %d." % (f, image.max())
+ "values. Max = %d." % (f, np.nanmax(image))
+ elif np.all(np.isfinite(image)):
+ msg = "Plot image for field %s is filled with NaNs." % (f,)
if msg is not None:
mylog.warning(msg)
mylog.warning("Switching to linear colorbar scaling.")
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