doppy 0.0.4__tar.gz → 0.0.5__tar.gz
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.
Potentially problematic release.
This version of doppy might be problematic. Click here for more details.
- {doppy-0.0.4 → doppy-0.0.5}/Cargo.lock +2 -2
- {doppy-0.0.4 → doppy-0.0.5}/Cargo.toml +1 -1
- {doppy-0.0.4 → doppy-0.0.5}/PKG-INFO +1 -1
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/product/wind.py +20 -15
- {doppy-0.0.4 → doppy-0.0.5}/LICENSE +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/README.md +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doppy_rs/Cargo.toml +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doppy_rs/src/lib.rs +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doppy_rs/src/raw/halo_hpl.rs +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doppy_rs/src/raw.rs +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doprs/.gitignore +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doprs/Cargo.toml +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doprs/src/lib.rs +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doprs/src/raw/error.rs +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doprs/src/raw/halo_hpl.rs +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/crates/doprs/src/raw.rs +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/pyproject.toml +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/__init__.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/__main__.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/bench.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/data/__init__.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/data/api.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/data/cache.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/data/exceptions.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/defaults.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/exceptions.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/netcdf.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/options.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/product/__init__.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/product/stare.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/py.typed +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/raw/__init__.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/raw/halo_bg.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/raw/halo_hpl.py +0 -0
- {doppy-0.0.4 → doppy-0.0.5}/src/doppy/raw/halo_sys_params.py +0 -0
|
@@ -106,7 +106,7 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
|
|
|
106
106
|
|
|
107
107
|
[[package]]
|
|
108
108
|
name = "doppy_rs"
|
|
109
|
-
version = "0.0.
|
|
109
|
+
version = "0.0.5"
|
|
110
110
|
dependencies = [
|
|
111
111
|
"doprs",
|
|
112
112
|
"numpy",
|
|
@@ -115,7 +115,7 @@ dependencies = [
|
|
|
115
115
|
|
|
116
116
|
[[package]]
|
|
117
117
|
name = "doprs"
|
|
118
|
-
version = "0.0.
|
|
118
|
+
version = "0.0.5"
|
|
119
119
|
dependencies = [
|
|
120
120
|
"chrono",
|
|
121
121
|
"rayon",
|
|
@@ -13,7 +13,6 @@ from scipy.ndimage import generic_filter
|
|
|
13
13
|
from sklearn.cluster import KMeans
|
|
14
14
|
|
|
15
15
|
import doppy
|
|
16
|
-
from doppy import options
|
|
17
16
|
|
|
18
17
|
# ngates, elevation angle, tuple of sorted azimuth angles
|
|
19
18
|
SelectionGroupKeyType: TypeAlias = tuple[int, int, tuple[int, ...]]
|
|
@@ -22,7 +21,7 @@ SelectionGroupKeyType: TypeAlias = tuple[int, int, tuple[int, ...]]
|
|
|
22
21
|
@dataclass
|
|
23
22
|
class Wind:
|
|
24
23
|
time: npt.NDArray[np.datetime64]
|
|
25
|
-
height: npt.NDArray[np.
|
|
24
|
+
height: npt.NDArray[np.float64]
|
|
26
25
|
zonal_wind: npt.NDArray[np.float64]
|
|
27
26
|
meridional_wind: npt.NDArray[np.float64]
|
|
28
27
|
vertical_wind: npt.NDArray[np.float64]
|
|
@@ -34,9 +33,9 @@ class Wind:
|
|
|
34
33
|
|
|
35
34
|
@functools.cached_property
|
|
36
35
|
def horizontal_wind_direction(self) -> npt.NDArray[np.float64]:
|
|
37
|
-
direction =
|
|
38
|
-
direction[direction < 0] += 2*np.pi
|
|
39
|
-
return np.degrees(direction)
|
|
36
|
+
direction = np.arctan2(self.zonal_wind, self.meridional_wind)
|
|
37
|
+
direction[direction < 0] += 2 * np.pi
|
|
38
|
+
return np.array(np.degrees(direction), dtype=np.float64)
|
|
40
39
|
|
|
41
40
|
@classmethod
|
|
42
41
|
def from_halo_data(
|
|
@@ -77,7 +76,7 @@ class Wind:
|
|
|
77
76
|
if not np.allclose(elevation, elevation[0]):
|
|
78
77
|
raise ValueError("Elevation is expected to stay same")
|
|
79
78
|
height = raw.radial_distance * np.sin(np.deg2rad(elevation[0]))
|
|
80
|
-
mask = _compute_mask(wind,
|
|
79
|
+
mask = _compute_mask(wind, rmse)
|
|
81
80
|
return Wind(
|
|
82
81
|
time=time,
|
|
83
82
|
height=height,
|
|
@@ -134,7 +133,9 @@ def _compute_wind(
|
|
|
134
133
|
return time, elevation[0], wind, rmse
|
|
135
134
|
|
|
136
135
|
|
|
137
|
-
def _compute_mask(
|
|
136
|
+
def _compute_mask(
|
|
137
|
+
wind: npt.NDArray[np.float64], rmse: npt.NDArray[np.float64]
|
|
138
|
+
) -> npt.NDArray[np.bool_]:
|
|
138
139
|
"""
|
|
139
140
|
Parameters
|
|
140
141
|
----------
|
|
@@ -144,20 +145,22 @@ def _compute_mask(wind, intensity, rmse):
|
|
|
144
145
|
rmse (time,range)
|
|
145
146
|
"""
|
|
146
147
|
|
|
147
|
-
def neighbour_diff(X):
|
|
148
|
+
def neighbour_diff(X: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]:
|
|
148
149
|
mdiff = np.max(np.abs(X - X[len(X) // 2]))
|
|
149
|
-
return mdiff
|
|
150
|
+
return np.array(mdiff, dtype=np.float64)
|
|
150
151
|
|
|
151
152
|
WIND_NEIGHBOUR_DIFFERENCE = 20
|
|
152
153
|
neighbour_mask = np.any(
|
|
153
|
-
generic_filter(wind, neighbour_diff, size=(1, 3, 1))
|
|
154
|
+
generic_filter(wind, neighbour_diff, size=(1, 3, 1))
|
|
155
|
+
> WIND_NEIGHBOUR_DIFFERENCE,
|
|
156
|
+
axis=2,
|
|
154
157
|
)
|
|
155
158
|
|
|
156
159
|
rmse_th = 5
|
|
157
|
-
return (rmse > rmse_th) | neighbour_mask
|
|
160
|
+
return np.array((rmse > rmse_th) | neighbour_mask, dtype=np.bool_)
|
|
158
161
|
|
|
159
162
|
|
|
160
|
-
def _group_scans(raw: doppy.raw.HaloHpl):
|
|
163
|
+
def _group_scans(raw: doppy.raw.HaloHpl) -> npt.NDArray[np.int64]:
|
|
161
164
|
if len(raw.time) < 4:
|
|
162
165
|
raise ValueError("Expected at least 4 profiles to compute wind profile")
|
|
163
166
|
if raw.time.dtype != "<M8[us]":
|
|
@@ -174,7 +177,7 @@ def _group_scans(raw: doppy.raw.HaloHpl):
|
|
|
174
177
|
"expected to be between 0.1 and 30 seconds"
|
|
175
178
|
)
|
|
176
179
|
scanstep_timediff_upperbound = 2 * scanstep_timediff
|
|
177
|
-
groups_by_time = -1 * np.ones_like(time, dtype=
|
|
180
|
+
groups_by_time = -1 * np.ones_like(time, dtype=np.int64)
|
|
178
181
|
groups_by_time[0] = 0
|
|
179
182
|
scan_index = 0
|
|
180
183
|
for i, (t_prev, t) in enumerate(zip(time[:-1], time[1:]), start=1):
|
|
@@ -185,11 +188,13 @@ def _group_scans(raw: doppy.raw.HaloHpl):
|
|
|
185
188
|
return _subgroup_scans(raw, groups_by_time)
|
|
186
189
|
|
|
187
190
|
|
|
188
|
-
def _subgroup_scans(
|
|
191
|
+
def _subgroup_scans(
|
|
192
|
+
raw: doppy.raw.HaloHpl, time_groups: npt.NDArray[np.int64]
|
|
193
|
+
) -> npt.NDArray[np.int64]:
|
|
189
194
|
"""
|
|
190
195
|
Groups scans further based on the azimuth angles
|
|
191
196
|
"""
|
|
192
|
-
group = -1 * np.ones_like(raw.time, dtype=
|
|
197
|
+
group = -1 * np.ones_like(raw.time, dtype=np.int64)
|
|
193
198
|
i = -1
|
|
194
199
|
for time_group in set(time_groups):
|
|
195
200
|
i += 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|