Skip to content

Commit 633add5

Browse files
committed
Update cell size and blank distance calculations
1 parent 54da94a commit 633add5

7 files changed

Lines changed: 13 additions & 10 deletions

File tree

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

mhkit/dolfyn/io/nortek.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,26 +1440,29 @@ def convert_awac_profile(self):
14401440
self._convert_data(defs.awac_profile)
14411441
# Calculate the ranges. (Manually calculated)
14421442
if "hr_profile" in self.data["attrs"]:
1443-
cs_coefs = {2000: 0.00675, 1000: 0.01350}
1444-
bd_coef = 0.00662
1445-
n_digits = 3
1443+
cs_coeff = {2000: 0.00675, 1000: 0.01350}
1444+
bd_coeff = {2000: 0.00662, 1000: 0.00673}
14461445
else:
1447-
cs_coefs = {2000: 0.0239, 1000: 0.0478, 600: 0.0797, 400: 0.1195}
1448-
bd_coef = 0.02289
1449-
n_digits = 2
1446+
cs_coeff = {2000: 0.0239, 1000: 0.0478, 600: 0.0797, 400: 0.1195}
1447+
bd_coeff = {2000: 0.02228, 1000: 0.02266, 600: 0.02281, 400: 0.02289}
14501448
# Head angle is 25 degrees for all awacs.
14511449
h_ang = 25 * (np.pi / 180)
14521450
# Cell size
14531451
cs = round(
14541452
self.config["bin_length"]
14551453
/ 256
1456-
* cs_coefs[self.config["hdr"]["carrier_freq_kHz"]]
1454+
* cs_coeff[self.config["hdr"]["carrier_freq_kHz"]]
14571455
* np.cos(h_ang),
1458-
n_digits,
1456+
ndigits=2,
14591457
)
14601458
# Blanking distance
1461-
bd = round(self.config["blank_dist"] * bd_coef * np.cos(h_ang) - cs, n_digits)
1462-
# Profile range
1459+
bd = round(
1460+
self.config["blank_dist"]
1461+
* bd_coeff[self.config["hdr"]["carrier_freq_kHz"]]
1462+
* np.cos(h_ang)
1463+
- cs,
1464+
ndigits=2,
1465+
)
14631466
r = (np.float32(np.arange(self.config["usr"]["n_bins"])) + 1) * cs + bd
14641467
self.data["coords"]["range"] = r
14651468
self.data["attrs"]["cell_size"] = float(cs)

0 commit comments

Comments
 (0)