Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added examples/data/dolfyn/sigvm_bt_09.AD2CP
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/BenchFile01.nc
Binary file not shown.
3 changes: 1 addition & 2 deletions examples/data/dolfyn/test_data/BenchFile01.repr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
- pressure ('time',)
- pressure_alt ('time',)
- pressure_altraw ('time_altraw',)
- pressure_b5 ('time_b5',)
- amp ('beam', 'range', 'time')
- amp_b5 ('range_b5', 'time_b5')
- corr ('beam', 'range', 'time')
- corr_b5 ('range_b5', 'time_b5')
- accel ('dirIMU', 'time')
- mag ('dirIMU', 'time')
... and others (see `<obj>.variables`)
Binary file modified examples/data/dolfyn/test_data/BenchFile01_avg.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/BenchFile01_crop.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/BenchFile01_rotate_beam2inst.nc
Binary file not shown.
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/BenchFile01_rotate_inst2earth.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_BadTime01.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_IMU.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_IMU_ofilt.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_IMU_rotate_beam2inst.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_IMU_rotate_inst2earth.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_IMU_ud.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_dp_echo1.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_dp_echo2.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_tidal.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_tidal_bin.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig1000_tidal_clean.nc
Binary file not shown.
125 changes: 98 additions & 27 deletions examples/data/dolfyn/test_data/Sig500_Echo.dolfyn.log
Original file line number Diff line number Diff line change
@@ -1,30 +1,101 @@
root - INFO - 4464: A5, 10, 18, 188, 0, 1, 1

root - INFO - 4662: A5, 10, 15, 524, 0, 1, 1

root - INFO - 5196: A5, 10, 1C, 214, 0, 1, 1

root - INFO - 5420: A5, 10, 18, 188, 1, 2, 2

root - INFO - 5618: A5, 10, 15, 524, 1, 2, 2

root - INFO - 6152: A5, 10, 1C, 214, 1, 2, 2

root - INFO - 6376: A5, 10, 18, 188, 2, 3, 3

root - INFO - 6574: A5, 10, 15, 524, 2, 3, 3

root - INFO - 7108: A5, 10, 1C, 214, 2, 3, 3

root - INFO - 7332: A5, 10, 18, 188, 3, 4, 4

root - INFO - 7530: A5, 10, 15, 524, 3, 4, 4

root - INFO - 8064: A5, 10, 1C, 214, 3, 4, 4

root - INFO - 8288: A5, 10, 18, 188, 4, 5, 5

root - INFO - 8486: A5, 10, 15, 524, 4, 5, 5

root - INFO - 9020: A5, 10, 1C, 214, 4, 5, 5

