cloudnetpy 1.66.7__py3-none-any.whl → 1.66.8__py3-none-any.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.
- cloudnetpy/cli.py +1 -1
- cloudnetpy/concat_lib.py +6 -2
- cloudnetpy/datasource.py +1 -1
- cloudnetpy/instruments/cloudnet_instrument.py +14 -5
- cloudnetpy/instruments/mira.py +0 -3
- cloudnetpy/instruments/mrr.py +0 -3
- cloudnetpy/instruments/nc_radar.py +2 -1
- cloudnetpy/utils.py +1 -1
- cloudnetpy/version.py +1 -1
- {cloudnetpy-1.66.7.dist-info → cloudnetpy-1.66.8.dist-info}/METADATA +1 -1
- {cloudnetpy-1.66.7.dist-info → cloudnetpy-1.66.8.dist-info}/RECORD +15 -15
- {cloudnetpy-1.66.7.dist-info → cloudnetpy-1.66.8.dist-info}/WHEEL +1 -1
- {cloudnetpy-1.66.7.dist-info → cloudnetpy-1.66.8.dist-info}/LICENSE +0 -0
- {cloudnetpy-1.66.7.dist-info → cloudnetpy-1.66.8.dist-info}/entry_points.txt +0 -0
- {cloudnetpy-1.66.7.dist-info → cloudnetpy-1.66.8.dist-info}/top_level.txt +0 -0
cloudnetpy/cli.py
CHANGED
@@ -539,7 +539,7 @@ def _parse_products(product_argument: str) -> list[str]:
|
|
539
539
|
for product in products:
|
540
540
|
prod, _ = _parse_instrument(product)
|
541
541
|
if prod in valid_options:
|
542
|
-
valid_products.append(
|
542
|
+
valid_products.append(product)
|
543
543
|
return valid_products
|
544
544
|
|
545
545
|
|
cloudnetpy/concat_lib.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
import shutil
|
4
4
|
from os import PathLike
|
5
|
+
from typing import Literal
|
5
6
|
|
6
7
|
import netCDF4
|
7
8
|
import numpy as np
|
@@ -210,7 +211,7 @@ class _Concat:
|
|
210
211
|
self.concatenated_file.variables[key][ind0:ind1, :] = array
|
211
212
|
|
212
213
|
def _init_output_file(self, output_file: str) -> netCDF4.Dataset:
|
213
|
-
data_model = (
|
214
|
+
data_model: Literal["NETCDF4", "NETCDF4_CLASSIC"] = (
|
214
215
|
"NETCDF4" if self.first_file.data_model == "NETCDF4" else "NETCDF4_CLASSIC"
|
215
216
|
)
|
216
217
|
nc = netCDF4.Dataset(output_file, "w", format=data_model)
|
@@ -234,7 +235,10 @@ class _Concat:
|
|
234
235
|
self._close()
|
235
236
|
|
236
237
|
|
237
|
-
def _copy_attributes(
|
238
|
+
def _copy_attributes(
|
239
|
+
source: netCDF4.Dataset | netCDF4.Variable,
|
240
|
+
target: netCDF4.Dataset | netCDF4.Variable,
|
241
|
+
) -> None:
|
238
242
|
for attr in source.ncattrs():
|
239
243
|
if attr != "_FillValue":
|
240
244
|
value = getattr(source, attr)
|
cloudnetpy/datasource.py
CHANGED
@@ -221,7 +221,7 @@ class DataSource:
|
|
221
221
|
"""
|
222
222
|
for name in possible_names:
|
223
223
|
if name in self.dataset.variables:
|
224
|
-
array = self.dataset.variables[name]
|
224
|
+
array: netCDF4.Variable | np.ndarray = self.dataset.variables[name]
|
225
225
|
if ignore_mask is True:
|
226
226
|
array = np.array(array)
|
227
227
|
self.append_data(array, key, units=units)
|
@@ -6,11 +6,12 @@ from numpy import ma
|
|
6
6
|
|
7
7
|
from cloudnetpy import utils
|
8
8
|
from cloudnetpy.cloudnetarray import CloudnetArray
|
9
|
+
from cloudnetpy.exceptions import ValidTimeStampError
|
9
10
|
|
10
11
|
|
11
12
|
class CloudnetInstrument:
|
12
13
|
def __init__(self):
|
13
|
-
self.dataset: netCDF4.Dataset
|
14
|
+
self.dataset: netCDF4.Dataset
|
14
15
|
self.time: np.ndarray = np.array([])
|
15
16
|
self.site_meta: dict = {}
|
16
17
|
self.data: dict = {}
|
@@ -23,14 +24,19 @@ class CloudnetInstrument:
|
|
23
24
|
if key in self.site_meta:
|
24
25
|
value = self.site_meta[key]
|
25
26
|
# From source global attributes (MIRA):
|
26
|
-
elif
|
27
|
-
self
|
28
|
-
|
27
|
+
elif (
|
28
|
+
hasattr(self, "dataset")
|
29
|
+
and isinstance(self.dataset, netCDF4.Dataset)
|
30
|
+
and hasattr(
|
31
|
+
self.dataset,
|
32
|
+
key.capitalize(),
|
33
|
+
)
|
29
34
|
):
|
30
35
|
value = self.parse_global_attribute_numeral(key.capitalize())
|
31
36
|
# From source data (BASTA / RPG):
|
32
37
|
elif (
|
33
|
-
|
38
|
+
hasattr(self, "dataset")
|
39
|
+
and isinstance(self.dataset, netCDF4.Dataset)
|
34
40
|
and key in self.dataset.variables
|
35
41
|
):
|
36
42
|
value = self.dataset.variables[key][:]
|
@@ -72,6 +78,9 @@ class CloudnetInstrument:
|
|
72
78
|
self.screen_time_indices(ind)
|
73
79
|
|
74
80
|
def screen_time_indices(self, valid_indices: list | np.ndarray) -> None:
|
81
|
+
if len(valid_indices) == 0:
|
82
|
+
msg = "All timestamps screened"
|
83
|
+
raise ValidTimeStampError(msg)
|
75
84
|
time = self._get_time()
|
76
85
|
n_time = len(time)
|
77
86
|
for cloudnet_array in self.data.values():
|
cloudnetpy/instruments/mira.py
CHANGED
@@ -8,7 +8,6 @@ from tempfile import NamedTemporaryFile, TemporaryDirectory
|
|
8
8
|
from numpy import ma
|
9
9
|
|
10
10
|
from cloudnetpy import concat_lib, output, utils
|
11
|
-
from cloudnetpy.exceptions import ValidTimeStampError
|
12
11
|
from cloudnetpy.instruments.instruments import MIRA35
|
13
12
|
from cloudnetpy.instruments.nc_radar import NcRadar
|
14
13
|
from cloudnetpy.metadata import MetaData
|
@@ -109,8 +108,6 @@ class Mira(NcRadar):
|
|
109
108
|
date = "-".join(utils.seconds2date(timestamp, self.epoch)[:3])
|
110
109
|
if date == expected_date:
|
111
110
|
valid_indices.append(ind)
|
112
|
-
if not valid_indices:
|
113
|
-
raise ValidTimeStampError
|
114
111
|
self.screen_time_indices(valid_indices)
|
115
112
|
|
116
113
|
def _init_mira_date(self) -> list[str]:
|
cloudnetpy/instruments/mrr.py
CHANGED
@@ -10,7 +10,6 @@ from uuid import UUID
|
|
10
10
|
import netCDF4
|
11
11
|
|
12
12
|
from cloudnetpy import concat_lib, output, utils
|
13
|
-
from cloudnetpy.exceptions import ValidTimeStampError
|
14
13
|
from cloudnetpy.instruments import instruments
|
15
14
|
from cloudnetpy.instruments.nc_radar import NcRadar
|
16
15
|
from cloudnetpy.metadata import MetaData
|
@@ -160,8 +159,6 @@ class MrrPro(NcRadar):
|
|
160
159
|
date = "-".join(utils.seconds2date(timestamp, self.epoch)[:3])
|
161
160
|
if date == expected_date.isoformat():
|
162
161
|
valid_indices.append(ind)
|
163
|
-
if not valid_indices:
|
164
|
-
raise ValidTimeStampError
|
165
162
|
self.screen_time_indices(valid_indices)
|
166
163
|
|
167
164
|
|
@@ -136,7 +136,8 @@ class NcRadar(DataSource, CloudnetInstrument):
|
|
136
136
|
msg = "Instrument not defined"
|
137
137
|
raise RuntimeError(msg)
|
138
138
|
key = "radar_frequency"
|
139
|
-
|
139
|
+
if self.instrument.frequency is not None:
|
140
|
+
self.data[key] = CloudnetArray(self.instrument.frequency, key)
|
140
141
|
try:
|
141
142
|
possible_nyquist_names = ("ambiguous_velocity", "NyquistVelocity")
|
142
143
|
data = self.getvar(*possible_nyquist_names)
|
cloudnetpy/utils.py
CHANGED
@@ -650,7 +650,7 @@ def n_elements(array: np.ndarray, dist: float, var: str | None = None) -> int:
|
|
650
650
|
return int(np.round(n))
|
651
651
|
|
652
652
|
|
653
|
-
def isscalar(array: np.ndarray | float | list) -> bool:
|
653
|
+
def isscalar(array: np.ndarray | float | list | netCDF4.Variable) -> bool:
|
654
654
|
"""Tests if input is scalar.
|
655
655
|
|
656
656
|
By "scalar" we mean that array has a single value.
|
cloudnetpy/version.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
cloudnetpy/__init__.py,sha256=X_FqY-4yg5GUj5Edo14SToLEos6JIsC3fN-v1FUgQoA,43
|
2
|
-
cloudnetpy/cli.py,sha256=
|
2
|
+
cloudnetpy/cli.py,sha256=lHkeAErmAijI-Ugpd4DHRHfbZP4SXOake0LIY5Ovv_Q,20782
|
3
3
|
cloudnetpy/cloudnetarray.py,sha256=Ol1ha4RPAmFZANL__U5CaMKX4oYMXYR6OnjoCZ9w3eo,7077
|
4
|
-
cloudnetpy/concat_lib.py,sha256=
|
4
|
+
cloudnetpy/concat_lib.py,sha256=RiL6fgaKjX2YyXl0BonbCjLXV2voIKPcQcdR9ZkQ8QA,11888
|
5
5
|
cloudnetpy/constants.py,sha256=RDB9aqpBRztk3QVCFgsmi9fwhtLuit_0WJrt0D6sDcc,736
|
6
|
-
cloudnetpy/datasource.py,sha256=
|
6
|
+
cloudnetpy/datasource.py,sha256=FcWS77jz56gIzwnbafDLdj-HjAyu0P_VtY7gkeVZThU,7952
|
7
7
|
cloudnetpy/exceptions.py,sha256=ns48useL9RN3mPh7CqIiLA19VI9OmVbyRsKTkwbThF8,1760
|
8
8
|
cloudnetpy/metadata.py,sha256=v_VDo2vbdTxB0zIsfP69IcrwSKiRlLpsGdq6JPI4CoA,5306
|
9
9
|
cloudnetpy/output.py,sha256=YrWRBEZg0QNZRVnd9ziAziH-eJSh7O5JuWiH4ZxM0_s,15584
|
10
10
|
cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
cloudnetpy/utils.py,sha256=
|
12
|
-
cloudnetpy/version.py,sha256=
|
11
|
+
cloudnetpy/utils.py,sha256=JksYOwf9ORiR_QpoKrTe1JJwXpPYJj-wlwaZKCHoh3o,29744
|
12
|
+
cloudnetpy/version.py,sha256=_HpTDfNRU86QUkp683KtI0kEE_sns9m5_9nnN3CEWVM,72
|
13
13
|
cloudnetpy/categorize/__init__.py,sha256=s-SJaysvVpVVo5kidiruWQO6p3gv2TXwY1wEHYO5D6I,44
|
14
14
|
cloudnetpy/categorize/atmos_utils.py,sha256=9-ymI6i1xASf-XAFyO87FaTfvq6bF89N1i_27OkUp-M,10104
|
15
15
|
cloudnetpy/categorize/attenuation.py,sha256=Y_-fzmQTltWTqIZTulJhovC7a6ifpMcaAazDJcnMIOc,990
|
@@ -38,16 +38,16 @@ cloudnetpy/instruments/campbell_scientific.py,sha256=2WHfBKQjtRSl0AqvtPeX7G8Hdi3
|
|
38
38
|
cloudnetpy/instruments/ceilo.py,sha256=xrI7iYNftKvGZf-3C_ESUNsu-QhXV43iWkDuKp3biZU,9552
|
39
39
|
cloudnetpy/instruments/ceilometer.py,sha256=pdmLVljsuciyKpaGxWxJ_f1IrJK-UrkBC0lSeuirLlU,12095
|
40
40
|
cloudnetpy/instruments/cl61d.py,sha256=g6DNBFju3wYhLFl32DKmC8pUup7y-EupXoUU0fuoGGA,1990
|
41
|
-
cloudnetpy/instruments/cloudnet_instrument.py,sha256=
|
41
|
+
cloudnetpy/instruments/cloudnet_instrument.py,sha256=r4xurc6jegbHBmIe_JEpvPmV4Ga0GhPiv1ff4MjcNZs,3680
|
42
42
|
cloudnetpy/instruments/copernicus.py,sha256=nmgqGOjVQFngj7BNbpcuCwA-W3yksvBbqn__iq7MyDk,6469
|
43
43
|
cloudnetpy/instruments/galileo.py,sha256=yQBedd7dmDnwuWi1MtXOsg4-RyRx0uRAXumCY4YuH9k,4686
|
44
44
|
cloudnetpy/instruments/hatpro.py,sha256=DzCWzTJxTc5BSOgoeyM8RjYkSXX6NDi3QXgKRp0uxlI,8759
|
45
45
|
cloudnetpy/instruments/instruments.py,sha256=jG5TYnZ8bdCZXnI303ZsaJBEdSKaIjKMbkGtnq6kQX0,3261
|
46
46
|
cloudnetpy/instruments/lufft.py,sha256=ugXF6pssHAAz1Y_hqPdpKuluAjxxHSR88xBmQuS6RlI,3705
|
47
|
-
cloudnetpy/instruments/mira.py,sha256=
|
48
|
-
cloudnetpy/instruments/mrr.py,sha256=
|
47
|
+
cloudnetpy/instruments/mira.py,sha256=f679zjmIxLVVtUVSMeO5IWbEdaj6qOJu5Gf9MKQJSL8,9412
|
48
|
+
cloudnetpy/instruments/mrr.py,sha256=eeAzCp3CiHGauywjwvMUAFwZ4vBOZMcd3IlF8KsrLQo,5711
|
49
49
|
cloudnetpy/instruments/nc_lidar.py,sha256=5gQG9PApnNPrHmS9_zanl8HEYIQuGRpbnzC3wfTcOyQ,1705
|
50
|
-
cloudnetpy/instruments/nc_radar.py,sha256=
|
50
|
+
cloudnetpy/instruments/nc_radar.py,sha256=ctmb0tJHkRoz-Ic8UAw4_v4VfS27r22_4X_1s4mUAas,6990
|
51
51
|
cloudnetpy/instruments/pollyxt.py,sha256=YuVEHr-BX31rtVOFsWGU-SQFAmcxpXL26eyCVMz_9hw,8933
|
52
52
|
cloudnetpy/instruments/radiometrics.py,sha256=ECN_bSfcV8Evdgfho9-Dl8RThXkAhHzIEj4DPOawSTc,7626
|
53
53
|
cloudnetpy/instruments/rpg.py,sha256=IozvBJ8_qXTPqtp58FQwRsoI5_aI3-kycpXugZkS0d4,17462
|
@@ -115,9 +115,9 @@ cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe5
|
|
115
115
|
cloudnetpy/products/mwr_tools.py,sha256=rd7UC67O4fsIE5SaHVZ4qWvUJTj41ZGwgQWPwZzOM14,5377
|
116
116
|
cloudnetpy/products/product_tools.py,sha256=01Zc6xV8CSuYcIcLpchFf5POL3_c629-YMNDZJ51udA,10853
|
117
117
|
docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
|
118
|
-
cloudnetpy-1.66.
|
119
|
-
cloudnetpy-1.66.
|
120
|
-
cloudnetpy-1.66.
|
121
|
-
cloudnetpy-1.66.
|
122
|
-
cloudnetpy-1.66.
|
123
|
-
cloudnetpy-1.66.
|
118
|
+
cloudnetpy-1.66.8.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
|
119
|
+
cloudnetpy-1.66.8.dist-info/METADATA,sha256=HptVJMJeTubhD5gtb1l1ZCmrDsvgOLI_dSWdt-HIujo,5784
|
120
|
+
cloudnetpy-1.66.8.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
121
|
+
cloudnetpy-1.66.8.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
|
122
|
+
cloudnetpy-1.66.8.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
|
123
|
+
cloudnetpy-1.66.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|