diff --git a/.vscode/launch.json b/.vscode/launch.json index a988867..370cbd0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -348,7 +348,9 @@ // File "/src/data/calibrate.py", line 698, in global_metadata f"{self.nudge_total_minutes:.1f} minutes nudged toward GPS fixes." //"args": ["-v", "1", "--mission", "2003.191.00", "--noinput", "--no_cleanup" ], // File "/src/data/resample.py", line 736, IndexError: index -1 is out of bounds for axis 0 with size 0 - "args": ["-v", "1", "--mission", "2006.338.11", "--noinput", "--no_cleanup" ], + // "args": ["-v", "1", "--mission", "2006.338.11", "--noinput", "--no_cleanup" ], + // File "/src/data/create_products.py", line 997, in _plot_var AttributeError: 'NoneType' object has no attribute 'get_index' + "args": ["-v", "1", "--mission", "2010.257.00", "--noinput", "--no_cleanup" ], }, { diff --git a/src/data/create_products.py b/src/data/create_products.py index c37a9f7..2318bd2 100755 --- a/src/data/create_products.py +++ b/src/data/create_products.py @@ -992,26 +992,27 @@ def _plot_var( # noqa: C901, PLR0912, PLR0913, PLR0915 levels=np.linspace(v2_5, v97_5, num_colors), ) - # Blank out the countoured data below the bottom of the profiles - xb = np.append( - profile_bottoms.get_index("dist").to_numpy(), - [ - curr_ax.get_xlim()[1], - curr_ax.get_xlim()[1], - curr_ax.get_xlim()[0], - curr_ax.get_xlim()[0], - ], - ) - yb = np.append( - profile_bottoms.to_numpy(), - [ - profile_bottoms.to_numpy()[-1], - curr_ax.get_ylim()[0], - curr_ax.get_ylim()[0], - profile_bottoms.to_numpy()[0], - ], - ) - curr_ax.fill(list(reversed(xb)), list(reversed(yb)), "w") + if profile_bottoms is not None: + # Blank out the countoured data below the bottom of the profiles + xb = np.append( + profile_bottoms.get_index("dist").to_numpy(), + [ + curr_ax.get_xlim()[1], + curr_ax.get_xlim()[1], + curr_ax.get_xlim()[0], + curr_ax.get_xlim()[0], + ], + ) + yb = np.append( + profile_bottoms.to_numpy(), + [ + profile_bottoms.to_numpy()[-1], + curr_ax.get_ylim()[0], + curr_ax.get_ylim()[0], + profile_bottoms.to_numpy()[0], + ], + ) + curr_ax.fill(list(reversed(xb)), list(reversed(yb)), "w") # Add bathymetry as grey filled contour if available if bottom_depths is not None: