doppy 0.1.0__cp310-abi3-win_amd64.whl → 0.1.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/netcdf.py +13 -15
- doppy/product/wind.py +3 -1
- doppy/rs.pyd +0 -0
- {doppy-0.1.0.dist-info → doppy-0.1.2.dist-info}/METADATA +4 -5
- {doppy-0.1.0.dist-info → doppy-0.1.2.dist-info}/RECORD +9 -9
- {doppy-0.1.0.dist-info → doppy-0.1.2.dist-info}/WHEEL +1 -1
- {doppy-0.1.0.dist-info → doppy-0.1.2.dist-info}/entry_points.txt +0 -0
- {doppy-0.1.0.dist-info → doppy-0.1.2.dist-info}/license_files/LICENSE +0 -0
doppy/netcdf.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from pathlib import Path
|
|
4
3
|
from typing import Literal, TypeAlias
|
|
5
4
|
|
|
6
5
|
import netCDF4
|
|
@@ -11,13 +10,17 @@ NetCDFDataType: TypeAlias = Literal["f4", "f8", "i4", "i8", "u4", "u8"]
|
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
class Dataset:
|
|
14
|
-
def __init__(self) -> None:
|
|
15
|
-
self.nc = netCDF4.Dataset(
|
|
13
|
+
def __init__(self, filename: str) -> None:
|
|
14
|
+
self.nc = netCDF4.Dataset(filename, mode="w")
|
|
16
15
|
|
|
17
16
|
def add_dimension(self, dim: str) -> Dataset:
|
|
18
17
|
self.nc.createDimension(dim, None)
|
|
19
18
|
return self
|
|
20
19
|
|
|
20
|
+
def add_atribute(self, key: str, val: str) -> Dataset:
|
|
21
|
+
setattr(self.nc, key, val)
|
|
22
|
+
return self
|
|
23
|
+
|
|
21
24
|
def add_time(
|
|
22
25
|
self,
|
|
23
26
|
name: str,
|
|
@@ -28,7 +31,7 @@ class Dataset:
|
|
|
28
31
|
long_name: str | None = None,
|
|
29
32
|
) -> Dataset:
|
|
30
33
|
time, units, calendar = _convert_time(data)
|
|
31
|
-
var = self.nc.createVariable(name, dtype, dimensions)
|
|
34
|
+
var = self.nc.createVariable(name, dtype, dimensions, compression="zlib")
|
|
32
35
|
var.units = units
|
|
33
36
|
var.calendar = calendar
|
|
34
37
|
var[:] = time
|
|
@@ -49,7 +52,10 @@ class Dataset:
|
|
|
49
52
|
long_name: str | None = None,
|
|
50
53
|
mask: npt.NDArray[np.bool_] | None = None,
|
|
51
54
|
) -> Dataset:
|
|
52
|
-
|
|
55
|
+
fill_value = netCDF4.default_fillvals[dtype] if mask is not None else None
|
|
56
|
+
var = self.nc.createVariable(
|
|
57
|
+
name, dtype, dimensions, fill_value=fill_value, compression="zlib"
|
|
58
|
+
)
|
|
53
59
|
var.units = units
|
|
54
60
|
if mask is not None:
|
|
55
61
|
var[:] = np.ma.masked_array(data, mask) # type: ignore
|
|
@@ -80,16 +86,8 @@ class Dataset:
|
|
|
80
86
|
var.long_name = long_name
|
|
81
87
|
return self
|
|
82
88
|
|
|
83
|
-
def close(self) ->
|
|
84
|
-
|
|
85
|
-
if isinstance(buf, memoryview):
|
|
86
|
-
return buf
|
|
87
|
-
raise TypeError
|
|
88
|
-
|
|
89
|
-
def write(self, path: str | Path) -> None:
|
|
90
|
-
buf = self.nc.close()
|
|
91
|
-
with Path(path).open("wb") as f:
|
|
92
|
-
f.write(buf)
|
|
89
|
+
def close(self) -> None:
|
|
90
|
+
self.nc.close()
|
|
93
91
|
|
|
94
92
|
|
|
95
93
|
def _convert_time(
|
doppy/product/wind.py
CHANGED
|
@@ -311,7 +311,8 @@ def _select_raws_for_wind(
|
|
|
311
311
|
raw
|
|
312
312
|
for raw in raws
|
|
313
313
|
if len(raw.elevation_angles) == 1
|
|
314
|
-
and next(iter(raw.elevation_angles)) < 80
|
|
314
|
+
and (el := next(iter(raw.elevation_angles))) < 80
|
|
315
|
+
and el > 25
|
|
315
316
|
and len(raw.azimuth_angles) > 3
|
|
316
317
|
]
|
|
317
318
|
if len(raws_wind) == 0:
|
|
@@ -319,6 +320,7 @@ def _select_raws_for_wind(
|
|
|
319
320
|
"No data suitable for winds: "
|
|
320
321
|
"Multiple elevation angles or "
|
|
321
322
|
"elevation angle >= 80 or "
|
|
323
|
+
"elevation angle <= 25 or "
|
|
322
324
|
"no more than 3 azimuth angles"
|
|
323
325
|
)
|
|
324
326
|
|
doppy/rs.pyd
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: doppy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Dist: requests
|
|
13
13
|
Requires-Dist: urllib3
|
|
14
14
|
Requires-Dist: numpy
|
|
15
|
-
Requires-Dist:
|
|
15
|
+
Requires-Dist: netcdf4
|
|
16
16
|
Requires-Dist: typer[all]
|
|
17
17
|
Requires-Dist: matplotlib
|
|
18
18
|
Requires-Dist: scikit-learn
|
|
@@ -22,13 +22,12 @@ Requires-Dist: ruff ; extra == 'dev'
|
|
|
22
22
|
Requires-Dist: pytest ; extra == 'dev'
|
|
23
23
|
Requires-Dist: types-requests ; extra == 'dev'
|
|
24
24
|
Requires-Dist: py-spy ; extra == 'dev'
|
|
25
|
-
Requires-Dist: maturin ; extra == 'dev'
|
|
25
|
+
Requires-Dist: maturin ==1.4 ; extra == 'dev'
|
|
26
26
|
Requires-Dist: release-version ; extra == 'dev'
|
|
27
27
|
Requires-Dist: pre-commit ; extra == 'dev'
|
|
28
28
|
Provides-Extra: dev
|
|
29
29
|
License-File: LICENSE
|
|
30
30
|
License-File: LICENSE
|
|
31
|
-
Summary: Doppler lidar processing
|
|
32
31
|
Author: Niko Leskinen <niko.leskinen@fmi.fi>
|
|
33
32
|
Author-email: Niko Leskinen <niko.leskinen@fmi.fi>
|
|
34
33
|
Requires-Python: >=3.10
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
doppy-0.1.
|
|
2
|
-
doppy-0.1.
|
|
3
|
-
doppy-0.1.
|
|
4
|
-
doppy-0.1.
|
|
5
|
-
doppy-0.1.
|
|
1
|
+
doppy-0.1.2.dist-info/METADATA,sha256=x1OqOHI6PDqSZOdytPtIABdhJw60RcOhlxf_hmlnmfQ,1798
|
|
2
|
+
doppy-0.1.2.dist-info/WHEEL,sha256=Q2npN4Wz3hcQ5uc7KmG7fh3MaY55ijiBnwI7N8UUMDM,95
|
|
3
|
+
doppy-0.1.2.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
|
|
4
|
+
doppy-0.1.2.dist-info/license_files/LICENSE,sha256=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
5
|
+
doppy-0.1.2.dist-info/license_files/LICENSE,sha256=RIAxFjJLTw0wQ3_SM73JoTeppoD99DJJ72cjvVuRrW4,1110
|
|
6
6
|
doppy/bench.py,sha256=fLN2iS5mmoYH4qZjD80Vl1h9lp3C-KDfhj9fteWRPtM,260
|
|
7
7
|
doppy/data/api.py,sha256=yzniozSzs8N1sJe5ht4Y5SwyZn06RlGSkiwm0GvBTUE,1787
|
|
8
8
|
doppy/data/cache.py,sha256=VNPB3XsWGwY2bNXBs1r_sEWF4qBq_U7sJSlSmt1Rxm8,1033
|
|
@@ -10,10 +10,10 @@ doppy/data/exceptions.py,sha256=JOyekvUO-Ew4ZVezf3_IxZOrPN0IksfUILd8R2YcSts,95
|
|
|
10
10
|
doppy/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
doppy/defaults.py,sha256=nhxcZcFd2jyDVbq0azwtekEJEjiz8k21MZmXFlSXAjo,40
|
|
12
12
|
doppy/exceptions.py,sha256=YNEyz4r0ObzZHZ9re83K3wZlR2CRI1GyhH0vvFGasgQ,148
|
|
13
|
-
doppy/netcdf.py,sha256=
|
|
13
|
+
doppy/netcdf.py,sha256=RxJhYv6JEtNF7G7gEX5dcCL4sv5F4-TdDt2uKrkhHjs,3526
|
|
14
14
|
doppy/options.py,sha256=uyIKM_G2GtbmV6Gve8o13eIShQqUwsnYZ41mhX2ypGE,218
|
|
15
15
|
doppy/product/stare.py,sha256=GBw5P16smTLtTdNtLTucb4NP2nUcW2WEj0sXysYSvZY,20314
|
|
16
|
-
doppy/product/wind.py,sha256=
|
|
16
|
+
doppy/product/wind.py,sha256=WNPPMY71HKIpnj3T96jqWNcScYT5Fa3vB7PKnm4FP_I,11452
|
|
17
17
|
doppy/product/__init__.py,sha256=dOyY9_lLv6l3-_vtmJU18zOrE86SL0LHovQWQtwynnU,107
|
|
18
18
|
doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
doppy/raw/halo_bg.py,sha256=9K7E9smahGOqDIYnA-9m-Di3QsDY0PR2FH4Yd_oYiEY,4951
|
|
@@ -23,5 +23,5 @@ doppy/raw/windcube.py,sha256=aHAKN1tgyPNpCVBY4co9FwM6vMLu4swqVoFFhpDT33M,9939
|
|
|
23
23
|
doppy/raw/__init__.py,sha256=5szGvPn_KS7PViMPQ1umGrbd9jkJzQUZpTiST1z2MvQ,200
|
|
24
24
|
doppy/__init__.py,sha256=Af7_8p3oN1nTqS9fo0mVKVuiKf5CAEK69uQa32CSFBA,197
|
|
25
25
|
doppy/__main__.py,sha256=38hIWWfanILuBBGorQiAaleSC4qYJoIxuzVBkxf7Dng,371
|
|
26
|
-
doppy/rs.pyd,sha256=
|
|
27
|
-
doppy-0.1.
|
|
26
|
+
doppy/rs.pyd,sha256=DwzH6MeOJpfYtoNoeDwCmdVBkQaJA9BKe4DysjY14nk,2088960
|
|
27
|
+
doppy-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|