From 1d2a6a90fd7017b8f930c5acd3a46907ec68d534 Mon Sep 17 00:00:00 2001 From: kehoe Date: Mon, 13 May 2019 22:09:31 +0000 Subject: [PATCH 1/3] Fixing issue with plot_from_u_and_v() when finding levels to plot wind barbs. --- act/plotting/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/act/plotting/plot.py b/act/plotting/plot.py index 3aad0b2692..65b2ad0914 100644 --- a/act/plotting/plot.py +++ b/act/plotting/plot.py @@ -1520,7 +1520,7 @@ def plot_from_u_and_v(self, u_field, v_field, p_field, v_red = np.zeros_like(p_levels_to_plot) * getattr(units, v_units) for i in range(len(p_levels_to_plot)): - index = np.argmin(np.abs(p_levels_to_plot[i] - p)) + index = np.argmin(np.abs(p_levels_to_plot[i] - p.magnitude)) u_red[i] = u[index].magnitude * getattr(units, u_units) v_red[i] = v[index].magnitude * getattr(units, v_units) From a0542502bbc00ebc5b3b5c7992578b391c15921b Mon Sep 17 00:00:00 2001 From: kehoe Date: Mon, 13 May 2019 22:17:55 +0000 Subject: [PATCH 2/3] Fixing issue with plot_from_u_and_v() when finding levels to plot wind barbs. --- act/plotting/plot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/act/plotting/plot.py b/act/plotting/plot.py index 65b2ad0914..7ec40ee675 100644 --- a/act/plotting/plot.py +++ b/act/plotting/plot.py @@ -1048,8 +1048,8 @@ def time_height_scatter( cb_label = data_field colorbar_map = plt.cm.get_cmap(cmap) - self.fig.subplots_adjust(left=0.1, right=0.86, - bottom=0.16, top=0.91) + self.fig.subplots_adjust(left=0.13, right=0.86, + bottom=0.19, top=0.90) ax1 = self.plot(alt_field, color='black', **kwargs) ax1.set_ylabel(alt_label) ax2 = ax1.twinx() @@ -1197,6 +1197,7 @@ def plot(self, dir_field, spd_field, dsname=None, subplot_index=(0,), if i == 0: the_range = np.logical_or(dir_data < deg_width / 2., dir_data > 360. - deg_width / 2.) + print(the_range) else: the_range = np.logical_and( dir_data >= dir_bins_mid[i] - deg_width / 2, @@ -1714,7 +1715,7 @@ def geoplot(self, data_field=None, lat_field='lat', # Create base plot projection ax = plt.axes(projection=projection) - plt.subplots_adjust(left=0.01, right=0.99, bottom=0.05, top=0.93) + plt.subplots_adjust(left=0.01, right=0.99, bottom=0.08, top=0.93) ax.set_extent([lon_limits[0], lon_limits[1], lat_limits[0], lat_limits[1]], crs=projection) From 5bdfa220902a88ffb37ac8a8cef0b182ee1ec885 Mon Sep 17 00:00:00 2001 From: kehoe Date: Mon, 13 May 2019 22:35:23 +0000 Subject: [PATCH 3/3] Removing print statement from debugging --- act/plotting/plot.py | 1 - 1 file changed, 1 deletion(-) diff --git a/act/plotting/plot.py b/act/plotting/plot.py index 7ec40ee675..3d4fad70b9 100644 --- a/act/plotting/plot.py +++ b/act/plotting/plot.py @@ -1197,7 +1197,6 @@ def plot(self, dir_field, spd_field, dsname=None, subplot_index=(0,), if i == 0: the_range = np.logical_or(dir_data < deg_width / 2., dir_data > 360. - deg_width / 2.) - print(the_range) else: the_range = np.logical_and( dir_data >= dir_bins_mid[i] - deg_width / 2,