doppy 0.2.1__cp310-abi3-macosx_11_0_arm64.whl → 0.2.2__cp310-abi3-macosx_11_0_arm64.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/__init__.py CHANGED
@@ -1,4 +1,5 @@
1
1
  from doppy.product.stare import Stare
2
+ from doppy.product.wind import Options as WindOptions
2
3
  from doppy.product.wind import Wind
3
4
 
4
- __all__ = ["Stare", "Wind"]
5
+ __all__ = ["Stare", "Wind", "WindOptions"]
doppy/product/wind.py CHANGED
@@ -18,6 +18,11 @@ import doppy
18
18
  SelectionGroupKeyType: TypeAlias = tuple[int, int, tuple[int, ...]]
19
19
 
20
20
 
21
+ @dataclass
22
+ class Options:
23
+ azimuth_offset_deg: float | None
24
+
25
+
21
26
  @dataclass
22
27
  class Wind:
23
28
  time: npt.NDArray[np.datetime64]
@@ -45,6 +50,7 @@ class Wind:
45
50
  | Sequence[Path]
46
51
  | Sequence[bytes]
47
52
  | Sequence[BufferedIOBase],
53
+ options: Options | None = None,
48
54
  ) -> Wind:
49
55
  raws = doppy.raw.HaloHpl.from_srcs(data)
50
56
 
@@ -60,6 +66,9 @@ class Wind:
60
66
  if len(raw.time) == 0:
61
67
  raise doppy.exceptions.NoDataError("No suitable data for the wind product")
62
68
 
69
+ if options and options.azimuth_offset_deg:
70
+ raw.azimuth += options.azimuth_offset_deg
71
+
63
72
  groups = _group_scans_by_azimuth_rotation(raw)
64
73
  time_list = []
65
74
  elevation_list = []
@@ -104,6 +113,7 @@ class Wind:
104
113
  | Sequence[Path]
105
114
  | Sequence[bytes]
106
115
  | Sequence[BufferedIOBase],
116
+ options: Options | None = None,
107
117
  ) -> Wind:
108
118
  raws = doppy.raw.WindCube.from_vad_srcs(data)
109
119
 
@@ -119,6 +129,9 @@ class Wind:
119
129
  if len(raw.time) == 0:
120
130
  raise doppy.exceptions.NoDataError("No suitable data for the wind product")
121
131
 
132
+ if options and options.azimuth_offset_deg:
133
+ raw.azimuth += options.azimuth_offset_deg
134
+
122
135
  time_list = []
123
136
  elevation_list = []
124
137
  wind_list = []
@@ -159,6 +172,7 @@ class Wind:
159
172
  | Sequence[Path]
160
173
  | Sequence[bytes]
161
174
  | Sequence[BufferedIOBase],
175
+ options: Options | None = None,
162
176
  ) -> Wind:
163
177
  raws = doppy.raw.Wls70.from_srcs(data)
164
178
 
@@ -170,6 +184,20 @@ class Wind:
170
184
  .sorted_by_time()
171
185
  .non_strictly_increasing_timesteps_removed()
172
186
  )
187
+
188
+ if options and options.azimuth_offset_deg:
189
+ theta = np.deg2rad(options.azimuth_offset_deg)
190
+ cos_theta = np.cos(theta)
191
+ sin_theta = np.sin(theta)
192
+
193
+ meridional_wind = (
194
+ sin_theta * raw.zonal_wind + cos_theta * raw.meridional_wind
195
+ )
196
+ zonal_wind = cos_theta * raw.zonal_wind - sin_theta * raw.meridional_wind
197
+ else:
198
+ meridional_wind = raw.meridional_wind
199
+ zonal_wind = raw.zonal_wind
200
+
173
201
  mask = (
174
202
  np.isnan(raw.meridional_wind)
175
203
  | np.isnan(raw.zonal_wind)
@@ -178,8 +206,8 @@ class Wind:
178
206
  return Wind(
179
207
  time=raw.time,
180
208
  height=raw.altitude,
181
- zonal_wind=raw.zonal_wind,
182
- meridional_wind=raw.meridional_wind,
209
+ zonal_wind=zonal_wind,
210
+ meridional_wind=meridional_wind,
183
211
  vertical_wind=raw.vertical_wind,
184
212
  mask=mask,
185
213
  system_id=raw.system_id,
doppy/rs.abi3.so CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: doppy
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -1,12 +1,12 @@
1
- doppy-0.2.1.dist-info/METADATA,sha256=0T7yh-b9uQUGEeBymLzElKfO6tw2QAlDqffDPUNda7k,1789
2
- doppy-0.2.1.dist-info/WHEEL,sha256=Eyff-rEDSOF0Q7IZpSwsYe3r6zR3sNi9c9VlO0C9EVo,103
3
- doppy-0.2.1.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
- doppy-0.2.1.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
5
- doppy-0.2.1.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
1
+ doppy-0.2.2.dist-info/METADATA,sha256=D5HIkmOh9XCD5O0B1Vf8A4dSuSqLp5wEuEV9FKJNM70,1789
2
+ doppy-0.2.2.dist-info/WHEEL,sha256=Eyff-rEDSOF0Q7IZpSwsYe3r6zR3sNi9c9VlO0C9EVo,103
3
+ doppy-0.2.2.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
+ doppy-0.2.2.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
5
+ doppy-0.2.2.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=MAK-ZTx37gL7y-x3RbqN_QrZR9kjAiLxdIMn_c6M5UA,12151
9
- doppy/product/__init__.py,sha256=lyp88zs7GBk8uUzkj8lxaXPuYwPa52xXeTwf5qwFddU,103
8
+ doppy/product/wind.py,sha256=mL8Ru7Hefq8YBYFIklBkySO3OEoRQ32ZPgB3deIhO7c,13042
9
+ doppy/product/__init__.py,sha256=DwTrvhMY_Eq-RG3H6Qyg_R_E9ie1wv0ofKr_1rSJ4Sk,172
10
10
  doppy/product/stare.py,sha256=aMhOA5yXjcnwgzAp4GvLF1HT1cD-Zuqg9sEQIPlxWa0,19907
11
11
  doppy/bench.py,sha256=iVNYveMVGGRES2oe3Orsn31jQFCKTXOmxRFuFiJ8_OA,248
12
12
  doppy/netcdf.py,sha256=uEiJfqxXxHwe5ghT6OpIu8xeY1HgWDW1ENTBlFLOGtE,3416
@@ -25,5 +25,5 @@ doppy/raw/halo_bg.py,sha256=kO03yGlKS-DpMMGHYuy_BuidyeUL38TxT5vMn8H_8lE,4809
25
25
  doppy/raw/halo_hpl.py,sha256=VkWemJfGFu-tF-fkhjYwF6dCZPrNQanqL0NBFJVS-TQ,18485
26
26
  doppy/raw/windcube.py,sha256=ZaOswQJbVDPBYj5oU1pTYmsX8F-mKIbjJRZmLYEMXP0,9906
27
27
  doppy/__main__.py,sha256=zrKQJVj0k0ypBQCGK65Czt9G9FZ_qx3ussw6Q9VJ14g,346
28
- doppy/rs.abi3.so,sha256=ZL1C3AFu5SRDGfsmCXrJzL8yNxzDT4noGXkg7c1tlD0,2752832
29
- doppy-0.2.1.dist-info/RECORD,,
28
+ doppy/rs.abi3.so,sha256=401CPVp5BPllewqgL2SbsDbFLQvzaIdcTr8sKuj7mX0,2719712
29
+ doppy-0.2.2.dist-info/RECORD,,
File without changes