From f1bc55843ad1b362dfa442415c35f1e701637c66 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 27 Jun 2022 10:27:29 +0200 Subject: [PATCH] Update prints from data zero_cross --- data/processing/zero_cross.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/data/processing/zero_cross.py b/data/processing/zero_cross.py index e4eb9f5..8fd38a4 100644 --- a/data/processing/zero_cross.py +++ b/data/processing/zero_cross.py @@ -2,6 +2,7 @@ import argparse import configparser import logging import pathlib +import sys import matplotlib.pyplot as plt import matplotlib.dates as mdates @@ -67,13 +68,6 @@ log.debug(f"{t=}") # plt.plot(t[cr0[1:-1]], wave) -nw = len(wave) / 2 -nlw = np.sum(wave > 12) -H13 = np.quantile(wave, 2 / 3) -log.info(f"Number of waves: {nw}") -log.info(f"Number of waves >m: {nlw}") -log.info(f"Proportion: {nlw/nw:e}") -log.info(f"H1/3: {H13}m") dt = 30 * 60 / 2304 # Mlims = (int(5 / dt), int(30 / dt)) @@ -107,8 +101,21 @@ a = [t0[0], t0[-1], *Mlims] c = ax.contourf(t, sj, M, cmap="Greys", vmin=0, vmax=v) fig.colorbar(c) -bigw = np.where(wave > 12)[0] +H13 = np.quantile(wave, 2 / 3) +th = 10 +log.info(f"Threshold: {th}m") +bigw = np.where(wave > th)[0] ym = 1.1 * np.max(np.abs(z)) +nw = wave.size / 2 +nlw = bigw.size +log.info(f"Number of waves: {nw}") +log.info(f"Number of waves >m: {nlw}") +log.info(f"Proportion: {nlw/nw:e}") +log.info(f"H1/3: {H13}m") +if bigw.size > 32: + log.warning(f"Number of large waves: {bigw.size}") + sys.exit() + for w in bigw: fig, (ax2, ax) = plt.subplots(2, figsize=(15/2.54, 2/3*10/2.54), constrained_layout=True) i0 = cr0[w] - int(1200 / dt)