Skip to content

Commit

Permalink
feat(test_plots): add smooth coherence
Browse files Browse the repository at this point in the history
  • Loading branch information
j-haacker committed Feb 24, 2024
1 parent f160648 commit 4d7623b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cryoswath/test_plots/waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,26 @@ def coherence(waveform, *,
):
if ax is None:
ax = plt.subplots()[1]
h_smooth = gauss_filter_DataArray(waveform.coherence_waveform_20_ku, "ns_20_ku", 35, 35).plot(c=".7", label="smooth")[0]
h_list = [h_smooth]
try:
if plot_properties["threshold"]["facecolor"] is None:
plot_properties["threshold"]["facecolor"] = ax.get_facecolor()
y0 = -1
h_thr = ax.add_patch(mpl.patches.Rectangle((-100, y0),
waveform.ns_20_ku[-1]+200, waveform.coherence_threshold-y0,
**plot_properties["threshold"], label="threshold"))
h_list = [h_thr]
h_list.append(h_thr)
except KeyError:
h_list = []
pass
try:
if plot_properties["omitted"]["facecolor"] is None:
plot_properties["omitted"]["facecolor"] = ax.get_facecolor()
x0 = -100
h_omitted = ax.add_patch(mpl.patches.Rectangle((x0, -1),
waveform.swath_start[0]-x0, 3,
**plot_properties["omitted"], label="omitted"))
h_list.insert(0, h_omitted)
h_list.insert(1, h_omitted)
except AttributeError:
pass
try:
Expand Down

0 comments on commit 4d7623b

Please sign in to comment.