cloudnetpy 1.61.10__py3-none-any.whl → 1.61.12__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/instruments/weather_station.py +11 -13
- cloudnetpy/output.py +3 -2
- cloudnetpy/plotting/plotting.py +23 -9
- cloudnetpy/version.py +1 -1
- {cloudnetpy-1.61.10.dist-info → cloudnetpy-1.61.12.dist-info}/METADATA +1 -1
- {cloudnetpy-1.61.10.dist-info → cloudnetpy-1.61.12.dist-info}/RECORD +9 -9
- {cloudnetpy-1.61.10.dist-info → cloudnetpy-1.61.12.dist-info}/LICENSE +0 -0
- {cloudnetpy-1.61.10.dist-info → cloudnetpy-1.61.12.dist-info}/WHEEL +0 -0
- {cloudnetpy-1.61.10.dist-info → cloudnetpy-1.61.12.dist-info}/top_level.txt +0 -0
@@ -8,6 +8,7 @@ from numpy import ma
|
|
8
8
|
from cloudnetpy import output
|
9
9
|
from cloudnetpy.categorize import atmos_utils
|
10
10
|
from cloudnetpy.cloudnetarray import CloudnetArray
|
11
|
+
from cloudnetpy.constants import MM_H_TO_M_S, SEC_IN_HOUR
|
11
12
|
from cloudnetpy.exceptions import ValidTimeStampError, WeatherStationDataError
|
12
13
|
from cloudnetpy.instruments import instruments
|
13
14
|
from cloudnetpy.instruments.cloudnet_instrument import CloudnetInstrument
|
@@ -60,6 +61,7 @@ def ws2nc(
|
|
60
61
|
ws.add_site_geolocation()
|
61
62
|
ws.add_data()
|
62
63
|
ws.convert_units()
|
64
|
+
ws.calculate_rainfall_amount()
|
63
65
|
attributes = output.add_time_attribute(ATTRIBUTES, ws.date)
|
64
66
|
output.update_attributes(ws.data, attributes)
|
65
67
|
except ValueError as err:
|
@@ -85,6 +87,13 @@ class WS(CloudnetInstrument):
|
|
85
87
|
def convert_units(self) -> None:
|
86
88
|
pass
|
87
89
|
|
90
|
+
def calculate_rainfall_amount(self) -> None:
|
91
|
+
if "rainfall_amount" in self.data:
|
92
|
+
return
|
93
|
+
resolution = np.median(np.diff(self.data["time"].data)) * SEC_IN_HOUR
|
94
|
+
rainfall_amount = ma.cumsum(self.data["rainfall_rate"].data * resolution)
|
95
|
+
self.data["rainfall_amount"] = CloudnetArray(rainfall_amount, "rainfall_amount")
|
96
|
+
|
88
97
|
|
89
98
|
class PalaiseauWS(WS):
|
90
99
|
def __init__(self, filenames: list[str], site_meta: dict):
|
@@ -256,9 +265,6 @@ class GranadaWS(WS):
|
|
256
265
|
for key, value in self._data.items():
|
257
266
|
parsed = datetime2decimal_hours(value) if key == "time" else np.array(value)
|
258
267
|
self.data[key] = CloudnetArray(parsed, key)
|
259
|
-
self.data["rainfall_amount"] = CloudnetArray(
|
260
|
-
np.cumsum(self._data["rainfall_rate"]), "rainfall_amount"
|
261
|
-
)
|
262
268
|
|
263
269
|
def convert_units(self) -> None:
|
264
270
|
temperature_kelvins = atmos_utils.c2k(self.data["air_temperature"][:])
|
@@ -267,9 +273,6 @@ class GranadaWS(WS):
|
|
267
273
|
self.data["air_pressure"].data = self.data["air_pressure"][:] * 100 # hPa -> Pa
|
268
274
|
rainfall_rate = self.data["rainfall_rate"][:]
|
269
275
|
self.data["rainfall_rate"].data = rainfall_rate / 60 / 1000 # mm/min -> m/s
|
270
|
-
self.data["rainfall_amount"].data = (
|
271
|
-
self.data["rainfall_amount"][:] / 1000
|
272
|
-
) # mm -> m
|
273
276
|
|
274
277
|
|
275
278
|
class KenttarovaWS(WS):
|
@@ -344,20 +347,15 @@ class KenttarovaWS(WS):
|
|
344
347
|
for key, value in self._data.items():
|
345
348
|
parsed = datetime2decimal_hours(value) if key == "time" else ma.array(value)
|
346
349
|
self.data[key] = CloudnetArray(parsed, key)
|
347
|
-
self.data["rainfall_amount"] = CloudnetArray(
|
348
|
-
ma.cumsum(self._data["rainfall_rate"]), "rainfall_amount"
|
349
|
-
)
|
350
350
|
|
351
351
|
def convert_units(self) -> None:
|
352
352
|
temperature_kelvins = atmos_utils.c2k(self.data["air_temperature"][:])
|
353
353
|
self.data["air_temperature"].data = temperature_kelvins
|
354
354
|
self.data["relative_humidity"].data = self.data["relative_humidity"][:] / 100
|
355
355
|
self.data["air_pressure"].data = self.data["air_pressure"][:] * 100 # hPa -> Pa
|
356
|
+
# Rainfall rate is 10-minute averaged in mm h-1
|
356
357
|
rainfall_rate = self.data["rainfall_rate"][:]
|
357
|
-
self.data["rainfall_rate"].data = rainfall_rate
|
358
|
-
self.data["rainfall_amount"].data = (
|
359
|
-
self.data["rainfall_amount"][:] / 1000
|
360
|
-
) # mm -> m
|
358
|
+
self.data["rainfall_rate"].data = rainfall_rate * MM_H_TO_M_S / 10
|
361
359
|
|
362
360
|
|
363
361
|
ATTRIBUTES = {
|
cloudnetpy/output.py
CHANGED
@@ -117,9 +117,10 @@ def save_product_file(
|
|
117
117
|
|
118
118
|
def get_l1b_source(instrument: Instrument) -> str:
|
119
119
|
"""Returns level 1b file source."""
|
120
|
-
|
120
|
+
parts = [
|
121
121
|
item for item in [instrument.manufacturer, instrument.model] if item is not None
|
122
|
-
|
122
|
+
]
|
123
|
+
return " ".join(parts) if parts else instrument.category.capitalize()
|
123
124
|
|
124
125
|
|
125
126
|
def get_l1b_history(instrument: Instrument) -> str:
|
cloudnetpy/plotting/plotting.py
CHANGED
@@ -4,6 +4,7 @@ import re
|
|
4
4
|
import textwrap
|
5
5
|
from dataclasses import dataclass
|
6
6
|
from datetime import date
|
7
|
+
from typing import Any
|
7
8
|
|
8
9
|
import matplotlib.pyplot as plt
|
9
10
|
import netCDF4
|
@@ -491,15 +492,28 @@ class Plot2D(Plot):
|
|
491
492
|
smoothed_data = uniform_filter(self._data[valid_time_ind, :], sigma_units)
|
492
493
|
self._data[valid_time_ind, :] = smoothed_data
|
493
494
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
495
|
+
pcolor_kwargs = {
|
496
|
+
"cmap": plt.get_cmap(str(self._plot_meta.cmap)),
|
497
|
+
"vmin": vmin,
|
498
|
+
"vmax": vmax,
|
499
|
+
"zorder": _get_zorder("data"),
|
500
|
+
}
|
501
|
+
image: Any
|
502
|
+
if figure_data.file.cloudnet_file_type == "model":
|
503
|
+
image = self._ax.pcolor(
|
504
|
+
figure_data.time_including_gaps,
|
505
|
+
alt,
|
506
|
+
self._data.T,
|
507
|
+
**pcolor_kwargs,
|
508
|
+
shading="nearest",
|
509
|
+
)
|
510
|
+
else:
|
511
|
+
image = self._ax.pcolorfast(
|
512
|
+
figure_data.time_including_gaps,
|
513
|
+
alt,
|
514
|
+
self._data.T[:-1, :-1],
|
515
|
+
**pcolor_kwargs,
|
516
|
+
)
|
503
517
|
cbar = self._init_colorbar(image)
|
504
518
|
cbar.set_label(str(self._plot_meta.clabel), fontsize=13)
|
505
519
|
|
cloudnetpy/version.py
CHANGED
@@ -5,10 +5,10 @@ cloudnetpy/constants.py,sha256=l7_ohQgLEQ6XEG9AMBarTPKp9OM8B1ElJ6fSN0ScdmM,733
|
|
5
5
|
cloudnetpy/datasource.py,sha256=CSiKQGVEX459tagRjLrww6hZMZcc3r1sR2WcaTKTTWo,7864
|
6
6
|
cloudnetpy/exceptions.py,sha256=wrI0bZTwmS5C_cqOmvlJ8XJSEFyzuD1eD4voGJc_Gjg,1584
|
7
7
|
cloudnetpy/metadata.py,sha256=v_VDo2vbdTxB0zIsfP69IcrwSKiRlLpsGdq6JPI4CoA,5306
|
8
|
-
cloudnetpy/output.py,sha256=
|
8
|
+
cloudnetpy/output.py,sha256=UzF0w51c6-QEBj-NfCJg5zTIKVzcmq1HyQb-3_qWTgk,14767
|
9
9
|
cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
cloudnetpy/utils.py,sha256=-8x7LQ6WDHxf2lDZfhG50WYe2iSVLQObnVXZG46JzKI,28468
|
11
|
-
cloudnetpy/version.py,sha256=
|
11
|
+
cloudnetpy/version.py,sha256=TCoRUUzxjMCaerRhyUc-pmYLkL6lRFwWebWDoR3GJZw,73
|
12
12
|
cloudnetpy/categorize/__init__.py,sha256=gP5q3Vis1y9u9OWgA_idlbjfWXYN_S0IBSWdwBhL_uU,69
|
13
13
|
cloudnetpy/categorize/atmos.py,sha256=fWW8ye_8HZASRAiYwURFKWzcGOYIA2RKeVxCq0lVOuM,12389
|
14
14
|
cloudnetpy/categorize/atmos_utils.py,sha256=wndpwJxc2-QnNTkV8tc8I11Vs_WkNz9sVMX1fuGgUC4,3777
|
@@ -47,7 +47,7 @@ cloudnetpy/instruments/rpg.py,sha256=yQpcKcgzRvVvkl6NhKvo4PUkv9nZ69_hzzPpS2Ei-Is
|
|
47
47
|
cloudnetpy/instruments/rpg_reader.py,sha256=LAdXL3TmD5QzQbqtPOcemZji_qkXwmw6a6F8NmF6Zg8,11355
|
48
48
|
cloudnetpy/instruments/toa5.py,sha256=1JnuYViD8c_tHJZ9lf4OU44iepEkXHsXOzDfVf_b0qc,1759
|
49
49
|
cloudnetpy/instruments/vaisala.py,sha256=ektdXoID2X_V9H5Zp1fgHTUBapFMSyPVEWW_aoR6DEY,14655
|
50
|
-
cloudnetpy/instruments/weather_station.py,sha256=
|
50
|
+
cloudnetpy/instruments/weather_station.py,sha256=3_urUMWE6YYPm-bLD6Q30kSz6X0Oh1JA8VuLnHCKH3Q,13822
|
51
51
|
cloudnetpy/instruments/disdrometer/__init__.py,sha256=lyjwttWvFvuwYxEkusoAvgRcbBmglmOp5HJOpXUqLWo,93
|
52
52
|
cloudnetpy/instruments/disdrometer/common.py,sha256=g52iK2aNp3Z88kovUmGVpC54NZomPa9D871gzO0AmQ4,9267
|
53
53
|
cloudnetpy/instruments/disdrometer/parsivel.py,sha256=WiL-vCjw9Gmb5irvW3AXddsyprp8MGOfqcVAlfy0zpc,25521
|
@@ -94,7 +94,7 @@ cloudnetpy/model_evaluation/tests/unit/test_statistical_methods.py,sha256=Ra3r4V
|
|
94
94
|
cloudnetpy/model_evaluation/tests/unit/test_tools.py,sha256=Ia_VrLdV2NstX5gbx_3AZTOAlrgLAy_xFZ8fHYVX0xI,3817
|
95
95
|
cloudnetpy/plotting/__init__.py,sha256=lg9Smn4BI0dVBgnDLC3JVJ4GmwoSnO-qoSd4ApvwV6Y,107
|
96
96
|
cloudnetpy/plotting/plot_meta.py,sha256=cLdCZrhbP-gaobS_zjcf8d2xVALzl7zh2qpttxCHyrg,15983
|
97
|
-
cloudnetpy/plotting/plotting.py,sha256=
|
97
|
+
cloudnetpy/plotting/plotting.py,sha256=SrfAvILAFsqGQi-ELN1qd-6-EqfD3duV3kK_fsI4TaQ,32894
|
98
98
|
cloudnetpy/products/__init__.py,sha256=2hRb5HG9hNrxH1if5laJkLeFeaZCd5W1q3hh4ewsX0E,273
|
99
99
|
cloudnetpy/products/classification.py,sha256=pzFQtgOKS7g_3LqiAY84EFUUste-VES7CJNgoq2Bs34,7914
|
100
100
|
cloudnetpy/products/der.py,sha256=XZMbqDQUq0E9iBU3Axr-NfUJfRAhjsaGlyxJ4tKyGcw,12444
|
@@ -108,8 +108,8 @@ cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe5
|
|
108
108
|
cloudnetpy/products/mwr_tools.py,sha256=RuzokxxqXlTGk7XAOrif_FDPUJdf0j_wJgNq-7a_nK8,4684
|
109
109
|
cloudnetpy/products/product_tools.py,sha256=rhx_Ru9FLlQqCNM-awoiHx18-Aq1eBwL9LiUaQoJs6k,10412
|
110
110
|
docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
|
111
|
-
cloudnetpy-1.61.
|
112
|
-
cloudnetpy-1.61.
|
113
|
-
cloudnetpy-1.61.
|
114
|
-
cloudnetpy-1.61.
|
115
|
-
cloudnetpy-1.61.
|
111
|
+
cloudnetpy-1.61.12.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
|
112
|
+
cloudnetpy-1.61.12.dist-info/METADATA,sha256=nqWjqeDzGmg9WTD827eamk9ODfjSOOnWeqRKsKB5gZA,5785
|
113
|
+
cloudnetpy-1.61.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
114
|
+
cloudnetpy-1.61.12.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
|
115
|
+
cloudnetpy-1.61.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|