pyadps 0.1.0__py3-none-any.whl → 0.1.0b0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,120 +0,0 @@
1
- import numpy as np
2
-
3
-
4
- def sound_speed_correction(
5
- velocity: np.ndarray,
6
- sound_speed: np.ndarray,
7
- temperature: np.ndarray,
8
- salinity: np.ndarray,
9
- depth: np.ndarray,
10
- horizontal: bool = True,
11
- ) -> np.ndarray:
12
- """
13
- Corrects velocity measurements for variations in sound speed.
14
-
15
- The function calculates the corrected sound speed based on temperature,
16
- salinity, and depth using empirical equations. It then adjusts the velocity
17
- measurements for the u and v components using the ratio of the original
18
- and corrected sound speeds, while leaving the w component unchanged by default.
19
-
20
- Parameter:
21
- ----------
22
- velocity (numpy.ndarray): 4D array of velocity measurements in m/s with
23
- components (u, v, w, error) along depth and time axes. Missing values
24
- should be represented by -32768.
25
- sound_speed (numpy.ndarray): 1D array of measured sound speed in m/s as a function of time.
26
- temperature (numpy.ndarray): 1D array of temperature in degrees Celsius as a function of time.
27
- salinity (numpy.ndarray): 1D array of salinity in PSU (Practical Salinity Units) as a function of time.
28
- depth (numpy.ndarray): 1D array of transducer depth in meters as a function of time.
29
- horizontal (bool): By default only horizontal velocities are corrected.
30
-
31
- Returns:
32
- --------
33
- numpy.ndarray: 3D array of corrected velocity measurements as 32-bit integers.
34
- The w component remains unchanged. Missing values (-32768) remain unchanged.
35
-
36
- Notes:
37
- ------
38
- The sound speed correction formula is derived empirically using the
39
- equation (Urick, 1983).
40
- """
41
- # Calculate corrected sound speed
42
- sound_speed_corrected = (
43
- 1449.2
44
- + 4.6 * temperature
45
- - 0.055 * temperature**2
46
- + 0.00029 * temperature**3
47
- + (1.34 - 0.01 * temperature) * (salinity - 35)
48
- + 0.016 * depth
49
- )
50
-
51
- sound_speed = sound_speed
52
- sound_speed_corrected = sound_speed_corrected
53
- # Separate u, v, and w components
54
- u = velocity[0, :, :]
55
- v = velocity[1, :, :]
56
- w = velocity[2, :, :]
57
- e = velocity[3, :, :]
58
-
59
- # Correct u and v components
60
- u_corrected = np.where(
61
- u == -32768,
62
- -32768.0,
63
- u * sound_speed[np.newaxis, :] / sound_speed_corrected[np.newaxis, :],
64
- )
65
-
66
- v_corrected = np.where(
67
- v == -32768,
68
- -32768.0,
69
- v * sound_speed[np.newaxis, :] / sound_speed_corrected[np.newaxis, :],
70
- )
71
-
72
- if not horizontal:
73
- w_corrected = np.where(
74
- w == -32768,
75
- -32768.0,
76
- w * sound_speed[np.newaxis, :] / sound_speed_corrected[np.newaxis, :],
77
- )
78
- else:
79
- w_corrected = w
80
-
81
- # Combine corrected components back into a 4D array
82
- velocity_corrected = np.stack(
83
- [
84
- u_corrected.astype(np.int32),
85
- v_corrected.astype(np.int32),
86
- w_corrected.astype(np.int32),
87
- e.astype(np.int32),
88
- ],
89
- axis=0,
90
- )
91
-
92
- return velocity_corrected
93
-
94
-
95
- def tilt_sensor_check(
96
- tilt: np.ndarray, mask: np.ndarray, cutoff: int = 15
97
- ) -> np.ndarray:
98
- """
99
- Updates the given 2D mask array based on the tilt sensor readings. If the tilt value in
100
- the 1D tilt array exceeds the specified cutoff, the corresponding values in the mask are
101
- set to 1.
102
-
103
- Parameters
104
- ----------
105
- tilt : np.ndarray
106
- A 1D array of tilt sensor readings.
107
- mask : np.ndarray
108
- A 2D array where the tilt values are checked against the cutoff.
109
- cutoff : int, optional
110
- The tilt value threshold. Default is 15. If a tilt value exceeds this threshold,
111
- the corresponding mask value is updated to 1.
112
-
113
- Returns
114
- -------
115
- np.ndarray
116
- A 2D array with updated mask values where tilt exceeds the cutoff.
117
- """
118
- tilt = tilt * 0.01
119
- updated_mask = np.where(tilt[:, np.newaxis] > cutoff, 1, mask.T)
120
- return updated_mask.T
@@ -1,33 +0,0 @@
1
- pyadps/Home_Page.py,sha256=j_-3fsp1hkhpNEl5jE-CEQvClDGpMi1H3ZQPXfuKWBg,1782
2
- pyadps/__init__.py,sha256=bNCm6_WIhiwvaUeOZhRkyLZyzzUKfSH80Fslg0JPJyk,232
3
- pyadps/__main__.py,sha256=cIFUayxPnKl00oIR99L6IUEvc8trW7dijtfBQCAen5c,356
4
- pyadps/pages/01_Read_File.py,sha256=MaBtdMrd1m6aox8O7IxVdMeoS5kYEiaossop_U3w6I8,14324
5
- pyadps/pages/02_View_Raw_Data.py,sha256=AhT7gvDbcMRPf-WIBzTQ0o-nn9_q7NH6plTlpMtgzaY,6170
6
- pyadps/pages/03_Download_Raw_File.py,sha256=3887Lj5h1IZTHFpPfc0fYT7oJ2qdMJtJj6X6fmHT9zw,9524
7
- pyadps/pages/04_Sensor_Health.py,sha256=XQ7oTZ9LCrKDclVZPKQVsBtyDShdyHZfVhzCTRGZY0g,33905
8
- pyadps/pages/05_QC_Test.py,sha256=8wt7h-RHLOf3GZ8-B_kXA0IqzHTBwW_H7YQFEk5EM6E,15904
9
- pyadps/pages/06_Profile_Test.py,sha256=VQDI1zpm-ZnN7HrqFnYgwkNYFRQtQYafWvqQA7H9uRk,34767
10
- pyadps/pages/07_Velocity_Test.py,sha256=lzMBmWmnVu4MDXof_40312aL1eUh79mdzEZyZowZXcM,23008
11
- pyadps/pages/08_Write_File.py,sha256=pXa1qUPegQ8nnZ9e65oE7GkuMPJ23TPM5956HlLN_PM,21540
12
- pyadps/pages/09_Auto_process.py,sha256=gOvLEfwAPxe9v-W8DASKSuNQzB5BjHLnPkwUgOufwdI,1776
13
- pyadps/pages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- pyadps/utils/__init__.py,sha256=nCqRp-OT_1BC7RnL3ARUIldlw9sWyr1XqQvQid-B4ts,407
15
- pyadps/utils/autoprocess.py,sha256=QBwu-CeQUmKn0B6usHthW0v78TeFLxC7k6s0ZPEZAuo,19507
16
- pyadps/utils/metadata/config.ini,sha256=TC7htzGwUukIXt_u3JR5ycyvOoDj_JxWgGY6khjNeck,2154
17
- pyadps/utils/metadata/demo.000,sha256=qxB3sgjABrpv4DNXkwjpbSxk5sc4UwAI8kgQX0--PM8,234468
18
- pyadps/utils/metadata/flmeta.json,sha256=diIB9nht_0uw9YJNSFGdZYGzeVbR-07zIZS9Nf4VPSE,14245
19
- pyadps/utils/metadata/vlmeta.json,sha256=_dkQlGkkUvpAIM7S6kEUenSaiCpOrwXg8n1aU3dDF3s,22535
20
- pyadps/utils/plotgen.py,sha256=-A5fN2WoCZevt_SLT5OKSeYCzfv3rGG4tw7p1qzFjeA,26344
21
- pyadps/utils/profile_test.py,sha256=kcqdFigL2wQwMRrKyfNzfGIYcFwRj1_945lEpIio6pQ,20173
22
- pyadps/utils/pyreadrdi.py,sha256=P1UTDrglgbYn3XQGUTsqNPynDGE-zp4cI_TW8yfOlic,35090
23
- pyadps/utils/readrdi.py,sha256=ullqqWL-tvK3V9fjX8kpPwRpWhmRZy-CyA240gmcdr4,50012
24
- pyadps/utils/script.py,sha256=Ti7IkbKSh4PwD4QPpCHSjLZHledFxr6QH3950X4bKbk,6534
25
- pyadps/utils/sensor_health.py,sha256=aHRaU4kMJZ9dGmYypKpCCgq-owWoNjvcl1I_9I7dG68,3973
26
- pyadps/utils/signal_quality.py,sha256=dohaMtJT_MCeyxF__zMRy36_rMmVZqU5vCdW1AYH35s,16239
27
- pyadps/utils/velocity_test.py,sha256=-95NKLQJ8Ni8etdxhDHxsfMF4MdRWcXL9fgLgWy7Kn0,6112
28
- pyadps/utils/writenc.py,sha256=H5rH2dfUECLukql5zNymAwEtMib8-PJo3y5e3_NIRsk,9754
29
- pyadps-0.1.0.dist-info/LICENSE,sha256=sfY_7DzQF5FxnO2T6ek74dfm5uBmwEp1oEg_WlzNsb8,1092
30
- pyadps-0.1.0.dist-info/METADATA,sha256=oksHGBkVVf06YhJXIKvMmY7Pf8dobyanFdPxBd33cpk,4461
31
- pyadps-0.1.0.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
32
- pyadps-0.1.0.dist-info/entry_points.txt,sha256=-oZhbbJq8Q29uNVh5SmzOLp9OeFM9VUzHVxovfI4LXA,126
33
- pyadps-0.1.0.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- [console_scripts]
2
- run-auto=pyadps.utils.autoprocess:main
3
- run-pyadps=pyadps.__main__:main
4
- run-script=pyadps.utils.script:main
5
-