doppy 0.5.3__cp310-abi3-win_amd64.whl → 0.5.5__cp310-abi3-win_amd64.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 +10 -1
- doppy/raw/wls77.py +163 -0
- doppy/rs.pyd +0 -0
- {doppy-0.5.3.dist-info → doppy-0.5.5.dist-info}/METADATA +2 -1
- {doppy-0.5.3.dist-info → doppy-0.5.5.dist-info}/RECORD +12 -11
- {doppy-0.5.3.dist-info → doppy-0.5.5.dist-info}/WHEEL +1 -1
- {doppy-0.5.3.dist-info → doppy-0.5.5.dist-info}/entry_points.txt +0 -0
- {doppy-0.5.3.dist-info → doppy-0.5.5.dist-info}/licenses/LICENSE +0 -0
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__ = [
|
|
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.pyd
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: doppy
|
|
3
|
-
Version: 0.5.
|
|
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.
|
|
2
|
-
doppy-0.5.
|
|
3
|
-
doppy-0.5.
|
|
4
|
-
doppy-0.5.
|
|
1
|
+
doppy-0.5.5.dist-info/METADATA,sha256=jHV3K-KU8bT9jr1hlyVmPFji42zYAYhegtUTtSxJikc,4454
|
|
2
|
+
doppy-0.5.5.dist-info/WHEEL,sha256=mmifbMS_TwezFBRZjXhdsplN4iaquFqolunR3It-mcU,95
|
|
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=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
5
|
+
doppy/__init__.py,sha256=Af7_8p3oN1nTqS9fo0mVKVuiKf5CAEK69uQa32CSFBA,197
|
|
6
|
+
doppy/__main__.py,sha256=38hIWWfanILuBBGorQiAaleSC4qYJoIxuzVBkxf7Dng,371
|
|
5
7
|
doppy/bench.py,sha256=X4yPXFPAM708ptzXKDYxVBOC0E3cMj_KxXzmD_Q9_RM,321
|
|
8
|
+
doppy/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
9
|
doppy/data/api.py,sha256=IoLRodfITNHs4Pb2IvVvOjSirSeK-xNoSO4tsQYjsKc,1933
|
|
7
10
|
doppy/data/cache.py,sha256=ERFzH-KjLLXV8fCePsewTepKZXmLwtXxeazmHiFdA80,1203
|
|
8
11
|
doppy/data/exceptions.py,sha256=JOyekvUO-Ew4ZVezf3_IxZOrPN0IksfUILd8R2YcSts,95
|
|
9
|
-
doppy/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
12
|
doppy/defaults.py,sha256=jZvGmHJkvOzFpwy97L6Sj9-bnF0-nvq0-zNNWxM_WpE,490
|
|
11
13
|
doppy/exceptions.py,sha256=IUF8D_d-QOvtemUSEMg1raXDWA3dSXQ2MUBvlwgm1rU,197
|
|
12
14
|
doppy/netcdf.py,sha256=R41GVQQrjo3z4Pqi-Rh9QeF7nU8HsYT2jY9Bd8xDmDQ,4212
|
|
13
15
|
doppy/options.py,sha256=uyIKM_G2GtbmV6Gve8o13eIShQqUwsnYZ41mhX2ypGE,218
|
|
16
|
+
doppy/product/__init__.py,sha256=xoBEXuhid-bvoof5Ogzpt1dKIhJgNMRyrAinCqUOUUI,241
|
|
14
17
|
doppy/product/noise_utils.py,sha256=Bro3T8uMY9MmJcrXbOl_QKIU7OXVRUs_R6Norl5Tv3Q,2735
|
|
15
18
|
doppy/product/stare.py,sha256=A_Xy6nIScnCUlEoziZ164aIW1HVqE7WogCcL5Ljpc_o,28009
|
|
16
19
|
doppy/product/stare_depol.py,sha256=GkS-60Izk-rF9PnHPtOgAssr--K4ddzQHUlyLZ7JNkU,11026
|
|
17
20
|
doppy/product/turbulence.py,sha256=RHvQlNobnXiF2Vx8OuvTYe7BIibmTNNXpHa7X4BfGbQ,8870
|
|
18
21
|
doppy/product/wind.py,sha256=SbVM_AyLJtIggOb3PHLTak6majHaBMFJHNX36wRti1k,17298
|
|
19
|
-
doppy/product/__init__.py,sha256=xoBEXuhid-bvoof5Ogzpt1dKIhJgNMRyrAinCqUOUUI,241
|
|
20
22
|
doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
+
doppy/raw/__init__.py,sha256=QqAPpV53Xbz3tHo4zCYv9_pgLYw_F2YIRH2-Mg9l2gI,341
|
|
21
24
|
doppy/raw/halo_bg.py,sha256=TrqJDUXa1atW2w4UDN9PPx2Mzrc7D9Q2Ndph0yB65p0,5988
|
|
22
25
|
doppy/raw/halo_hpl.py,sha256=ap9WGBSHCYtLDZ89TaTXbHJHIwT6y3y-U0wO1kCR0o8,17304
|
|
23
26
|
doppy/raw/halo_sys_params.py,sha256=9aZpAgaLFniADjYv7EO8wKtmBD6McJP2v7YUz94hrTM,5385
|
|
24
27
|
doppy/raw/utils.py,sha256=pBeBk87_LMxop14_RK5Xj64iYBMu8AhH-IqBRoGgUzE,436
|
|
25
28
|
doppy/raw/windcube.py,sha256=FBoiLHXNluN2HISe6OO5TE32BtZYTuvSwyvcYIafLtE,19626
|
|
26
29
|
doppy/raw/wls70.py,sha256=lWSnuZlmdCGqrlYt6SUDFvPRBOOdtt6LiDiu_nhnPiU,6494
|
|
27
|
-
doppy/raw/
|
|
30
|
+
doppy/raw/wls77.py,sha256=SOIFGC1GhoAPGePH6B-fAuyWqfW5jevi1zbku9JOBng,6623
|
|
31
|
+
doppy/rs.pyd,sha256=E7YIo42YI4WPQik6Y4HvcU9oFTiNy7ukuMUSwOyCIu8,2200576
|
|
28
32
|
doppy/utils.py,sha256=2PwDiO8GyMjsHC-EYcTGyN2mEfPaCi3hhEn2twETOl0,814
|
|
29
|
-
doppy/
|
|
30
|
-
doppy/__main__.py,sha256=38hIWWfanILuBBGorQiAaleSC4qYJoIxuzVBkxf7Dng,371
|
|
31
|
-
doppy/rs.pyd,sha256=dYGsL7vhYg7BOhaFHI3YVYSjqQpni8hy_nxj92bXxRQ,2164224
|
|
32
|
-
doppy-0.5.3.dist-info/RECORD,,
|
|
33
|
+
doppy-0.5.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|