doppy 0.2.3__cp310-abi3-win_amd64.whl → 0.3.0__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/netcdf.py +18 -1
- doppy/product/__init__.py +2 -1
- doppy/product/stare.py +2 -2
- doppy/product/stare_depol.py +83 -0
- doppy/product/wind.py +1 -1
- doppy/raw/halo_hpl.py +1 -1
- doppy/raw/halo_sys_params.py +1 -1
- doppy/rs.pyd +0 -0
- {doppy-0.2.3.dist-info → doppy-0.3.0.dist-info}/METADATA +4 -4
- {doppy-0.2.3.dist-info → doppy-0.3.0.dist-info}/RECORD +13 -13
- {doppy-0.2.3.dist-info → doppy-0.3.0.dist-info}/WHEEL +1 -1
- {doppy-0.2.3.dist-info → doppy-0.3.0.dist-info}/entry_points.txt +0 -0
- {doppy-0.2.3.dist-info → doppy-0.3.0.dist-info}/license_files/LICENSE +0 -0
doppy/netcdf.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import warnings
|
|
4
|
+
from types import TracebackType
|
|
3
5
|
from typing import Literal, TypeAlias
|
|
4
6
|
|
|
5
7
|
import netCDF4
|
|
@@ -13,14 +15,29 @@ class Dataset:
|
|
|
13
15
|
def __init__(self, filename: str) -> None:
|
|
14
16
|
self.nc = netCDF4.Dataset(filename, mode="w")
|
|
15
17
|
|
|
18
|
+
def __enter__(self) -> Dataset:
|
|
19
|
+
return self
|
|
20
|
+
|
|
21
|
+
def __exit__(
|
|
22
|
+
self,
|
|
23
|
+
exc_type: type[BaseException] | None,
|
|
24
|
+
exc_val: BaseException | None,
|
|
25
|
+
exc_tb: TracebackType | None,
|
|
26
|
+
) -> None:
|
|
27
|
+
self.close()
|
|
28
|
+
|
|
16
29
|
def add_dimension(self, dim: str) -> Dataset:
|
|
17
30
|
self.nc.createDimension(dim, None)
|
|
18
31
|
return self
|
|
19
32
|
|
|
20
|
-
def
|
|
33
|
+
def add_attribute(self, key: str, val: str) -> Dataset:
|
|
21
34
|
setattr(self.nc, key, val)
|
|
22
35
|
return self
|
|
23
36
|
|
|
37
|
+
def add_atribute(self, key: str, val: str) -> Dataset:
|
|
38
|
+
warnings.warn("Use add_attribute", DeprecationWarning, stacklevel=2)
|
|
39
|
+
return self.add_attribute(key, val)
|
|
40
|
+
|
|
24
41
|
def add_time(
|
|
25
42
|
self,
|
|
26
43
|
name: str,
|
doppy/product/__init__.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from doppy.product.stare import Stare
|
|
2
|
+
from doppy.product.stare_depol import StareDepol
|
|
2
3
|
from doppy.product.wind import Options as WindOptions
|
|
3
4
|
from doppy.product.wind import Wind
|
|
4
5
|
|
|
5
|
-
__all__ = ["Stare", "Wind", "WindOptions"]
|
|
6
|
+
__all__ = ["Stare", "StareDepol", "Wind", "WindOptions"]
|
doppy/product/stare.py
CHANGED
|
@@ -142,7 +142,7 @@ def _compute_beta(
|
|
|
142
142
|
c
|
|
143
143
|
speed of light
|
|
144
144
|
B
|
|
145
|
-
|
|
145
|
+
receiver bandwidth
|
|
146
146
|
|
|
147
147
|
References
|
|
148
148
|
----------
|
|
@@ -560,7 +560,7 @@ def _select_raws_for_stare(
|
|
|
560
560
|
|
|
561
561
|
|
|
562
562
|
def _selection_key(raw: doppy.raw.HaloHpl) -> SelectionGroupKeyType:
|
|
563
|
-
return (raw.header.
|
|
563
|
+
return (raw.header.mergeable_hash(),)
|
|
564
564
|
|
|
565
565
|
|
|
566
566
|
def _time2bg_time(
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import numpy.typing as npt
|
|
3
|
+
|
|
4
|
+
from doppy.product.stare import Stare
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class StareDepol:
|
|
8
|
+
"""
|
|
9
|
+
Stare product with depolarisation ratio derived from co-polarised and
|
|
10
|
+
cross-polarised stare data.
|
|
11
|
+
|
|
12
|
+
Attributes:
|
|
13
|
+
-----------
|
|
14
|
+
time
|
|
15
|
+
An array of datetime64 objects representing the observation times.
|
|
16
|
+
radial_distance
|
|
17
|
+
An array of radial distances from the observation point, in meters.
|
|
18
|
+
elevation
|
|
19
|
+
An array of elevation angles corresponding to the observation points, in
|
|
20
|
+
degrees.
|
|
21
|
+
beta
|
|
22
|
+
An array of backscatter coefficients for the co-polarised signal, in
|
|
23
|
+
sr-1 m-1.
|
|
24
|
+
radial_velocity
|
|
25
|
+
An array of radial velocities of the co-polarised signal, in m s-1.
|
|
26
|
+
mask
|
|
27
|
+
A boolean array indicating signal (True) or noise (False) data points.
|
|
28
|
+
depolarisation
|
|
29
|
+
An array of depolarisation ratios calculated as the ratio of
|
|
30
|
+
co-polarised to cross-polarised backscatter coefficients.
|
|
31
|
+
wavelength
|
|
32
|
+
The wavelength of the lidar, in meters.
|
|
33
|
+
system_id
|
|
34
|
+
A string identifier for the lidar.
|
|
35
|
+
|
|
36
|
+
Raises
|
|
37
|
+
------
|
|
38
|
+
ValueError
|
|
39
|
+
If the input `co` and `cross` products have mismatched wavelengths,
|
|
40
|
+
system IDs, radial distances, or elevation angles, this exception is
|
|
41
|
+
raised.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
time: npt.NDArray[np.datetime64]
|
|
45
|
+
radial_distance: npt.NDArray[np.float64]
|
|
46
|
+
elevation: npt.NDArray[np.float64]
|
|
47
|
+
beta: npt.NDArray[np.float64]
|
|
48
|
+
radial_velocity: npt.NDArray[np.float64]
|
|
49
|
+
mask: npt.NDArray[np.bool_]
|
|
50
|
+
depolarisation: npt.NDArray[np.float64]
|
|
51
|
+
wavelength: float
|
|
52
|
+
system_id: str
|
|
53
|
+
|
|
54
|
+
def __init__(self, co: Stare, cross: Stare):
|
|
55
|
+
if co.wavelength != cross.wavelength:
|
|
56
|
+
raise ValueError(
|
|
57
|
+
"Different wavelength in co and cross: "
|
|
58
|
+
f"{co.wavelength} vs {cross.wavelength}"
|
|
59
|
+
)
|
|
60
|
+
if co.system_id != cross.system_id:
|
|
61
|
+
raise ValueError(
|
|
62
|
+
"Different system ID in co and cross: "
|
|
63
|
+
f"{co.system_id} vs {cross.system_id}"
|
|
64
|
+
)
|
|
65
|
+
if not np.allclose(co.radial_distance, cross.radial_distance):
|
|
66
|
+
raise ValueError("Different radial distance in co and cross")
|
|
67
|
+
|
|
68
|
+
time_ind = np.argmin(np.abs(co.time - cross.time[:, np.newaxis]), axis=0)
|
|
69
|
+
cross_elevation = cross.elevation[time_ind]
|
|
70
|
+
cross_beta = cross.beta[time_ind, :]
|
|
71
|
+
|
|
72
|
+
if not np.allclose(co.elevation, cross_elevation):
|
|
73
|
+
raise ValueError("Different elevation in co and cross")
|
|
74
|
+
|
|
75
|
+
self.time = co.time
|
|
76
|
+
self.radial_distance = co.radial_distance
|
|
77
|
+
self.elevation = co.elevation
|
|
78
|
+
self.beta = co.beta
|
|
79
|
+
self.radial_velocity = co.radial_velocity
|
|
80
|
+
self.mask = co.mask
|
|
81
|
+
self.depolarisation = cross_beta / co.beta
|
|
82
|
+
self.wavelength = co.wavelength
|
|
83
|
+
self.system_id = co.system_id
|
doppy/product/wind.py
CHANGED
|
@@ -406,7 +406,7 @@ def _selection_key(raw: doppy.raw.HaloHpl) -> SelectionGroupKeyType:
|
|
|
406
406
|
if len(raw.elevation_angles) != 1:
|
|
407
407
|
raise ValueError("Expected only one elevation angle")
|
|
408
408
|
return (
|
|
409
|
-
raw.header.
|
|
409
|
+
raw.header.mergeable_hash(),
|
|
410
410
|
next(iter(raw.elevation_angles)),
|
|
411
411
|
tuple(sorted(raw.azimuth_angles)),
|
|
412
412
|
)
|
doppy/raw/halo_hpl.py
CHANGED
doppy/raw/halo_sys_params.py
CHANGED
|
@@ -81,7 +81,7 @@ def _from_src(data: BufferedIOBase) -> HaloSysParams:
|
|
|
81
81
|
b = [r.split(b"\t") for r in a]
|
|
82
82
|
arr = np.array(b)
|
|
83
83
|
if arr.shape[1] != 7:
|
|
84
|
-
raise ValueError("Unexpected data
|
|
84
|
+
raise ValueError("Unexpected data format")
|
|
85
85
|
|
|
86
86
|
def timestr2datetime64_12H(datetime_bytes: bytes) -> np.datetime64:
|
|
87
87
|
return datetime64(
|
doppy/rs.pyd
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: doppy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -37,7 +37,7 @@ Project-URL: Repository, https://github.com/actris-cloudnet/doppy
|
|
|
37
37
|
Project-URL: Changelog, https://github.com/actris-cloudnet/doppy/blob/main/CHANGELOG.md
|
|
38
38
|
Project-URL: Bug Tracker, https://github.com/actris-cloudnet/doppy/issues
|
|
39
39
|
|
|
40
|
-
# Doppy
|
|
40
|
+
# Doppy – Doppler wind lidar processing
|
|
41
41
|
|
|
42
42
|
[](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml)
|
|
43
43
|
[](https://badge.fury.io/py/doppy)
|
|
@@ -129,8 +129,8 @@ stare = doppy.product.Stare.from_halo_data(
|
|
|
129
129
|
data=stare.wavelength,
|
|
130
130
|
dtype="f4",
|
|
131
131
|
)
|
|
132
|
-
.
|
|
133
|
-
.
|
|
132
|
+
.add_attribute("serial_number", stare.system_id)
|
|
133
|
+
.add_attribute("doppy_version", doppy.__version__)
|
|
134
134
|
).close()
|
|
135
135
|
|
|
136
136
|
```
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
doppy-0.
|
|
2
|
-
doppy-0.
|
|
3
|
-
doppy-0.
|
|
4
|
-
doppy-0.
|
|
5
|
-
doppy-0.2.3.dist-info/license_files/LICENSE,sha256=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
1
|
+
doppy-0.3.0.dist-info/METADATA,sha256=Ev5A4AsPf6a-OyhbGFn5cqIK8XHRDmwYFMGg2mnHWEE,4243
|
|
2
|
+
doppy-0.3.0.dist-info/WHEEL,sha256=ooo3OLxJB34JFfOmPzfiM9QlB2wmB_Cl3_kcSm8NkLg,95
|
|
3
|
+
doppy-0.3.0.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
|
|
4
|
+
doppy-0.3.0.dist-info/license_files/LICENSE,sha256=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
6
5
|
doppy/bench.py,sha256=fLN2iS5mmoYH4qZjD80Vl1h9lp3C-KDfhj9fteWRPtM,260
|
|
7
6
|
doppy/data/api.py,sha256=c3zbZI3IV7HnzhyFzJpUPOFT20eYFuQlJ5K_1ZEe1Pg,1921
|
|
8
7
|
doppy/data/cache.py,sha256=VNPB3XsWGwY2bNXBs1r_sEWF4qBq_U7sJSlSmt1Rxm8,1033
|
|
@@ -10,20 +9,21 @@ doppy/data/exceptions.py,sha256=JOyekvUO-Ew4ZVezf3_IxZOrPN0IksfUILd8R2YcSts,95
|
|
|
10
9
|
doppy/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
10
|
doppy/defaults.py,sha256=nhxcZcFd2jyDVbq0azwtekEJEjiz8k21MZmXFlSXAjo,40
|
|
12
11
|
doppy/exceptions.py,sha256=YNEyz4r0ObzZHZ9re83K3wZlR2CRI1GyhH0vvFGasgQ,148
|
|
13
|
-
doppy/netcdf.py,sha256=
|
|
12
|
+
doppy/netcdf.py,sha256=VkWGleFKef3bkWf2_LfCdJnR1LORIFc51cXDRoRdHFo,4023
|
|
14
13
|
doppy/options.py,sha256=uyIKM_G2GtbmV6Gve8o13eIShQqUwsnYZ41mhX2ypGE,218
|
|
15
|
-
doppy/product/stare.py,sha256=
|
|
16
|
-
doppy/product/
|
|
17
|
-
doppy/product/
|
|
14
|
+
doppy/product/stare.py,sha256=sh2HuKEWa-gaWZCbjbozYFA0oRUZa4U3nG9FpgqtoKM,20522
|
|
15
|
+
doppy/product/stare_depol.py,sha256=rSi1nxC9VqiTse4xu4E733iJJUq9IC2EXKa_n3dIUWA,2980
|
|
16
|
+
doppy/product/wind.py,sha256=f52owv_pzfUDiMzLXv6IqHFWHWdLXmGUIgBCXjOhPnk,13455
|
|
17
|
+
doppy/product/__init__.py,sha256=xoBEXuhid-bvoof5Ogzpt1dKIhJgNMRyrAinCqUOUUI,241
|
|
18
18
|
doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
doppy/raw/halo_bg.py,sha256=9K7E9smahGOqDIYnA-9m-Di3QsDY0PR2FH4Yd_oYiEY,4951
|
|
20
|
-
doppy/raw/halo_hpl.py,sha256=
|
|
21
|
-
doppy/raw/halo_sys_params.py,sha256=
|
|
20
|
+
doppy/raw/halo_hpl.py,sha256=VF8JQ_5N8adLsGNJOlhvKwz0LtNd4oCU76hETe5Vuhk,19007
|
|
21
|
+
doppy/raw/halo_sys_params.py,sha256=nT9r4F-H0Rf5njee5rYzzLTCm7vm3N_pdJqrW6RtyK4,4041
|
|
22
22
|
doppy/raw/windcube.py,sha256=h_kqlQf2Pz59xg5EVSROiUlcA2RQp2jkGIxohmN1QOE,10166
|
|
23
23
|
doppy/raw/wls70.py,sha256=2OhjmQ1SoAmjN4npOKFH0eFLyo9RssO7sr-gOtxjAho,7622
|
|
24
24
|
doppy/raw/__init__.py,sha256=J06q7iykSAWIif4XAxI1jOszkARvLFBR1eU-B9yUXMw,235
|
|
25
25
|
doppy/utils.py,sha256=lENDTzMVjCOA15Va9WZ6cou-foL5bGbNt4-NbDcnXpc,223
|
|
26
26
|
doppy/__init__.py,sha256=Af7_8p3oN1nTqS9fo0mVKVuiKf5CAEK69uQa32CSFBA,197
|
|
27
27
|
doppy/__main__.py,sha256=38hIWWfanILuBBGorQiAaleSC4qYJoIxuzVBkxf7Dng,371
|
|
28
|
-
doppy/rs.pyd,sha256
|
|
29
|
-
doppy-0.
|
|
28
|
+
doppy/rs.pyd,sha256=-gldLueqXNJls_220C85maa0oidYpfxu2Gs-ovk1-tU,2100736
|
|
29
|
+
doppy-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|