Skip to content

Commit

Permalink
Small change to remove plotting issue with batch processing of data w…
Browse files Browse the repository at this point in the history
…ith different sampling rates.
  • Loading branch information
Tom Hudson committed Feb 1, 2024
1 parent 24c5134 commit cb7e674
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion swspy/splitting/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,12 @@ def plot(self, outdir=None, suppress_direct_plotting=False):
# phi - dt space:
# Plot for single layer:
if self.sws_multi_layer_result_df is None:
Y, X = np.meshgrid(self.phis_labels, self.lags_labels)
if len(self.lags_labels) == self.phi_dt_grid_average[station].shape[0]:
Y, X = np.meshgrid(self.phis_labels, self.lags_labels)
else:
# Or deal with different number of lag steps due to different sampling rate...
lag_labels_tmp = np.arange(self.phi_dt_grid_average[station].shape[0]) / self.fs
Y, X = np.meshgrid(self.phis_labels, lag_labels_tmp)
Z = self.phi_dt_grid_average[station]
# phi_dt_ax.contourf(X, Y, Z, levels=10, cmap="magma")
CS = phi_dt_ax.contourf(X, Y, Z, levels=20, cmap="magma")
Expand Down

0 comments on commit cb7e674

Please sign in to comment.