root - INFO - 5420: A5, 10, 18, 188, 1, 1, 1
root - INFO - 5618: A5, 10, 15, 524, 1, 1, 1
root - INFO - 6152: A5, 10, 1C, 214, 1, 1, 1
root - INFO - 6376: A5, 10, 18, 188, 2, 1, 1
root - INFO - 6574: A5, 10, 15, 524, 2, 1, 1
root - INFO - 7108: A5, 10, 1C, 214, 2, 1, 1
root - INFO - 7332: A5, 10, 18, 188, 3, 1, 1
root - INFO - 7530: A5, 10, 15, 524, 3, 1, 1
root - INFO - 8064: A5, 10, 1C, 214, 3, 1, 1
root - INFO - 8288: A5, 10, 18, 188, 4, 1, 1
root - INFO - 8486: A5, 10, 15, 524, 4, 1, 1
root - INFO - 9020: A5, 10, 1C, 214, 4, 1, 1
root - INFO - 9244: A5, 10, 18, 188, 5, 1, 1
root - INFO - 9442: A5, 10, 15, 524, 5, 1, 1
root - INFO - 9976: A5, 10, 1C, 214, 5, 1, 1
root - INFO - 10200: A5, 10, 18, 188, 6, 1, 1
root - INFO - 10398: A5, 10, 15, 524, 6, 1, 1
root - INFO - 10932: A5, 10, 1C, 214, 6, 1, 1
root - INFO - 11156: A5, 10, 18, 188, 7, 1, 1
root - INFO - 11354: A5, 10, 15, 524, 7, 1, 1
root - INFO - 11888: A5, 10, 1C, 214, 7, 1, 1
root - INFO - 12112: A5, 10, 18, 188, 8, 1, 1
root - INFO - 12310: A5, 10, 15, 524, 8, 1, 1
root - INFO - 12844: A5, 10, 1C, 214, 8, 1, 1
root - INFO - 13068: A5, 10, 18, 188, 9, 1, 1
root - INFO - 13266: A5, 10, 15, 524, 9, 1, 1
root - INFO - 13800: A5, 10, 1C, 214, 9, 1, 1
root - INFO - 14024: A5, 10, 18, 188, 10, 1, 1
root - INFO - 14222: A5, 10, 15, 524, 10, 1, 1
root - INFO - 14756: A5, 10, 1C, 214, 10, 1, 1
root - INFO - 14980: A5, 10, 18, 188, 11, 1, 1
root - INFO - 15178: A5, 10, 15, 524, 11, 1, 1
root - INFO - 15712: A5, 10, 1C, 214, 11, 1, 1
root - INFO - 15936: A5, 10, 18, 188, 12, 1, 1
root - INFO - 16134: A5, 10, 15, 524, 12, 1, 1
root - INFO - 16668: A5, 10, 1C, 214, 12, 1, 1
root - INFO - 16892: A5, 10, 18, 188, 13, 1, 1
root - INFO - 17090: A5, 10, 15, 524, 13, 1, 1
root - INFO - 17624: A5, 10, 1C, 214, 13, 1, 1
root - INFO - 17848: A5, 10, 18, 188, 14, 1, 1
root - INFO - 18046: A5, 10, 15, 524, 14, 1, 1
root - INFO - 18580: A5, 10, 1C, 214, 14, 1, 1
root - INFO - 18804: A5, 10, 18, 188, 15, 1, 1
root - INFO - 19002: A5, 10, 15, 524, 15, 1, 1
root - INFO - 19536: A5, 10, 1C, 214, 15, 1, 1
root - INFO - 19760: A5, 10, 18, 188, 16, 1, 1
root - INFO - 19958: A5, 10, 15, 524, 16, 1, 1
root - INFO - 20492: A5, 10, 1C, 214, 16, 1, 1
root - INFO - 20716: A5, 10, 18, 188, 17, 1, 1
root - INFO - 20914: A5, 10, 15, 524, 17, 1, 1
root - INFO - 21448: A5, 10, 1C, 214, 17, 1, 1
root - INFO - 21672: A5, 10, 18, 188, 18, 1, 1
root - INFO - 21870: A5, 10, 15, 524, 18, 1, 1
root - INFO - 22404: A5, 10, 1C, 214, 18, 1, 1
root - INFO - 22628: A5, 10, 18, 188, 19, 1, 1
root - INFO - 22826: A5, 10, 15, 524, 19, 1, 1
root - INFO - 23360: A5, 10, 1C, 214, 19, 1, 1
root - INFO - 23584: A5, 10, 18, 188, 20, 1, 1
root - INFO - 23782: A5, 10, 15, 524, 20, 1, 1
root - INFO - 24316: A5, 10, 1C, 214, 20, 1, 1
root - INFO - 24540: A5, 10, 18, 188, 21, 1, 1
root - INFO - 24738: A5, 10, 15, 524, 21, 1, 1
root - INFO - 25272: A5, 10, 1C, 214, 21, 1, 1
root - INFO - 25496: A5, 10, 18, 188, 22, 1, 1
root - INFO - 25694: A5, 10, 15, 524, 22, 1, 1
root - INFO - 26228: A5, 10, 1C, 214, 22, 1, 1
root - INFO - 26452: A5, 10, 18, 188, 23, 1, 1
root - INFO - 26650: A5, 10, 15, 524, 23, 1, 1
root - INFO - 27184: A5, 10, 1C, 214, 23, 1, 1
root - INFO - 27408: A5, 10, 18, 188, 24, 1, 1
root - INFO - 27606: A5, 10, 15, 524, 24, 1, 1
root - INFO - 28140: A5, 10, 1C, 214, 24, 1, 1
root - INFO - 28364: A5, 10, 18, 188, 25, 1, 1
root - INFO - 28562: A5, 10, 15, 524, 25, 1, 1
root - INFO - 29096: A5, 10, 1C, 214, 25, 1, 1
root - INFO - 29320: A5, 10, 18, 188, 26, 1, 1
root - INFO - 29518: A5, 10, 15, 524, 26, 1, 1
root - INFO - 30052: A5, 10, 1C, 214, 26, 1, 1
root - INFO - 30276: A5, 10, 18, 188, 27, 1, 1
root - INFO - 30474: A5, 10, 15, 524, 27, 1, 1
root - INFO - 31008: A5, 10, 1C, 214, 27, 1, 1
root - INFO - 31232: A5, 10, 18, 188, 28, 1, 1
root - INFO - 31430: A5, 10, 15, 524, 28, 1, 1
root - INFO - 31964: A5, 10, 1C, 214, 28, 1, 1
root - INFO - 32188: A5, 10, 18, 188, 29, 1, 1
root - INFO - 32386: A5, 10, 15, 524, 29, 1, 1
root - INFO - 32920: A5, 10, 1C, 214, 29, 1, 1
root - INFO - 33144: A5, 10, 18, 188, 30, 1, 1
root - INFO - 33342: A5, 10, 15, 524, 30, 1, 1
root - INFO - 33876: A5, 10, 1C, 214, 30, 1, 1
root - INFO - 34100: A5, 10, 18, 188, 31, 1, 1
root - INFO - 34298: A5, 10, 15, 524, 31, 1, 1
root - INFO - 34832: A5, 10, 1C, 214, 31, 1, 1
root - INFO - 35056: A5, 10, 18, 188, 32, 1, 1
root - INFO - 35254: A5, 10, 15, 524, 32, 1, 1
root - INFO - 35788: A5, 10, 1C, 214, 32, 1, 1
root - INFO - 36012: A5, 10, 18, 188, 33, 1, 1
root - INFO - 36210: A5, 10, 15, 524, 33, 1, 1
Binary file modified examples/data/dolfyn/test_data/Sig500_Echo.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig500_Echo_clean.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig500_Echo_crop.nc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig500_dp_ice1.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig500_dp_ice2.nc
Binary file not shown.
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig500_last_ensemble_is_whole.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/Sig_SkippedPings01.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/VelEchoBT01.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/VelEchoBT01_rotate_beam2inst.nc
Binary file not shown.
Binary file not shown.
Binary file added examples/data/dolfyn/test_data/sigvm_bt_09.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/vector_data01_avg.nc
Binary file not shown.
7 changes: 1 addition & 6 deletions mhkit/dolfyn/adp/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,7 @@ def water_depth_from_pressure(ds, salinity=35) -> None:
pressure = [v for v in ds.data_vars if "pressure" in v]
if not pressure:
raise NameError("The variable 'pressure' does not exist.")
else:
for p in pressure:
if not ds[p].sum():
pressure.remove(p)
if not pressure:
raise ValueError("Pressure data not recorded.")

