cloudnetpy 1.73.1__py3-none-any.whl → 1.74.0__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/categorize/categorize.py +1 -0
- cloudnetpy/categorize/radar.py +16 -2
- cloudnetpy/products/mwr_tools.py +0 -7
- cloudnetpy/version.py +2 -2
- {cloudnetpy-1.73.1.dist-info → cloudnetpy-1.74.0.dist-info}/METADATA +1 -1
- {cloudnetpy-1.73.1.dist-info → cloudnetpy-1.74.0.dist-info}/RECORD +10 -10
- {cloudnetpy-1.73.1.dist-info → cloudnetpy-1.74.0.dist-info}/WHEEL +0 -0
- {cloudnetpy-1.73.1.dist-info → cloudnetpy-1.74.0.dist-info}/entry_points.txt +0 -0
- {cloudnetpy-1.73.1.dist-info → cloudnetpy-1.74.0.dist-info}/licenses/LICENSE +0 -0
- {cloudnetpy-1.73.1.dist-info → cloudnetpy-1.74.0.dist-info}/top_level.txt +0 -0
@@ -166,6 +166,7 @@ def generate_categorize(
|
|
166
166
|
except DisdrometerDataError as err:
|
167
167
|
logging.warning("Unable to use disdrometer: %s", err)
|
168
168
|
time, height = _define_dense_grid()
|
169
|
+
data.radar.add_location(time)
|
169
170
|
valid_ind = _interpolate_to_cloudnet_grid()
|
170
171
|
if len(valid_ind) < 2:
|
171
172
|
msg = "Less than 2 overlapping radar, lidar and model timestamps found"
|
cloudnetpy/categorize/radar.py
CHANGED
@@ -316,11 +316,25 @@ class Radar(DataSource):
|
|
316
316
|
|
317
317
|
def add_meta(self) -> None:
|
318
318
|
"""Copies misc. metadata from the input file."""
|
319
|
-
for key in ("latitude", "longitude", "altitude"):
|
320
|
-
self.append_data(np.array(self.getvar(key)), key)
|
321
319
|
for key in ("time", "height", "radar_frequency"):
|
322
320
|
self.append_data(np.array(getattr(self, key)), key)
|
323
321
|
|
322
|
+
def add_location(self, time_new: np.ndarray):
|
323
|
+
"""Add latitude, longitude and altitude from nearest timestamp."""
|
324
|
+
idx = np.searchsorted(self.time, time_new)
|
325
|
+
idx_left = np.clip(idx - 1, 0, len(self.time) - 1)
|
326
|
+
idx_right = np.clip(idx, 0, len(self.time) - 1)
|
327
|
+
diff_left = np.abs(time_new - self.time[idx_left])
|
328
|
+
diff_right = np.abs(time_new - self.time[idx_right])
|
329
|
+
idx_closest = np.where(diff_left < diff_right, idx_left, idx_right)
|
330
|
+
for key in ("latitude", "longitude", "altitude"):
|
331
|
+
data = self.getvar(key)
|
332
|
+
if not utils.isscalar(data):
|
333
|
+
data = data[idx_closest]
|
334
|
+
if not np.any(ma.getmaskarray(data)):
|
335
|
+
data = np.array(data)
|
336
|
+
self.append_data(data, key)
|
337
|
+
|
324
338
|
def _init_data(self) -> None:
|
325
339
|
self.append_data(self.getvar("Zh"), "Z", units="dBZ")
|
326
340
|
for key in ("v", "ldr", "width", "sldr", "rainfall_rate"):
|
cloudnetpy/products/mwr_tools.py
CHANGED
@@ -89,7 +89,6 @@ class Mwr:
|
|
89
89
|
|
90
90
|
def harmonize(self, product: Literal["multi", "single"]) -> str:
|
91
91
|
self._truncate_global_attributes()
|
92
|
-
self._copy_variable_values()
|
93
92
|
self._copy_global_attributes()
|
94
93
|
self._fix_variable_attributes()
|
95
94
|
self._write_missing_global_attributes(product)
|
@@ -99,12 +98,6 @@ class Mwr:
|
|
99
98
|
for attr in self.nc_l2.ncattrs():
|
100
99
|
delattr(self.nc_l2, attr)
|
101
100
|
|
102
|
-
def _copy_variable_values(self):
|
103
|
-
keys = ("latitude", "longitude", "altitude")
|
104
|
-
for var in keys:
|
105
|
-
if var in self.nc_l2.variables:
|
106
|
-
self.nc_l2.variables[var][:] = self.nc_l1c.variables[var][:]
|
107
|
-
|
108
101
|
def _copy_global_attributes(self):
|
109
102
|
keys = ("year", "month", "day", "location", "source")
|
110
103
|
output.copy_global(self.nc_l1c, self.nc_l2, keys)
|
cloudnetpy/version.py
CHANGED
@@ -9,11 +9,11 @@ cloudnetpy/metadata.py,sha256=lO7BCbVAzFoH3Nq-VuezYX0f7MnbG1Zp11g5GSiuQwM,6189
|
|
9
9
|
cloudnetpy/output.py,sha256=l0LoOhcGCBrg2EJ4NT1xZ7-UKWdV7X7yQ0fJmhkwJVc,15829
|
10
10
|
cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
cloudnetpy/utils.py,sha256=ui6sq8g1HlgfOQO644iNHsRGqpDwS3q-5uGR2y2tOAk,33325
|
12
|
-
cloudnetpy/version.py,sha256=
|
12
|
+
cloudnetpy/version.py,sha256=NyE8VYDVST3jInl97hnM5B9JXFGdkILThRQ42YmU1wA,72
|
13
13
|
cloudnetpy/categorize/__init__.py,sha256=s-SJaysvVpVVo5kidiruWQO6p3gv2TXwY1wEHYO5D6I,44
|
14
14
|
cloudnetpy/categorize/atmos_utils.py,sha256=RcmbKxm2COkE7WEya0mK3yX5rzUbrewRVh3ekm01RtM,10598
|
15
15
|
cloudnetpy/categorize/attenuation.py,sha256=Y_-fzmQTltWTqIZTulJhovC7a6ifpMcaAazDJcnMIOc,990
|
16
|
-
cloudnetpy/categorize/categorize.py,sha256=
|
16
|
+
cloudnetpy/categorize/categorize.py,sha256=PzkgQ63MtEHlz_0govFkoM6F41OKgQLsxDh7GLQHyrs,20777
|
17
17
|
cloudnetpy/categorize/classify.py,sha256=qovHgHsMku5kpl3cJxKteNBsG8GAkfI3Zo8QhJwZSFQ,8512
|
18
18
|
cloudnetpy/categorize/containers.py,sha256=evqVQOoUycBtaFeKpms7_NuM9z8jKWq37nLIhoDxa8k,5278
|
19
19
|
cloudnetpy/categorize/disdrometer.py,sha256=sRSt2B932lrrkvycKoSaKEIaDVfq9Z7uU-4iHRr-fC0,1893
|
@@ -26,7 +26,7 @@ cloudnetpy/categorize/lidar.py,sha256=YQrM_LOz8NQrrD9l9HyujV1GSGwkQ8LMqXN13bEJRW
|
|
26
26
|
cloudnetpy/categorize/melting.py,sha256=ZnLeL_qWmiCdjXVOm9iBYHdo29Brqxu_DEErZPqUloQ,6217
|
27
27
|
cloudnetpy/categorize/model.py,sha256=QFRCY0TvM2fzGRyP8BNkqbvu13XcQjt7TsN5fhjI_Uc,6654
|
28
28
|
cloudnetpy/categorize/mwr.py,sha256=F7cquERWL6mBkgboqeaCIPf9gOlKI-NWUQIBdQXGT_I,1635
|
29
|
-
cloudnetpy/categorize/radar.py,sha256=
|
29
|
+
cloudnetpy/categorize/radar.py,sha256=PmriTnrHbgZrau1RTNKpPI_-h5Uu0kGIMrMOaoMuROY,14821
|
30
30
|
cloudnetpy/categorize/attenuations/__init__.py,sha256=CWFHVWeTIe2hrZtgkJaX2HGftbuffsFc39Mzv5B0Lw0,1037
|
31
31
|
cloudnetpy/categorize/attenuations/gas_attenuation.py,sha256=emr-RCxQT0i2N8k6eBNhRsmsCBPHJzQsWJfjC4fVSTo,975
|
32
32
|
cloudnetpy/categorize/attenuations/liquid_attenuation.py,sha256=0p0G79BPkw1itCXHMwbvkNHtJGBocJzow3gNHAirChI,3036
|
@@ -114,12 +114,12 @@ cloudnetpy/products/ier.py,sha256=XW4gg_H-JWMWKToMqLVl6v8kx1S65GBwclWDCn1EfSk,59
|
|
114
114
|
cloudnetpy/products/iwc.py,sha256=WcPdAZx3zW0zaNJNp2vpAD4JnG0NJjFmCUAhDWzNxMg,9459
|
115
115
|
cloudnetpy/products/lwc.py,sha256=sl6Al2tuH3KkCBrPbWTmuz3jlD5UQJ4D6qBsn1tt2CQ,18962
|
116
116
|
cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe55y9ob58,16637951
|
117
|
-
cloudnetpy/products/mwr_tools.py,sha256=
|
117
|
+
cloudnetpy/products/mwr_tools.py,sha256=1SRaQRW6-1svfnUk25sMyWXSwRJ1fg7v48TsMENZQpg,5103
|
118
118
|
cloudnetpy/products/product_tools.py,sha256=uu4l6reuGbPcW3TgttbaSrqIKbyYGhBVTdnC7opKvmg,11101
|
119
|
-
cloudnetpy-1.
|
119
|
+
cloudnetpy-1.74.0.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
|
120
120
|
docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
|
121
|
-
cloudnetpy-1.
|
122
|
-
cloudnetpy-1.
|
123
|
-
cloudnetpy-1.
|
124
|
-
cloudnetpy-1.
|
125
|
-
cloudnetpy-1.
|
121
|
+
cloudnetpy-1.74.0.dist-info/METADATA,sha256=YopNoTclJY-YXuOMqKereaBmfE4KyID0PAwfmzs_wMU,5796
|
122
|
+
cloudnetpy-1.74.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
123
|
+
cloudnetpy-1.74.0.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
|
124
|
+
cloudnetpy-1.74.0.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
|
125
|
+
cloudnetpy-1.74.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|