doppy 0.0.1__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/__init__.py +6 -0
- doppy/__main__.py +25 -0
- doppy/bench.py +12 -0
- doppy/data/__init__.py +0 -0
- doppy/data/api.py +44 -0
- doppy/data/cache.py +34 -0
- doppy/data/exceptions.py +6 -0
- doppy/defaults.py +3 -0
- doppy/exceptions.py +10 -0
- doppy/netcdf.py +113 -0
- doppy/options.py +13 -0
- doppy/product/__init__.py +3 -0
- doppy/product/stare.py +579 -0
- doppy/raw/__init__.py +5 -0
- doppy/raw/halo_bg.py +142 -0
- doppy/raw/halo_hpl.py +507 -0
- doppy/raw/halo_sys_params.py +104 -0
- doppy/rs.pyd +0 -0
- doppy-0.0.1.dist-info/METADATA +42 -0
- doppy-0.0.1.dist-info/RECORD +24 -0
- doppy-0.0.1.dist-info/WHEEL +4 -0
- doppy-0.0.1.dist-info/entry_points.txt +2 -0
- doppy-0.0.1.dist-info/license_files/LICENSE +21 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import io
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from io import BufferedIOBase
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Iterable
|
|
9
|
+
|
|
10
|
+
import numpy as np
|
|
11
|
+
import numpy.typing as npt
|
|
12
|
+
from numpy import datetime64
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class HaloSysParams:
|
|
17
|
+
time: npt.NDArray[datetime64] # dim: (time, )
|
|
18
|
+
internal_temperature: npt.NDArray[np.float64] # dim: (time, ), unit: degree Celsius
|
|
19
|
+
internal_relative_humidity: npt.NDArray[np.float64] # dim: (time, )
|
|
20
|
+
supply_voltage: npt.NDArray[np.float64] # dim: (time, )
|
|
21
|
+
acquisition_card_temperature: npt.NDArray[np.float64] # dim: (time, )
|
|
22
|
+
pitch: npt.NDArray[np.float64] # dim: (time, )
|
|
23
|
+
roll: npt.NDArray[np.float64] # dim: (time, )
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_src(cls, data: str | Path | bytes | BufferedIOBase) -> HaloSysParams:
|
|
27
|
+
if isinstance(data, str):
|
|
28
|
+
path = Path(data)
|
|
29
|
+
with path.open("rb") as f:
|
|
30
|
+
return _from_src(f)
|
|
31
|
+
elif isinstance(data, Path):
|
|
32
|
+
with data.open("rb") as f:
|
|
33
|
+
return _from_src(f)
|
|
34
|
+
elif isinstance(data, bytes):
|
|
35
|
+
return _from_src(io.BytesIO(data))
|
|
36
|
+
elif isinstance(data, BufferedIOBase):
|
|
37
|
+
return _from_src(data)
|
|
38
|
+
else:
|
|
39
|
+
raise TypeError("Unsupported data type")
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def merge(cls, raws: Iterable[HaloSysParams]) -> HaloSysParams:
|
|
43
|
+
return cls(
|
|
44
|
+
np.concatenate(tuple(r.time for r in raws)),
|
|
45
|
+
np.concatenate(tuple(r.internal_temperature for r in raws)),
|
|
46
|
+
np.concatenate(tuple(r.internal_relative_humidity for r in raws)),
|
|
47
|
+
np.concatenate(tuple(r.supply_voltage for r in raws)),
|
|
48
|
+
np.concatenate(tuple(r.acquisition_card_temperature for r in raws)),
|
|
49
|
+
np.concatenate(tuple(r.pitch for r in raws)),
|
|
50
|
+
np.concatenate(tuple(r.roll for r in raws)),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
def __getitem__(
|
|
54
|
+
self,
|
|
55
|
+
index: int | slice | list[int] | npt.NDArray[np.int64] | npt.NDArray[np.bool_],
|
|
56
|
+
) -> HaloSysParams:
|
|
57
|
+
if isinstance(index, (int, slice, list, np.ndarray)):
|
|
58
|
+
return HaloSysParams(
|
|
59
|
+
self.time[index],
|
|
60
|
+
self.internal_temperature[index],
|
|
61
|
+
self.internal_relative_humidity[index],
|
|
62
|
+
self.supply_voltage[index],
|
|
63
|
+
self.acquisition_card_temperature[index],
|
|
64
|
+
self.pitch[index],
|
|
65
|
+
self.roll[index],
|
|
66
|
+
)
|
|
67
|
+
raise TypeError
|
|
68
|
+
|
|
69
|
+
def sorted_by_time(self) -> HaloSysParams:
|
|
70
|
+
sort_indices = np.argsort(self.time)
|
|
71
|
+
return self[sort_indices]
|
|
72
|
+
|
|
73
|
+
def non_strictly_increasing_timesteps_removed(self) -> HaloSysParams:
|
|
74
|
+
is_increasing = np.insert(np.diff(self.time).astype(int) > 0, 0, True)
|
|
75
|
+
return self[is_increasing]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _from_src(data: BufferedIOBase) -> HaloSysParams:
|
|
79
|
+
data_bytes = data.read().strip().replace(b",", b".").replace(b"\x00", b"")
|
|
80
|
+
a = data_bytes.strip().split(b"\r\n")
|
|
81
|
+
b = [r.split(b"\t") for r in a]
|
|
82
|
+
arr = np.array(b)
|
|
83
|
+
if arr.shape[1] != 7:
|
|
84
|
+
raise ValueError("Unexpected data fromat")
|
|
85
|
+
|
|
86
|
+
def timestr2datetime64_12H(datetime_bytes: bytes) -> np.datetime64:
|
|
87
|
+
return datetime64(
|
|
88
|
+
datetime.strptime(datetime_bytes.decode("utf-8"), "%m/%d/%Y %I:%M:%S %p"),
|
|
89
|
+
"s",
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def timestr2datetime64_24H(datetime_bytes: bytes) -> np.datetime64:
|
|
93
|
+
return datetime64(
|
|
94
|
+
datetime.strptime(datetime_bytes.decode("utf-8"), "%d/%m/%Y %H:%M:%S"), "s"
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
arr_time = np.full_like(arr[:, 0], np.datetime64("NaT"), dtype="datetime64[s]")
|
|
98
|
+
for i, time in enumerate(arr[:, 0]):
|
|
99
|
+
try:
|
|
100
|
+
arr_time[i] = timestr2datetime64_12H(time)
|
|
101
|
+
except ValueError:
|
|
102
|
+
arr_time[i] = timestr2datetime64_24H(time)
|
|
103
|
+
arr_others = np.vectorize(float)(arr[:, 1:])
|
|
104
|
+
return HaloSysParams(arr_time, *arr_others.T)
|
doppy/rs.pyd
ADDED
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: doppy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Dist: requests
|
|
13
|
+
Requires-Dist: urllib3
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
Requires-Dist: netCDF4
|
|
16
|
+
Requires-Dist: typer[all]
|
|
17
|
+
Requires-Dist: matplotlib
|
|
18
|
+
Requires-Dist: scikit-learn
|
|
19
|
+
Requires-Dist: scipy
|
|
20
|
+
Requires-Dist: mypy ; extra == 'dev'
|
|
21
|
+
Requires-Dist: ruff ; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest ; extra == 'dev'
|
|
23
|
+
Requires-Dist: types-requests ; extra == 'dev'
|
|
24
|
+
Requires-Dist: py-spy ; extra == 'dev'
|
|
25
|
+
Requires-Dist: maturin ; extra == 'dev'
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Summary: Doppler lidar processing
|
|
30
|
+
Author: Niko Leskinen <niko.leskinen@fmi.fi>
|
|
31
|
+
Author-email: Niko Leskinen <niko.leskinen@fmi.fi>
|
|
32
|
+
Requires-Python: >=3.10
|
|
33
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
34
|
+
Project-URL: Homepage, https://github.com/actris-cloudnet/doppy
|
|
35
|
+
Project-URL: Repository, https://github.com/actris-cloudnet/doppy
|
|
36
|
+
Project-URL: Changelog, https://github.com/actris-cloudnet/doppy/blob/main/CHANGELOG.md
|
|
37
|
+
Project-URL: Bug Tracker, https://github.com/actris-cloudnet/doppy/issues
|
|
38
|
+
|
|
39
|
+
# Doppy - Wind doppler lidar processing
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
doppy-0.0.1.dist-info/METADATA,sha256=pUDUOmMCdhSWOhmZSw0zkv49suckalOr1-LTOhea0dA,1497
|
|
2
|
+
doppy-0.0.1.dist-info/WHEEL,sha256=k54CwY5XUt0x02QEm5euq1yuvLUFoAnj4FRvab0--O0,95
|
|
3
|
+
doppy-0.0.1.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
|
|
4
|
+
doppy-0.0.1.dist-info/license_files/LICENSE,sha256=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
5
|
+
doppy-0.0.1.dist-info/license_files/LICENSE,sha256=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
6
|
+
doppy/bench.py,sha256=fLN2iS5mmoYH4qZjD80Vl1h9lp3C-KDfhj9fteWRPtM,260
|
|
7
|
+
doppy/data/api.py,sha256=TrEyossWn8f5ChTWBkmuoce7sxjQ7KkXc4iSOR2qmEc,1552
|
|
8
|
+
doppy/data/cache.py,sha256=Z5J6-_8rXun3QD-AOmcFioXAdC8bgdrZvD-a7zhIQQw,924
|
|
9
|
+
doppy/data/exceptions.py,sha256=JOyekvUO-Ew4ZVezf3_IxZOrPN0IksfUILd8R2YcSts,95
|
|
10
|
+
doppy/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
doppy/defaults.py,sha256=2aZFZtR5BMQRn8TL7wbIn4FmFUVmvDum3UlCfj4CM_w,42
|
|
12
|
+
doppy/exceptions.py,sha256=YNEyz4r0ObzZHZ9re83K3wZlR2CRI1GyhH0vvFGasgQ,148
|
|
13
|
+
doppy/netcdf.py,sha256=rvcm_6RnmTIrwqDgIJnPyZvO2rcRkBpbQODEBOA5yN8,3516
|
|
14
|
+
doppy/options.py,sha256=uyIKM_G2GtbmV6Gve8o13eIShQqUwsnYZ41mhX2ypGE,218
|
|
15
|
+
doppy/product/stare.py,sha256=zmI5W7tkP7UtT69-ArEnm9DdQ_tVFy6Lcy3zQYsseCk,19160
|
|
16
|
+
doppy/product/__init__.py,sha256=t2LhhQ801k1HQON1Ow6hs5APC6WN0PhcpOPfZ9wmt1o,62
|
|
17
|
+
doppy/raw/halo_bg.py,sha256=9K7E9smahGOqDIYnA-9m-Di3QsDY0PR2FH4Yd_oYiEY,4951
|
|
18
|
+
doppy/raw/halo_hpl.py,sha256=y8MJxU0E9pQZn0shW2I_zo_gt06igTZkoNOWPR6RqsU,18401
|
|
19
|
+
doppy/raw/halo_sys_params.py,sha256=L3cFf1jATLMkVf2ViSbrmom-rZu7dn1Nq1J354xO98A,4041
|
|
20
|
+
doppy/raw/__init__.py,sha256=V9ompr2j-mMe--OFOvNZIH7xKoKTUj997GltTABk3i0,156
|
|
21
|
+
doppy/__init__.py,sha256=Af7_8p3oN1nTqS9fo0mVKVuiKf5CAEK69uQa32CSFBA,197
|
|
22
|
+
doppy/__main__.py,sha256=38hIWWfanILuBBGorQiAaleSC4qYJoIxuzVBkxf7Dng,371
|
|
23
|
+
doppy/rs.pyd,sha256=EvWhjslx-QKv6ohbJnwfwzVNRm4obz-VG-tqMrapjoE,2095104
|
|
24
|
+
doppy-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Finnish Meteorological Institute
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|