doppy 0.0.4__cp310-abi3-macosx_10_12_x86_64.whl → 0.0.5__cp310-abi3-macosx_10_12_x86_64.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.

Potentially problematic release.


This version of doppy might be problematic. Click here for more details.

doppy/product/wind.py CHANGED
@@ -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.datetime64]
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 = np.arctan2(self.zonal_wind, self.meridional_wind)
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, raw.intensity, rmse)
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(wind, intensity, rmse):
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)) > WIND_NEIGHBOUR_DIFFERENCE, axis=2
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=int)
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(raw: doppy.raw.HaloHpl, time_groups: npt.NDArray[np.int]):
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=int)
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
doppy/rs.abi3.so CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: doppy
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -1,11 +1,11 @@
1
- doppy-0.0.4.dist-info/METADATA,sha256=UT81EmsMyVTsMwm3ObS-Lz3lhMZet5HpZqN4VBWetuk,1583
2
- doppy-0.0.4.dist-info/WHEEL,sha256=6lWwZR4XDMZCOGKxNbitp3oy9XC3VeW-i3RwU9wYcOc,105
3
- doppy-0.0.4.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
- doppy-0.0.4.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
5
- doppy-0.0.4.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
1
+ doppy-0.0.5.dist-info/METADATA,sha256=n_NUKr3yktaNmPOZY4ERv9-D9G9FfmE-c2jfwnRWdjI,1583
2
+ doppy-0.0.5.dist-info/WHEEL,sha256=6lWwZR4XDMZCOGKxNbitp3oy9XC3VeW-i3RwU9wYcOc,105
3
+ doppy-0.0.5.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
+ doppy-0.0.5.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
5
+ doppy-0.0.5.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
6
6
  doppy/options.py,sha256=73BDODO4OYHn2qOshhwz6u6G3J1kNd3uj6P0a3V4HBE,205
7
7
  doppy/__init__.py,sha256=Z9aEUlbPRWRUAoB8_-djkgrJuS4-6pjem4-mVSB6Z9I,191
8
- doppy/product/wind.py,sha256=kyopdXhGYGpXo2o3ml9DRsWl3CwXIXksTGMBSE33M1Q,7327
8
+ doppy/product/wind.py,sha256=GA8tzceKYSlBg0ic-gwGXtiVBlpD85V-fDTSnxsZs9E,7573
9
9
  doppy/product/__init__.py,sha256=lyp88zs7GBk8uUzkj8lxaXPuYwPa52xXeTwf5qwFddU,103
10
10
  doppy/product/stare.py,sha256=rqZJkC-y_aDJFiVnZZj3UzRboR6rzbV3Tlggmzrl16w,19600
11
11
  doppy/bench.py,sha256=iVNYveMVGGRES2oe3Orsn31jQFCKTXOmxRFuFiJ8_OA,248
@@ -22,5 +22,5 @@ doppy/raw/__init__.py,sha256=GrBbsTkoD2DH_Xwt6apZGwpT1cCIbfOWHzdQVjAPVh0,151
22
22
  doppy/raw/halo_bg.py,sha256=kO03yGlKS-DpMMGHYuy_BuidyeUL38TxT5vMn8H_8lE,4809
23
23
  doppy/raw/halo_hpl.py,sha256=Vp90S_nL9nhkQ4SkBNaFyr8i5kSWLzq6d50kvG3jW6I,17900
24
24
  doppy/__main__.py,sha256=zrKQJVj0k0ypBQCGK65Czt9G9FZ_qx3ussw6Q9VJ14g,346
25
- doppy/rs.abi3.so,sha256=CcSjMt_tt9R4WNJ87IpklK_btyk8lU9-ksMHQ9dVHyA,2716472
26
- doppy-0.0.4.dist-info/RECORD,,
25
+ doppy/rs.abi3.so,sha256=7gsnRLxHr7LW8LJn_ZuG4IGHX_ymtIqfJsz_Z8-_Cyg,2775816
26
+ doppy-0.0.5.dist-info/RECORD,,
File without changes