doppy 0.5.3__cp310-abi3-macosx_11_0_arm64.whl → 0.5.5__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/raw/__init__.py CHANGED
@@ -3,5 +3,14 @@ from .halo_hpl import HaloHpl
3
3
  from .halo_sys_params import HaloSysParams
4
4
  from .windcube import WindCube, WindCubeFixed
5
5
  from .wls70 import Wls70
6
+ from .wls77 import Wls77
6
7
 
7
- __all__ = ["HaloHpl", "HaloBg", "HaloSysParams", "WindCube", "WindCubeFixed", "Wls70"]
8
+ __all__ = [
9
+ "HaloHpl",
10
+ "HaloBg",
11
+ "HaloSysParams",
12
+ "WindCube",
13
+ "WindCubeFixed",
14
+ "Wls70",
15
+ "Wls77",
16
+ ]
doppy/raw/wls77.py ADDED
@@ -0,0 +1,163 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from datetime import datetime, timezone
5
+ from io import BufferedIOBase
6
+ from pathlib import Path
7
+ from typing import Any, Sequence
8
+
9
+ import numpy as np
10
+ import numpy.typing as npt
11
+ from numpy import datetime64
12
+
13
+ import doppy
14
+ from doppy import exceptions
15
+ from doppy.raw.utils import bytes_from_src
16
+ from doppy.utils import merge_all_equal
17
+
18
+
19
+ @dataclass
20
+ class Wls77:
21
+ time: npt.NDArray[datetime64] # dim: (time, )
22
+ altitude: npt.NDArray[np.float64] # dim: (altitude, )
23
+ position: npt.NDArray[np.float64] # dim: (time, )
24
+ temperature: npt.NDArray[np.float64] # dim: (time, )
25
+ wiper_count: npt.NDArray[np.float64] # dim: (time, )
26
+ cnr: npt.NDArray[np.float64] # dim: (time, altitude)
27
+ radial_velocity: npt.NDArray[np.float64] # dim: (time, altitude)
28
+ radial_velocity_deviation: npt.NDArray[np.float64] # dim: (time, altitude)
29
+ wind_speed: npt.NDArray[np.float64] # dim: (time, altitude)
30
+ wind_direction: npt.NDArray[np.float64] # dim: (time, altitude)
31
+ zonal_wind: npt.NDArray[np.float64] # u := zonal wind?, dim: (time, altitude)
32
+ meridional_wind: npt.NDArray[
33
+ np.float64
34
+ ] # v := meridional wind?, dim: (time, altitude)
35
+ vertical_wind: npt.NDArray[np.float64] # w := vertical wind?, dim: (time, altitude)
36
+ cnr_threshold: float
37
+ system_id: str
38
+
39
+ @classmethod
40
+ def from_srcs(
41
+ cls, data: Sequence[str | bytes | Path | BufferedIOBase]
42
+ ) -> list[Wls77]:
43
+ data_bytes = [bytes_from_src(src) for src in data]
44
+ raws = doppy.rs.raw.wls77.from_bytes_srcs(data_bytes)
45
+ try:
46
+ return [_raw_rs_to_wls77(r) for r in raws]
47
+ except RuntimeError as err:
48
+ raise exceptions.RawParsingError(err) from err
49
+
50
+ @classmethod
51
+ def from_src(cls, data: str | Path | bytes | BufferedIOBase) -> Wls77:
52
+ data_bytes = bytes_from_src(data)
53
+ try:
54
+ return _raw_rs_to_wls77(doppy.rs.raw.wls77.from_bytes_src(data_bytes))
55
+ except RuntimeError as err:
56
+ raise exceptions.RawParsingError(err) from err
57
+
58
+ def __getitem__(
59
+ self,
60
+ index: int
61
+ | slice
62
+ | list[int]
63
+ | npt.NDArray[np.int64]
64
+ | npt.NDArray[np.bool_]
65
+ | tuple[slice, slice],
66
+ ) -> Wls77:
67
+ if isinstance(index, (int, slice, list, np.ndarray)):
68
+ return Wls77(
69
+ time=self.time[index],
70
+ altitude=self.altitude,
71
+ position=self.position[index],
72
+ temperature=self.temperature[index],
73
+ wiper_count=self.wiper_count[index],
74
+ cnr=self.cnr[index],
75
+ radial_velocity=self.radial_velocity[index],
76
+ radial_velocity_deviation=self.radial_velocity_deviation[index],
77
+ wind_speed=self.wind_speed[index],
78
+ wind_direction=self.wind_direction[index],
79
+ zonal_wind=self.zonal_wind[index],
80
+ meridional_wind=self.meridional_wind[index],
81
+ vertical_wind=self.vertical_wind[index],
82
+ system_id=self.system_id,
83
+ cnr_threshold=self.cnr_threshold,
84
+ )
85
+ raise TypeError
86
+
87
+ def sorted_by_time(self) -> Wls77:
88
+ sort_indices = np.argsort(self.time)
89
+ return self[sort_indices]
90
+
91
+ @classmethod
92
+ def merge(cls, raws: Sequence[Wls77]) -> Wls77:
93
+ return cls(
94
+ time=np.concatenate(tuple(r.time for r in raws)),
95
+ altitude=raws[0].altitude,
96
+ position=np.concatenate(tuple(r.position for r in raws)),
97
+ temperature=np.concatenate(tuple(r.temperature for r in raws)),
98
+ wiper_count=np.concatenate(tuple(r.wiper_count for r in raws)),
99
+ cnr=np.concatenate(tuple(r.cnr for r in raws)),
100
+ radial_velocity=np.concatenate(tuple(r.radial_velocity for r in raws)),
101
+ radial_velocity_deviation=np.concatenate(
102
+ tuple(r.radial_velocity_deviation for r in raws)
103
+ ),
104
+ wind_speed=np.concatenate(tuple(r.wind_speed for r in raws)),
105
+ wind_direction=np.concatenate(tuple(r.wind_direction for r in raws)),
106
+ zonal_wind=np.concatenate(tuple(r.zonal_wind for r in raws)),
107
+ meridional_wind=np.concatenate(tuple(r.meridional_wind for r in raws)),
108
+ vertical_wind=np.concatenate(tuple(r.vertical_wind for r in raws)),
109
+ system_id=merge_all_equal("system_id", [r.system_id for r in raws]),
110
+ cnr_threshold=merge_all_equal(
111
+ "cnr_threshold", [r.cnr_threshold for r in raws]
112
+ ),
113
+ )
114
+
115
+ def non_strictly_increasing_timesteps_removed(self) -> Wls77:
116
+ if len(self.time) == 0:
117
+ return self
118
+ mask = np.ones_like(self.time, dtype=np.bool_)
119
+ latest_time = self.time[0]
120
+ for i, t in enumerate(self.time[1:], start=1):
121
+ if t <= latest_time:
122
+ mask[i] = False
123
+ else:
124
+ latest_time = t
125
+ return self[mask]
126
+
127
+
128
+ def _raw_rs_to_wls77(
129
+ raw: dict[str, Any],
130
+ ) -> Wls77:
131
+ time_ts = raw["time"]
132
+ time = np.array(
133
+ [
134
+ datetime64(datetime.fromtimestamp(ts, timezone.utc).replace(tzinfo=None))
135
+ for ts in time_ts
136
+ ]
137
+ )
138
+
139
+ n = time.size
140
+
141
+ return Wls77(
142
+ time=time,
143
+ altitude=np.array(raw["altitude"], dtype=np.float64),
144
+ position=np.array(raw["position"], dtype=np.float64),
145
+ temperature=np.array(raw["temperature"], dtype=np.float64),
146
+ wiper_count=np.array(raw["wiper_count"], dtype=np.float64),
147
+ cnr=np.array(raw["cnr"], dtype=np.float64).reshape(n, -1),
148
+ radial_velocity=np.array(raw["radial_velocity"], dtype=np.float64).reshape(
149
+ n, -1
150
+ ),
151
+ radial_velocity_deviation=np.array(
152
+ raw["radial_velocity_deviation"], dtype=np.float64
153
+ ).reshape(n, -1),
154
+ wind_speed=np.array(raw["wind_speed"], dtype=np.float64).reshape(n, -1),
155
+ wind_direction=np.array(raw["wind_direction"], dtype=np.float64).reshape(n, -1),
156
+ zonal_wind=np.array(raw["zonal_wind"], dtype=np.float64).reshape(n, -1),
157
+ meridional_wind=np.array(raw["meridional_wind"], dtype=np.float64).reshape(
158
+ n, -1
159
+ ),
160
+ vertical_wind=np.array(raw["vertical_wind"], dtype=np.float64).reshape(n, -1),
161
+ cnr_threshold=raw["cnr_threshold"],
162
+ system_id=raw["system_id"],
163
+ )
doppy/rs.abi3.so CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: doppy
3
- Version: 0.5.3
3
+ Version: 0.5.5
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -28,6 +28,7 @@ Requires-Dist: maturin==1.8 ; extra == 'dev'
28
28
  Requires-Dist: release-version ; extra == 'dev'
