pyadps 0.1.1__py3-none-any.whl → 0.2.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.
Files changed (48) hide show
  1. pyadps/Home_Page.py +5 -11
  2. pyadps/pages/01_Read_File.py +17 -190
  3. pyadps/pages/02_View_Raw_Data.py +33 -69
  4. pyadps/pages/03_Download_Raw_File.py +61 -149
  5. pyadps/pages/04_QC_Test.py +334 -0
  6. pyadps/pages/05_Profile_Test.py +575 -0
  7. pyadps/pages/06_Velocity_Test.py +341 -0
  8. pyadps/pages/07_Write_File.py +452 -0
  9. pyadps/utils/__init__.py +3 -3
  10. pyadps/utils/autoprocess.py +78 -344
  11. pyadps/utils/cutbin.py +413 -0
  12. pyadps/utils/metadata/config.ini +4 -22
  13. pyadps/utils/plotgen.py +3 -505
  14. pyadps/utils/profile_test.py +125 -494
  15. pyadps/utils/pyreadrdi.py +17 -27
  16. pyadps/utils/readrdi.py +18 -164
  17. pyadps/utils/{__pycache__/regrid.cpython-312.pyc → regrid.py} +0 -0
  18. pyadps/utils/script.py +147 -197
  19. pyadps/utils/signal_quality.py +24 -344
  20. pyadps/utils/velocity_test.py +31 -79
  21. pyadps/utils/writenc.py +21 -155
  22. {pyadps-0.1.1.dist-info → pyadps-0.2.0b0.dist-info}/METADATA +24 -55
  23. pyadps-0.2.0b0.dist-info/RECORD +31 -0
  24. {pyadps-0.1.1.dist-info → pyadps-0.2.0b0.dist-info}/WHEEL +1 -1
  25. {pyadps-0.1.1.dist-info → pyadps-0.2.0b0.dist-info}/entry_points.txt +0 -1
  26. pyadps/pages/04_Sensor_Health.py +0 -905
  27. pyadps/pages/05_QC_Test.py +0 -476
  28. pyadps/pages/06_Profile_Test.py +0 -971
  29. pyadps/pages/07_Velocity_Test.py +0 -600
  30. pyadps/pages/08_Write_File.py +0 -587
  31. pyadps/pages/09_Auto_process.py +0 -64
  32. pyadps/pages/__pycache__/__init__.cpython-312.pyc +0 -0
  33. pyadps/utils/__pycache__/__init__.cpython-312.pyc +0 -0
  34. pyadps/utils/__pycache__/autoprocess.cpython-312.pyc +0 -0
  35. pyadps/utils/__pycache__/cutbin.cpython-312.pyc +0 -0
  36. pyadps/utils/__pycache__/plotgen.cpython-312.pyc +0 -0
  37. pyadps/utils/__pycache__/profile_test.cpython-312.pyc +0 -0
  38. pyadps/utils/__pycache__/pyreadrdi.cpython-312.pyc +0 -0
  39. pyadps/utils/__pycache__/readrdi.cpython-312.pyc +0 -0
  40. pyadps/utils/__pycache__/script.cpython-312.pyc +0 -0
  41. pyadps/utils/__pycache__/sensor_health.cpython-312.pyc +0 -0
  42. pyadps/utils/__pycache__/signal_quality.cpython-312.pyc +0 -0
  43. pyadps/utils/__pycache__/velocity_test.cpython-312.pyc +0 -0
  44. pyadps/utils/__pycache__/writenc.cpython-312.pyc +0 -0
  45. pyadps/utils/metadata/demo.000 +0 -0
  46. pyadps/utils/sensor_health.py +0 -120
  47. pyadps-0.1.1.dist-info/RECORD +0 -47
  48. {pyadps-0.1.1.dist-info → pyadps-0.2.0b0.dist-info}/LICENSE +0 -0
