cloudnetpy 1.68.0__py3-none-any.whl → 1.69.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/model.py +2 -2
- cloudnetpy/instruments/rain_e_h3.py +2 -0
- cloudnetpy/instruments/weather_station.py +49 -1
- cloudnetpy/version.py +1 -1
- {cloudnetpy-1.68.0.dist-info → cloudnetpy-1.69.0.dist-info}/METADATA +1 -1
- {cloudnetpy-1.68.0.dist-info → cloudnetpy-1.69.0.dist-info}/RECORD +10 -10
- {cloudnetpy-1.68.0.dist-info → cloudnetpy-1.69.0.dist-info}/LICENSE +0 -0
- {cloudnetpy-1.68.0.dist-info → cloudnetpy-1.69.0.dist-info}/WHEEL +0 -0
- {cloudnetpy-1.68.0.dist-info → cloudnetpy-1.69.0.dist-info}/entry_points.txt +0 -0
- {cloudnetpy-1.68.0.dist-info → cloudnetpy-1.69.0.dist-info}/top_level.txt +0 -0
cloudnetpy/categorize/model.py
CHANGED
@@ -164,11 +164,11 @@ def _calc_mean_height(model_heights: np.ndarray) -> np.ndarray:
|
|
164
164
|
|
165
165
|
def _find_model_type(file_name: str) -> str:
|
166
166
|
"""Finds model type from the model filename."""
|
167
|
-
possible_keys = ("gdas1", "icon", "ecmwf", "harmonie", "era5")
|
167
|
+
possible_keys = ("gdas1", "icon", "ecmwf", "harmonie", "era5", "arpege")
|
168
168
|
for key in possible_keys:
|
169
169
|
if key in file_name:
|
170
170
|
return key
|
171
|
-
msg = "Unknown model type"
|
171
|
+
msg = f"Unknown model type: {file_name}"
|
172
172
|
raise ValueError(msg)
|
173
173
|
|
174
174
|
|
@@ -43,6 +43,8 @@ def rain_e_h32nc(
|
|
43
43
|
rain.convert_units()
|
44
44
|
rain.normalize_rainfall_amount()
|
45
45
|
rain.add_site_geolocation()
|
46
|
+
rain.sort_timestamps()
|
47
|
+
rain.remove_duplicate_timestamps()
|
46
48
|
attributes = output.add_time_attribute({}, rain.date)
|
47
49
|
output.update_attributes(rain.data, attributes)
|
48
50
|
return output.save_level1b(rain, output_file, uuid)
|
@@ -57,6 +57,8 @@ def ws2nc(
|
|
57
57
|
ws = HyytialaWS(weather_station_file, site_meta)
|
58
58
|
elif site_meta["name"] == "Galați":
|
59
59
|
ws = GalatiWS(weather_station_file, site_meta)
|
60
|
+
elif site_meta["name"] == "Jülich":
|
61
|
+
ws = JuelichWS(weather_station_file, site_meta)
|
60
62
|
else:
|
61
63
|
msg = "Unsupported site"
|
62
64
|
raise ValueError(msg) # noqa: TRY301
|
@@ -87,7 +89,7 @@ class WS(CSVFile):
|
|
87
89
|
date: list[str]
|
88
90
|
|
89
91
|
def calculate_rainfall_amount(self) -> None:
|
90
|
-
if "rainfall_amount" in self.data:
|
92
|
+
if "rainfall_amount" in self.data or "rainfall_rate" not in self.data:
|
91
93
|
return
|
92
94
|
resolution = np.median(np.diff(self.data["time"].data)) * SEC_IN_HOUR
|
93
95
|
rainfall_amount = ma.cumsum(self.data["rainfall_rate"].data * resolution)
|
@@ -116,6 +118,8 @@ class WS(CSVFile):
|
|
116
118
|
self.data["relative_humidity"].data = self.data["relative_humidity"][:] / 100
|
117
119
|
|
118
120
|
def convert_rainfall_rate(self) -> None:
|
121
|
+
if "rainfall_rate" not in self.data:
|
122
|
+
return
|
119
123
|
rainfall_rate = self.data["rainfall_rate"][:]
|
120
124
|
self.data["rainfall_rate"].data = rainfall_rate / 60 / 1000 # mm/min -> m/s
|
121
125
|
|
@@ -438,3 +442,47 @@ class GalatiWS(WS):
|
|
438
442
|
def convert_pressure(self) -> None:
|
439
443
|
mmHg2Pa = 133.322
|
440
444
|
self.data["air_pressure"].data = self.data["air_pressure"][:] * mmHg2Pa
|
445
|
+
|
446
|
+
|
447
|
+
class JuelichWS(WS):
|
448
|
+
def __init__(self, filenames: list[str], site_meta: dict):
|
449
|
+
super().__init__(site_meta)
|
450
|
+
self.filename = filenames[0]
|
451
|
+
self._data = self._read_data()
|
452
|
+
|
453
|
+
def _read_data(self) -> dict:
|
454
|
+
keymap = {
|
455
|
+
"TIMESTAMP": "time",
|
456
|
+
"AirTC_Avg": "air_temperature",
|
457
|
+
"RH": "relative_humidity",
|
458
|
+
"BV_BP_Avg": "air_pressure",
|
459
|
+
"WS_ms_S_WVT": "wind_speed",
|
460
|
+
"WindDir_D1_WVT": "wind_direction",
|
461
|
+
}
|
462
|
+
expected_units = {
|
463
|
+
"AirTC_Avg": "Deg C",
|
464
|
+
"RH": "%",
|
465
|
+
"BV_BP_Avg": "hPa",
|
466
|
+
"WS_ms_S_WVT": "meters/Second",
|
467
|
+
"WindDir_D1_WVT": "Deg",
|
468
|
+
}
|
469
|
+
units, process, rows = read_toa5(self.filename)
|
470
|
+
for key in units:
|
471
|
+
if key in expected_units and expected_units[key] != units[key]:
|
472
|
+
msg = (
|
473
|
+
f"Expected {key} to have units {expected_units[key]},"
|
474
|
+
f" got {units[key]} instead"
|
475
|
+
)
|
476
|
+
raise ValueError(msg)
|
477
|
+
|
478
|
+
data: dict[str, list] = {keymap[key]: [] for key in units if key in keymap}
|
479
|
+
for row in rows:
|
480
|
+
for key, value in row.items():
|
481
|
+
if key not in keymap:
|
482
|
+
continue
|
483
|
+
parsed = value
|
484
|
+
if keymap[key] != "time":
|
485
|
+
parsed = float(value)
|
486
|
+
data[keymap[key]].append(parsed)
|
487
|
+
|
488
|
+
return self.format_data(data)
|
cloudnetpy/version.py
CHANGED
@@ -9,7 +9,7 @@ cloudnetpy/metadata.py,sha256=gEHwqEMY9gfaqVxx2_CobLg3i5gFXAumXLwnnW4BqtU,5840
|
|
9
9
|
cloudnetpy/output.py,sha256=lq4YSeMT_d-j4rlQkKm9KIZ8boupTBBBKV1eUawpmCI,15672
|
10
10
|
cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
cloudnetpy/utils.py,sha256=U0iMIKPiKLrLVAfs_u9pPuoWYW1RJHcM8dbLF9a4yIA,29796
|
12
|
-
cloudnetpy/version.py,sha256=
|
12
|
+
cloudnetpy/version.py,sha256=FqujXpPhly4sMRqVkoBdvTCkTm5g4vZ527GwQzZZ23g,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
|
@@ -24,7 +24,7 @@ cloudnetpy/categorize/insects.py,sha256=9J5agmktit8Or66GGNue-bThiaG9rB2SuPNZBXI7
|
|
24
24
|
cloudnetpy/categorize/itu.py,sha256=fnyPE4FreZhwXHJbOPTlHKeG9hTXuJZIKt_VBUQqiJo,10234
|
25
25
|
cloudnetpy/categorize/lidar.py,sha256=YQrM_LOz8NQrrD9l9HyujV1GSGwkQ8LMqXN13bEJRW4,2605
|
26
26
|
cloudnetpy/categorize/melting.py,sha256=Oi80SrB4pNBhZlFhb6ayXkT2KMtXXV2rYu6jzEGn7tg,6211
|
27
|
-
cloudnetpy/categorize/model.py,sha256=
|
27
|
+
cloudnetpy/categorize/model.py,sha256=QFRCY0TvM2fzGRyP8BNkqbvu13XcQjt7TsN5fhjI_Uc,6654
|
28
28
|
cloudnetpy/categorize/mwr.py,sha256=F7cquERWL6mBkgboqeaCIPf9gOlKI-NWUQIBdQXGT_I,1635
|
29
29
|
cloudnetpy/categorize/radar.py,sha256=0Wg5u2aLXRVhHiFiXb4fSqY_iGgSwcCMMVshM3wBoo0,14149
|
30
30
|
cloudnetpy/categorize/attenuations/__init__.py,sha256=CWFHVWeTIe2hrZtgkJaX2HGftbuffsFc39Mzv5B0Lw0,1037
|
@@ -50,12 +50,12 @@ cloudnetpy/instruments/nc_lidar.py,sha256=5gQG9PApnNPrHmS9_zanl8HEYIQuGRpbnzC3wf
|
|
50
50
|
cloudnetpy/instruments/nc_radar.py,sha256=AjPn3mkq5a1mE7YzKtZnxX5suNju9NhUq-TDvs7T_uU,6911
|
51
51
|
cloudnetpy/instruments/pollyxt.py,sha256=ra7sYQ_cmkC0T9TBYrMN6iiQEZimmWGdW9Ilv61JB-Q,10027
|
52
52
|
cloudnetpy/instruments/radiometrics.py,sha256=ySG4a042XkgjMTG8d20oAPNvFvw9bMwwiqS3zv-JF_w,11825
|
53
|
-
cloudnetpy/instruments/rain_e_h3.py,sha256=
|
53
|
+
cloudnetpy/instruments/rain_e_h3.py,sha256=IY-ytMjQUV94qMQgIXMJsPXe6oF3yk-d9LIbN19ogv0,5376
|
54
54
|
cloudnetpy/instruments/rpg.py,sha256=vfs_eGahPOxFjOIBczNywRwtdutOsJpSNeXZm99SIOo,17438
|
55
55
|
cloudnetpy/instruments/rpg_reader.py,sha256=ThztFuVrWxhmWVAfZTfQDeUiKK1XMTbtv08IBe8GK98,11364
|
56
56
|
cloudnetpy/instruments/toa5.py,sha256=CfmmBMv5iMGaWHIGBK01Rw24cuXC1R1RMNTXkmsm340,1760
|
57
57
|
cloudnetpy/instruments/vaisala.py,sha256=GGuA_v4S7kR9yApSr1-d0ETzNj4ehEZ7-pD1-AdPYRE,14662
|
58
|
-
cloudnetpy/instruments/weather_station.py,sha256=
|
58
|
+
cloudnetpy/instruments/weather_station.py,sha256=jSu9sY2LYV1ssWcuLr6kiF8EEqGW29mywE9UUZccac0,18720
|
59
59
|
cloudnetpy/instruments/disdrometer/__init__.py,sha256=lyjwttWvFvuwYxEkusoAvgRcbBmglmOp5HJOpXUqLWo,93
|
60
60
|
cloudnetpy/instruments/disdrometer/common.py,sha256=g52iK2aNp3Z88kovUmGVpC54NZomPa9D871gzO0AmQ4,9267
|
61
61
|
cloudnetpy/instruments/disdrometer/parsivel.py,sha256=HJZrEysQkx9MiIVPDV25CYHpXi_SjgZlgO-otoaKK34,25640
|
@@ -116,9 +116,9 @@ cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe5
|
|
116
116
|
cloudnetpy/products/mwr_tools.py,sha256=rd7UC67O4fsIE5SaHVZ4qWvUJTj41ZGwgQWPwZzOM14,5377
|
117
117
|
cloudnetpy/products/product_tools.py,sha256=uu4l6reuGbPcW3TgttbaSrqIKbyYGhBVTdnC7opKvmg,11101
|
118
118
|
docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
|
119
|
-
cloudnetpy-1.
|
120
|
-
cloudnetpy-1.
|
121
|
-
cloudnetpy-1.
|
122
|
-
cloudnetpy-1.
|
123
|
-
cloudnetpy-1.
|
124
|
-
cloudnetpy-1.
|
119
|
+
cloudnetpy-1.69.0.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
|
120
|
+
cloudnetpy-1.69.0.dist-info/METADATA,sha256=Z7Fidx0_ymAob75YLglh7Y7ugOWbipLZxSAq9XWOi7A,5793
|
121
|
+
cloudnetpy-1.69.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
122
|
+
cloudnetpy-1.69.0.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
|
123
|
+
cloudnetpy-1.69.0.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
|
124
|
+
cloudnetpy-1.69.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|