29
29
  Requires-Dist: pre-commit ; extra == 'dev'
30
30
  Requires-Dist: xarray[io] ; extra == 'dev'
31
+ Requires-Dist: seaborn ; extra == 'dev'
31
32
  Provides-Extra: dev
32
33
  License-File: LICENSE
33
34
  License-File: LICENSE
@@ -1,32 +1,33 @@
1
- doppy-0.5.3.dist-info/METADATA,sha256=iaWUuv-a0gsBRjMkHS05y9_YeS2sWph8ixuF43UAHFc,4315
2
- doppy-0.5.3.dist-info/WHEEL,sha256=j3ku1HwtRttgdyoybPiqmsz03FP6lDUkPQNFM63xZJo,103
3
- doppy-0.5.3.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
- doppy-0.5.3.dist-info/licenses/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
5
- doppy/options.py,sha256=73BDODO4OYHn2qOshhwz6u6G3J1kNd3uj6P0a3V4HBE,205
1
+ doppy-0.5.5.dist-info/METADATA,sha256=27OPMIIi1ogb8fn0-B0agxyj7SISbbeH0IEzoVZOpL8,4355
2
+ doppy-0.5.5.dist-info/WHEEL,sha256=6SJFcjb7LrrHSS0REgEixoO-eTgWD5-kklKS9aVl8Lw,103
3
+ doppy-0.5.5.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
+ doppy-0.5.5.dist-info/licenses/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
6
5
  doppy/__init__.py,sha256=Z9aEUlbPRWRUAoB8_-djkgrJuS4-6pjem4-mVSB6Z9I,191