@@ -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,47 +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=4LUeSEumOtsGpsEdPdeRq5msHP91JqdZXcJB_PJHPXo,14373
5
- pyadps/pages/02_View_Raw_Data.py,sha256=AhT7gvDbcMRPf-WIBzTQ0o-nn9_q7NH6plTlpMtgzaY,6170
6
- pyadps/pages/03_Download_Raw_File.py,sha256=A17wxNTHZC1Oi51S0fa2uLTBQsRTWRjDZQjFb2l78uI,10721
7
- pyadps/pages/04_Sensor_Health.py,sha256=2Qnwl7D46H-f8LmXLVZj5X36h8MjRwmVRK6Bs_wuB_k,33905
8
- pyadps/pages/05_QC_Test.py,sha256=8wt7h-RHLOf3GZ8-B_kXA0IqzHTBwW_H7YQFEk5EM6E,15904
9
- pyadps/pages/06_Profile_Test.py,sha256=zH2TdpEzRFUiXSDQGfdeSsGYAihdCRuj4YgsedB61E0,34776
10
- pyadps/pages/07_Velocity_Test.py,sha256=K4vEiLPMXrU4JMLj-mIA1G4H5ORozMbHMiMov3ZZXP0,23008
11
- pyadps/pages/08_Write_File.py,sha256=ghzxAaIrnArb04Mvn4b4jNu1ewZ-U9V8uZQAFuO6DZc,22255
12
- pyadps/pages/09_Auto_process.py,sha256=SRtQVD9_kodlSvYdF9-02ur6EaWG2zMvN6-BcWdzYV8,1874
13
- pyadps/pages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- pyadps/pages/__pycache__/__init__.cpython-312.pyc,sha256=6pMyqdclo2Qu_4JRR0WGzppdaQyxFUIBQbciBi14wgw,157
15
- pyadps/utils/__init__.py,sha256=nCqRp-OT_1BC7RnL3ARUIldlw9sWyr1XqQvQid-B4ts,407
16
- pyadps/utils/__pycache__/__init__.cpython-312.pyc,sha256=1FNTM005xyJOn2eJ9-kn8rJjD215cvgy3Cc-Xb-apf0,545
17
- pyadps/utils/__pycache__/autoprocess.cpython-312.pyc,sha256=s_f3V09eFxcGWaGNHiXADgBs1OaWhGz6ypEdkVV4rpg,17996
18
- pyadps/utils/__pycache__/cutbin.cpython-312.pyc,sha256=Fu6VQQL0rjRkvrSS8qLmU8ctaz-Y-juw2b6fcIuS30g,28442
19
- pyadps/utils/__pycache__/plotgen.cpython-312.pyc,sha256=HA8QnkI9CQttcAlXrRPvrZrgKroJb_W_S6dmR0XM9pk,47182
20
- pyadps/utils/__pycache__/profile_test.cpython-312.pyc,sha256=FGaPZj5POdrBmUwbLs9tKFXJQL29WjZsX1l7mumUwrk,20852
21
- pyadps/utils/__pycache__/pyreadrdi.cpython-312.pyc,sha256=6_jgCt-3N4gQVLKLZZCLqOKsQJ3mQXQrq_w2jtU7ARw,37624
22
- pyadps/utils/__pycache__/readrdi.cpython-312.pyc,sha256=-3SpMj71glafcy0XlS_itLYFKCQAXLnrmliBwVDhEqM,53190
23
- pyadps/utils/__pycache__/regrid.cpython-312.pyc,sha256=STOYAAGBfLnP91Pvqlcvtd8ilwyOoRDoGxHs56hiSYo,9804
24
- pyadps/utils/__pycache__/script.cpython-312.pyc,sha256=ubdOI-kEG_iBBB0tBvU-r4CZWj9Wn42PewdGKsNlu2M,8230
25
- pyadps/utils/__pycache__/sensor_health.cpython-312.pyc,sha256=8iYp15CEZNFujAIftWylksg9WbdPe0ozsk99jJFQqco,5037
26
- pyadps/utils/__pycache__/signal_quality.cpython-312.pyc,sha256=PeUZEesieBLxrc8z8aKoX7N7zjUJfpTqcvsTp_V0FG0,18256
27
- pyadps/utils/__pycache__/velocity_test.cpython-312.pyc,sha256=6tUY161EOSGwwSkfMEnWwF8jzrCIl5bm9D-PEcCogyY,7071
28
- pyadps/utils/__pycache__/writenc.cpython-312.pyc,sha256=0c1p-PLaJjYJrTXrgJ-VRCyZtqVlPyYyfeefIAr0t-8,11738
29
- pyadps/utils/autoprocess.py,sha256=8KAg5-7uC7dsMHrCPfvM5icPzle3MU1gpFNcC-eZrkM,20086
30
- pyadps/utils/metadata/config.ini,sha256=TC7htzGwUukIXt_u3JR5ycyvOoDj_JxWgGY6khjNeck,2154
31
- pyadps/utils/metadata/demo.000,sha256=qxB3sgjABrpv4DNXkwjpbSxk5sc4UwAI8kgQX0--PM8,234468
32
- pyadps/utils/metadata/flmeta.json,sha256=diIB9nht_0uw9YJNSFGdZYGzeVbR-07zIZS9Nf4VPSE,14245
33
- pyadps/utils/metadata/vlmeta.json,sha256=_dkQlGkkUvpAIM7S6kEUenSaiCpOrwXg8n1aU3dDF3s,22535
34
- pyadps/utils/plotgen.py,sha256=-A5fN2WoCZevt_SLT5OKSeYCzfv3rGG4tw7p1qzFjeA,26344
35
- pyadps/utils/profile_test.py,sha256=kcqdFigL2wQwMRrKyfNzfGIYcFwRj1_945lEpIio6pQ,20173
36
- pyadps/utils/pyreadrdi.py,sha256=2xBg9v7wvxywfvJK1E0hrjR9XSqiiNwpA9ELfcSsuhM,35303
37
- pyadps/utils/readrdi.py,sha256=ullqqWL-tvK3V9fjX8kpPwRpWhmRZy-CyA240gmcdr4,50012
38
- pyadps/utils/script.py,sha256=TKMCYe0HEz-2GFpNxKVzpg0p4MM-Cu2rcMZc51GgLn4,6534
39
- pyadps/utils/sensor_health.py,sha256=aHRaU4kMJZ9dGmYypKpCCgq-owWoNjvcl1I_9I7dG68,3973
40
- pyadps/utils/signal_quality.py,sha256=dohaMtJT_MCeyxF__zMRy36_rMmVZqU5vCdW1AYH35s,16239
41
- pyadps/utils/velocity_test.py,sha256=O8dgjv_5pxhJq6QuWHxysMjNzxSnob_2KPLInmO1kHI,6112
42
- pyadps/utils/writenc.py,sha256=fgE0qpxCy_uk5hsYCeN5l77jWgj-vLxpjx-4hEJDJU0,13955
43
- pyadps-0.1.1.dist-info/LICENSE,sha256=sfY_7DzQF5FxnO2T6ek74dfm5uBmwEp1oEg_WlzNsb8,1092
44
- pyadps-0.1.1.dist-info/METADATA,sha256=bCxR_5Za17VwJ69R7Ja7h9UwVAidcFwI_3veHtBn9Qs,4518
45
- pyadps-0.1.1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
46
- pyadps-0.1.1.dist-info/entry_points.txt,sha256=-oZhbbJq8Q29uNVh5SmzOLp9OeFM9VUzHVxovfI4LXA,126
47
- pyadps-0.1.1.dist-info/RECORD,,