temp = [
v
for v in ds.data_vars
Expand Down
6 changes: 6 additions & 0 deletions mhkit/dolfyn/binned.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ def _psd_base(
n_samples = out.shape[-2]
for i in range(n_samples):
sample_slice = slice(i * step, i * step + int(n_bin))
if any(np.isnan(dat[sample_slice])):
warnings.warn("Skipped PSD window containing NaNs.")
continue
freq, psd = signal.welch(
dat[sample_slice],
fs=fs,
Expand Down Expand Up @@ -488,6 +491,9 @@ def _csd_base(
n_samples = oshp[-2]
for i in range(n_samples):
sample_slice = slice(i * step, i * step + int(n_bin))
if any(np.isnan(dat1[sample_slice])) or any(np.isnan(dat2[sample_slice])):
warnings.warn("Skipped PSD window containing NaNs.")
continue
freq, cpsd = signal.csd(
dat1[sample_slice],
dat2[sample_slice],
Expand Down
7 changes: 2 additions & 5 deletions mhkit/dolfyn/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,8 @@ def _create_dataset(data):
else: # amp, corr, prcnt_gd, status
dim0 = "beam"

if not any(val in key for val in tag) or ("_avg" in key):
if "_avg" in key:
tg = "_avg"
else:
tg = ""
if not any(val in key for val in tag) or (tg in ["_avg", "_bt"]):
tg = "" if tg not in ["_avg", "_bt"] else tg
ds_dict[key] = {
"dims": (dim0, "range" + tg, "time" + tg),
"data": data["data_vars"][key],
Expand Down
10 changes: 5 additions & 5 deletions mhkit/dolfyn/io/nortek.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def __init__(
len(nens)
except TypeError:
# not a tuple, so we assume None or int
self._npings = nens
self.n_ens = nens
else:
if len(nens) != 2:
raise TypeError("nens must be: None (), int, or len 2")
Expand All @@ -214,7 +214,7 @@ def __init__(
"the entire file, then crop the beginning at "
"nens[0]."
)
self._npings = nens[1]
self.n_ens = nens[1]
self._n_start = nens[0]
if endian is None:
if unpack("<HH", self.read(4)) == (1445, 24):
Expand Down Expand Up @@ -263,8 +263,8 @@ def __init__(
# This has a large buffer...
self.f = open(base._abspath(fname), "rb", bufsize)
self.close = self.f.close
if self._npings is not None:
self.n_ensembles = self._npings
if self.n_ens is not None:
self.n_ensembles = self.n_ens

da = self.data["attrs"]
if (self.config["adv"]["n_burst"] > 0) and ("ADV" in da["inst_type"]):
Expand Down Expand Up @@ -479,7 +479,7 @@ def readfile(self, nlines=None):
if retval == 10:
self.findnext()
retval = None
if self._npings is not None and self.c >= self._npings:
if self.c >= self.n_ensembles:
if "imu" in self._dtypes:
try:
self.readnext()
Expand Down
Loading
Loading