7
- doppy/product/turbulence.py,sha256=hajTHFr6XXdul8oU9dw4Y58kBwRpUBIfiOfTcvSjq7M,8606
8
- doppy/product/wind.py,sha256=efBfYalILN2VvDiGpxP04mob-mCrdQFS9tdhReeyXiU,16787
9
- doppy/product/__init__.py,sha256=C6s9cX20m9UwRsKo1lZH6TnYFfM5KmsX5MPUyShbgl4,235
10
- doppy/product/stare_depol.py,sha256=gSlD13jGLRmHyTDADFs_MO6ECos6wwKF-TL7G7NwHAA,10718
11
- doppy/product/noise_utils.py,sha256=fP2bK2xfCUClQcDc_1FmLUUiU2d0KycrxkXLC5jmJAc,2629
12
- doppy/product/stare.py,sha256=RVHcW8eep91bH2GVobqDqsqswdRaFZ5SY4K_5fLSF3I,27180
6
+ doppy/__main__.py,sha256=zrKQJVj0k0ypBQCGK65Czt9G9FZ_qx3ussw6Q9VJ14g,346
13
7
  doppy/bench.py,sha256=xUsmwLCjNLXwO9l-_SCfq62jxXJ4eiwkS-WlCejcqZE,308
14
- doppy/netcdf.py,sha256=PuTCVK4yT4dkObo_w2D1lJroHg7l4DJFZxOi6jr1DkQ,4078
15
- doppy/utils.py,sha256=cY-tWrArrROX7lg_zJ2M4QJ6GUnU_BjhkUYL5aG9kbA,790
16
- doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- doppy/exceptions.py,sha256=OzdLXmKs3qZrvzwaI0pxjzpM2w9J5Of7dCo_Ekygecc,183
18
- doppy/defaults.py,sha256=-jR_xAVLf_soZNDu3uJ6mhOZa9L1tfKtt0k0tI6Rd9s,472
19
- doppy/data/cache.py,sha256=cxCZ7HyEQt2EKAGEiMqx3wJ2-5Y3hEAEPQ_XB4gKlkk,1160
20
8
  doppy/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
9
  doppy/data/api.py,sha256=hUIqyCq1wFu89gamK7xK8R58eXAODWvLQHaaS5eu6OY,1875
10
+ doppy/data/cache.py,sha256=cxCZ7HyEQt2EKAGEiMqx3wJ2-5Y3hEAEPQ_XB4gKlkk,1160
22
11
  doppy/data/exceptions.py,sha256=6CS6OHIWq8CqlxiceEvC1j0EfWUYoIfM7dW88apQVn4,89
