doppy 0.3.0__cp310-abi3-win_amd64.whl → 0.3.2__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/product/stare.py +22 -0
- doppy/product/stare_depol.py +105 -8
- doppy/rs.pyd +0 -0
- {doppy-0.3.0.dist-info → doppy-0.3.2.dist-info}/METADATA +1 -1
- {doppy-0.3.0.dist-info → doppy-0.3.2.dist-info}/RECORD +8 -8
- {doppy-0.3.0.dist-info → doppy-0.3.2.dist-info}/WHEEL +1 -1
- {doppy-0.3.0.dist-info → doppy-0.3.2.dist-info}/entry_points.txt +0 -0
- {doppy-0.3.0.dist-info/license_files → doppy-0.3.2.dist-info/licenses}/LICENSE +0 -0
doppy/product/stare.py
CHANGED
|
@@ -29,6 +29,28 @@ class Stare:
|
|
|
29
29
|
wavelength: float
|
|
30
30
|
system_id: str
|
|
31
31
|
|
|
32
|
+
def __getitem__(
|
|
33
|
+
self,
|
|
34
|
+
index: int
|
|
35
|
+
| slice
|
|
36
|
+
| list[int]
|
|
37
|
+
| npt.NDArray[np.int64]
|
|
38
|
+
| npt.NDArray[np.bool_]
|
|
39
|
+
| tuple[slice, slice],
|
|
40
|
+
) -> Stare:
|
|
41
|
+
if isinstance(index, (int, slice, list, np.ndarray)):
|
|
42
|
+
return Stare(
|
|
43
|
+
time=self.time[index],
|
|
44
|
+
radial_distance=self.radial_distance,
|
|
45
|
+
elevation=self.elevation[index],
|
|
46
|
+
beta=self.beta[index],
|
|
47
|
+
radial_velocity=self.radial_velocity[index],
|
|
48
|
+
mask=self.mask[index],
|
|
49
|
+
wavelength=self.wavelength,
|
|
50
|
+
system_id=self.system_id,
|
|
51
|
+
)
|
|
52
|
+
raise TypeError
|
|
53
|
+
|
|
32
54
|
@classmethod
|
|
33
55
|
def from_halo_data(
|
|
34
56
|
cls,
|
doppy/product/stare_depol.py
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from io import BufferedIOBase
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Sequence
|
|
7
|
+
|
|
1
8
|
import numpy as np
|
|
2
9
|
import numpy.typing as npt
|
|
3
10
|
|
|
11
|
+
from doppy import options
|
|
4
12
|
from doppy.product.stare import Stare
|
|
5
13
|
|
|
6
14
|
|
|
15
|
+
@dataclass
|
|
7
16
|
class StareDepol:
|
|
8
17
|
"""
|
|
9
18
|
Stare product with depolarisation ratio derived from co-polarised and
|
|
@@ -21,6 +30,9 @@ class StareDepol:
|
|
|
21
30
|
beta
|
|
22
31
|
An array of backscatter coefficients for the co-polarised signal, in
|
|
23
32
|
sr-1 m-1.
|
|
33
|
+
beta_cross
|
|
34
|
+
An array of backscatter coefficients for the cross-polarised signal, in
|
|
35
|
+
sr-1 m-1.
|
|
24
36
|
radial_velocity
|
|
25
37
|
An array of radial velocities of the co-polarised signal, in m s-1.
|
|
26
38
|
mask
|
|
@@ -33,26 +45,55 @@ class StareDepol:
|
|
|
33
45
|
system_id
|
|
34
46
|
A string identifier for the lidar.
|
|
35
47
|
|
|
48
|
+
|
|
36
49
|
Raises
|
|
37
50
|
------
|
|
38
51
|
ValueError
|
|
39
52
|
If the input `co` and `cross` products have mismatched wavelengths,
|
|
40
53
|
system IDs, radial distances, or elevation angles, this exception is
|
|
41
54
|
raised.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
References
|
|
58
|
+
----------
|
|
59
|
+
Aerosol particle depolarization ratio at 1565 nm measured with a Halo Doppler lidar
|
|
60
|
+
authors: Ville Vakkari, Holger Baars, Stephanie Bohlmann, Johannes Bühl,
|
|
61
|
+
Mika Komppula, Rodanthi-Elisavet Mamouri, and Ewan James O'Connor
|
|
62
|
+
doi: https://doi.org/10.5194/acp-21-5807-2021
|
|
42
63
|
"""
|
|
43
64
|
|
|
44
65
|
time: npt.NDArray[np.datetime64]
|
|
45
66
|
radial_distance: npt.NDArray[np.float64]
|
|
46
67
|
elevation: npt.NDArray[np.float64]
|
|
47
68
|
beta: npt.NDArray[np.float64]
|
|
69
|
+
beta_cross: npt.NDArray[np.float64]
|
|
48
70
|
radial_velocity: npt.NDArray[np.float64]
|
|
49
71
|
mask: npt.NDArray[np.bool_]
|
|
50
72
|
depolarisation: npt.NDArray[np.float64]
|
|
73
|
+
mask_depolarisation: npt.NDArray[np.bool_]
|
|
74
|
+
mask_beta_cross: npt.NDArray[np.bool_]
|
|
75
|
+
polariser_bleed_through: float
|
|
51
76
|
wavelength: float
|
|
52
77
|
system_id: str
|
|
53
78
|
|
|
54
|
-
def __init__(
|
|
55
|
-
|
|
79
|
+
def __init__(
|
|
80
|
+
self,
|
|
81
|
+
co: Stare,
|
|
82
|
+
cross: Stare,
|
|
83
|
+
polariser_bleed_through: float = 0.0,
|
|
84
|
+
):
|
|
85
|
+
"""
|
|
86
|
+
Parameters
|
|
87
|
+
----------
|
|
88
|
+
co: Stare
|
|
89
|
+
The co-polarised data.
|
|
90
|
+
cross: Stare
|
|
91
|
+
The cross-polarised data. The `cross.time` array is expected to be sorted.
|
|
92
|
+
polariser_bleed_through: float, default=0.0
|
|
93
|
+
The amount of bleed-through from the polariser.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
if not np.isclose(co.wavelength, cross.wavelength):
|
|
56
97
|
raise ValueError(
|
|
57
98
|
"Different wavelength in co and cross: "
|
|
58
99
|
f"{co.wavelength} vs {cross.wavelength}"
|
|
@@ -62,22 +103,78 @@ class StareDepol:
|
|
|
62
103
|
"Different system ID in co and cross: "
|
|
63
104
|
f"{co.system_id} vs {cross.system_id}"
|
|
64
105
|
)
|
|
65
|
-
if not np.allclose(co.radial_distance, cross.radial_distance):
|
|
106
|
+
if not np.allclose(co.radial_distance, cross.radial_distance, atol=1):
|
|
66
107
|
raise ValueError("Different radial distance in co and cross")
|
|
67
108
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
109
|
+
if co.beta.shape[1] != cross.beta.shape[1]:
|
|
110
|
+
raise ValueError(
|
|
111
|
+
"Range dimension mismatch in co and cross: "
|
|
112
|
+
f"{co.beta.shape[1]} vs {cross.beta.shape[1]}"
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
ind = np.searchsorted(cross.time, co.time, side="left")
|
|
116
|
+
pick_ind = ind < len(cross.time)
|
|
117
|
+
time_diff_threshold = 2 * np.median(np.diff(co.time))
|
|
118
|
+
co_cross_timediff_below_threshold = (
|
|
119
|
+
cross.time[ind[pick_ind]] - co.time[pick_ind] < time_diff_threshold
|
|
120
|
+
)
|
|
121
|
+
pick_ind[pick_ind] &= co_cross_timediff_below_threshold
|
|
71
122
|
|
|
72
|
-
if not np.allclose(
|
|
123
|
+
if not np.allclose(
|
|
124
|
+
co.elevation[pick_ind], cross.elevation[ind[pick_ind]], atol=1
|
|
125
|
+
):
|
|
73
126
|
raise ValueError("Different elevation in co and cross")
|
|
74
127
|
|
|
128
|
+
depolarisation = np.full_like(co.beta, np.nan)
|
|
129
|
+
co_beta = co.beta[pick_ind]
|
|
130
|
+
depolarisation[pick_ind] = (
|
|
131
|
+
cross.beta[ind[pick_ind]] - polariser_bleed_through * co_beta
|
|
132
|
+
) / co_beta
|
|
133
|
+
cross_beta = np.full_like(co.beta, np.nan)
|
|
134
|
+
cross_beta[pick_ind] = cross.beta[ind[pick_ind]]
|
|
135
|
+
|
|
75
136
|
self.time = co.time
|
|
76
137
|
self.radial_distance = co.radial_distance
|
|
77
138
|
self.elevation = co.elevation
|
|
78
139
|
self.beta = co.beta
|
|
140
|
+
self.beta_cross = cross_beta
|
|
79
141
|
self.radial_velocity = co.radial_velocity
|
|
80
142
|
self.mask = co.mask
|
|
81
|
-
self.depolarisation =
|
|
143
|
+
self.depolarisation = depolarisation
|
|
144
|
+
self.mask_depolarisation = np.isnan(depolarisation)
|
|
145
|
+
self.mask_beta_cross = np.isnan(self.beta_cross)
|
|
146
|
+
self.polariser_bleed_through = polariser_bleed_through
|
|
82
147
|
self.wavelength = co.wavelength
|
|
83
148
|
self.system_id = co.system_id
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def from_halo_data(
|
|
152
|
+
cls,
|
|
153
|
+
co_data: Sequence[str]
|
|
154
|
+
| Sequence[Path]
|
|
155
|
+
| Sequence[bytes]
|
|
156
|
+
| Sequence[BufferedIOBase],
|
|
157
|
+
co_data_bg: Sequence[str]
|
|
158
|
+
| Sequence[Path]
|
|
159
|
+
| Sequence[tuple[bytes, str]]
|
|
160
|
+
| Sequence[tuple[BufferedIOBase, str]],
|
|
161
|
+
cross_data: Sequence[str]
|
|
162
|
+
| Sequence[Path]
|
|
163
|
+
| Sequence[bytes]
|
|
164
|
+
| Sequence[BufferedIOBase],
|
|
165
|
+
cross_data_bg: Sequence[str]
|
|
166
|
+
| Sequence[Path]
|
|
167
|
+
| Sequence[tuple[bytes, str]]
|
|
168
|
+
| Sequence[tuple[BufferedIOBase, str]],
|
|
169
|
+
bg_correction_method: options.BgCorrectionMethod,
|
|
170
|
+
polariser_bleed_through: float = 0,
|
|
171
|
+
) -> StareDepol:
|
|
172
|
+
co = Stare.from_halo_data(
|
|
173
|
+
data=co_data, data_bg=co_data_bg, bg_correction_method=bg_correction_method
|
|
174
|
+
)
|
|
175
|
+
cross = Stare.from_halo_data(
|
|
176
|
+
data=cross_data,
|
|
177
|
+
data_bg=cross_data_bg,
|
|
178
|
+
bg_correction_method=bg_correction_method,
|
|
179
|
+
)
|
|
180
|
+
return cls(co, cross, polariser_bleed_through)
|
doppy/rs.pyd
CHANGED
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
doppy-0.3.
|
|
2
|
-
doppy-0.3.
|
|
3
|
-
doppy-0.3.
|
|
4
|
-
doppy-0.3.
|
|
1
|
+
doppy-0.3.2.dist-info/METADATA,sha256=bQR6PLYTj9KbGk4o_L7UMDMjujoiSy9VQtFCjjwYk9I,4243
|
|
2
|
+
doppy-0.3.2.dist-info/WHEEL,sha256=kQSgRz4wLs1NoHeP8cPfiUAbi-20athsJLkIuWHUegk,95
|
|
3
|
+
doppy-0.3.2.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
|
|
4
|
+
doppy-0.3.2.dist-info/licenses/LICENSE,sha256=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
5
5
|
doppy/bench.py,sha256=fLN2iS5mmoYH4qZjD80Vl1h9lp3C-KDfhj9fteWRPtM,260
|
|
6
6
|
doppy/data/api.py,sha256=c3zbZI3IV7HnzhyFzJpUPOFT20eYFuQlJ5K_1ZEe1Pg,1921
|
|
7
7
|
doppy/data/cache.py,sha256=VNPB3XsWGwY2bNXBs1r_sEWF4qBq_U7sJSlSmt1Rxm8,1033
|
|
@@ -11,8 +11,8 @@ doppy/defaults.py,sha256=nhxcZcFd2jyDVbq0azwtekEJEjiz8k21MZmXFlSXAjo,40
|
|
|
11
11
|
doppy/exceptions.py,sha256=YNEyz4r0ObzZHZ9re83K3wZlR2CRI1GyhH0vvFGasgQ,148
|
|
12
12
|
doppy/netcdf.py,sha256=VkWGleFKef3bkWf2_LfCdJnR1LORIFc51cXDRoRdHFo,4023
|
|
13
13
|
doppy/options.py,sha256=uyIKM_G2GtbmV6Gve8o13eIShQqUwsnYZ41mhX2ypGE,218
|
|
14
|
-
doppy/product/stare.py,sha256=
|
|
15
|
-
doppy/product/stare_depol.py,sha256=
|
|
14
|
+
doppy/product/stare.py,sha256=lJlo0DggYSGCFveFCZrY4SHOsU01dcHrV8Naq6bBT7s,21239
|
|
15
|
+
doppy/product/stare_depol.py,sha256=kf24wFDs1TBPrNag3URj2By5ermr5Q6RrAC-uNh7xxM,6389
|
|
16
16
|
doppy/product/wind.py,sha256=f52owv_pzfUDiMzLXv6IqHFWHWdLXmGUIgBCXjOhPnk,13455
|
|
17
17
|
doppy/product/__init__.py,sha256=xoBEXuhid-bvoof5Ogzpt1dKIhJgNMRyrAinCqUOUUI,241
|
|
18
18
|
doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -25,5 +25,5 @@ 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.3.
|
|
28
|
+
doppy/rs.pyd,sha256=wiTo_4GBwfKe2bWxcvc1rLHOIPRL-Q22ieLuXuaX_5w,2100736
|
|
29
|
+
doppy-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|