From b66cbe130207c41cb4746b038891c13adf6f0474 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@8a9318a1-56ba-4d59-b755-99d26321be01> Date: Tue, 25 Aug 2009 19:08:47 +0000 Subject: [PATCH] adding a check for valid bounding axes before attempting to plot git-svn-id: https://svn.ssec.wisc.edu/repos/glance/trunk@67 8a9318a1-56ba-4d59-b755-99d26321be01 --- pyglance/glance/plot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyglance/glance/plot.py b/pyglance/glance/plot.py index 49f929c..49cf3da 100644 --- a/pyglance/glance/plot.py +++ b/pyglance/glance/plot.py @@ -448,7 +448,9 @@ def _handle_fig_creation_task(child_figure_function, log_message, newSize = (int(originalSize[0] * scaleFactor), int(originalSize[1] * scaleFactor)) tempImage = tempImage.resize(newSize, Image.ANTIALIAS) tempImage.save(smallFigOutputNamePath) - + + #figure.savefig(smallFigOutputNamePath, dpi=thumbSizeDPI) + # get rid of the figure plt.close(figure) del(figure) @@ -531,6 +533,11 @@ def plot_and_save_figure_comparison(aData, bData, LOG.debug("Visible axes for file B variable data (" + variableDisplayName + ") are: " + str(bAxis)) LOG.debug("Visible axes shared for both file's variable data (" + variableDisplayName + ") are: " + str(fullAxis)) + if (fullAxis[0] is None) or (fullAxis[1] is None) or (fullAxis[2] is None) or (fullAxis[3] is None) : + LOG.warn("Unable to display figures for variable (" + variableDisplayName + ") because of inability to identify" + + " usable bounding longitude and latitude range on the earth. Bounding range that was identified: str(fullAxis)") + return # TODO, the figures need to be disabled from the report and possibly a warning on the report? + # create our basemap LOG.info('\t\tloading base map data') baseMapInstance, fullAxis = maps.create_basemap(longitudeCommonData, latitudeCommonData, fullAxis, _select_projection(fullAxis)) -- GitLab