23
- doppy/raw/halo_sys_params.py,sha256=jclE4RbVg63iS3rVNYzvErKYAa3CI1q64xj3oai5tMc,5250
24
- doppy/raw/__init__.py,sha256=4pj4xSK9rA0XEfM79NsRBRYId7GaJRDCyPABxbEm63g,260
25
- doppy/raw/wls70.py,sha256=OfPczHZPKX4iqCcyjSv0nmkr1osy4pu6krNUi0-G0vM,6319
26
- doppy/raw/utils.py,sha256=EOWIaxAZIiRYa9dI1j50cSd4I058Zq7sz1HOeipZFTg,422
12
+ doppy/defaults.py,sha256=-jR_xAVLf_soZNDu3uJ6mhOZa9L1tfKtt0k0tI6Rd9s,472
13
+ doppy/exceptions.py,sha256=OzdLXmKs3qZrvzwaI0pxjzpM2w9J5Of7dCo_Ekygecc,183
14
+ doppy/netcdf.py,sha256=PuTCVK4yT4dkObo_w2D1lJroHg7l4DJFZxOi6jr1DkQ,4078
15
+ doppy/options.py,sha256=73BDODO4OYHn2qOshhwz6u6G3J1kNd3uj6P0a3V4HBE,205
16
+ doppy/product/__init__.py,sha256=C6s9cX20m9UwRsKo1lZH6TnYFfM5KmsX5MPUyShbgl4,235
17
+ doppy/product/noise_utils.py,sha256=fP2bK2xfCUClQcDc_1FmLUUiU2d0KycrxkXLC5jmJAc,2629
18
+ doppy/product/stare.py,sha256=RVHcW8eep91bH2GVobqDqsqswdRaFZ5SY4K_5fLSF3I,27180
19
+ doppy/product/stare_depol.py,sha256=gSlD13jGLRmHyTDADFs_MO6ECos6wwKF-TL7G7NwHAA,10718
20
+ doppy/product/turbulence.py,sha256=hajTHFr6XXdul8oU9dw4Y58kBwRpUBIfiOfTcvSjq7M,8606
21
+ doppy/product/wind.py,sha256=efBfYalILN2VvDiGpxP04mob-mCrdQFS9tdhReeyXiU,16787
22
+ doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ doppy/raw/__init__.py,sha256=HE-7x27dfw-LJTvReZfspqzNx63Nl0v5ACdYs9EuOFQ,325
27
24
  doppy/raw/halo_bg.py,sha256=8t9j-SUF1yJht3vrT6KAYJQyxcg3W-0zr8h0jAEhWes,5815
28
25
  doppy/raw/halo_hpl.py,sha256=tK0H6LAOcoWqF4vvNu8VRCYq_spvcSTHRM4ju4gx5Lo,16828
26
+ doppy/raw/halo_sys_params.py,sha256=jclE4RbVg63iS3rVNYzvErKYAa3CI1q64xj3oai5tMc,5250
27
+ doppy/raw/utils.py,sha256=EOWIaxAZIiRYa9dI1j50cSd4I058Zq7sz1HOeipZFTg,422
29
28
  doppy/raw/windcube.py,sha256=HKAlU-TUVqA1sefRLOY5skM1twQaVe-MExlZoI40rK4,19149
30
- doppy/__main__.py,sha256=zrKQJVj0k0ypBQCGK65Czt9G9FZ_qx3ussw6Q9VJ14g,346
31
- doppy/rs.abi3.so,sha256=uiPJ3LzwB6ubEzb_0cHGUyTAK139eLA76vZI_U4ScDU,2574272
32
- doppy-0.5.3.dist-info/RECORD,,
29
+ doppy/raw/wls70.py,sha256=OfPczHZPKX4iqCcyjSv0nmkr1osy4pu6krNUi0-G0vM,6319
30
+ doppy/raw/wls77.py,sha256=ciRNy0U1a4OuxbsHGt9HMHAa3Qqukaw57QeNQdkWUj8,6460
31
+ doppy/rs.abi3.so,sha256=iGFxwMjC2pA24Q6PjrCzCkobcyTmQtGsjBJXNgAvnv8,2595280
32
+ doppy/utils.py,sha256=cY-tWrArrROX7lg_zJ2M4QJ6GUnU_BjhkUYL5aG9kbA,790
33
+ doppy-0.5.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.8.2)
2
+ Generator: maturin (1.9.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp310-abi3-macosx_11_0_arm64