Skip to content

Commit 224d925

Browse files
committed
ENH: add support for CPC Hdf5 variable names
1 parent 2e09101 commit 224d925

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

pyart/aux_io/odim_h5.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@
216216
"CHCPC_01440": "radar_estimated_rain_rate",
217217
"CHCPC_02880": "radar_estimated_rain_rate",
218218
"CHCPC_04320": "radar_estimated_rain_rate",
219+
"CHCPCH_00005": "radar_estimated_rain_rate",
220+
"CHCPCH_00060": "radar_estimated_rain_rate",
221+
"CHCPCH_00180": "radar_estimated_rain_rate",
222+
"CHCPCH_00360": "radar_estimated_rain_rate",
223+
"CHCPCH_00720": "radar_estimated_rain_rate",
224+
"CHCPCH_01440": "radar_estimated_rain_rate",
225+
"CHCPCH_02880": "radar_estimated_rain_rate",
226+
"CHCPCH_04320": "radar_estimated_rain_rate",
219227
"CHCPCH": "radar_estimated_rain_rate",
220228
"CHRFQ": "radar_estimated_rain_rate",
221229
"CHRFO": "radar_estimated_rain_rate",
@@ -259,7 +267,7 @@ def read_odim_grid_h5(
259267
nodata=np.nan,
260268
undetect=np.nan,
261269
use_file_conversion=True,
262-
time_ref="end",
270+
time_ref="start",
263271
**kwargs,
264272
):
265273
"""
@@ -534,9 +542,7 @@ def read_odim_grid_h5(
534542
if "what" in hfile[dset] and "product" in hfile[dset]["what"].attrs:
535543
field_dic["product"] = hfile[dset]["what"].attrs["product"]
536544
if odim_object == "CVOL": # add height info
537-
field_dic[
538-
"product"
539-
] += f"_{hfile[dset]['what'].attrs['prodpar']:f}".encode()
545+
field_dic["product"] += f"_{hfile[dset]['what'].attrs['prodpar']:f}".encode()
540546
field_dic["product"] = np.bytes_(field_dic["product"])
541547

542548
fields[field_name] = field_dic
@@ -953,9 +959,7 @@ def read_odim_h5(
953959
0, delta_seconds, rays
954960
)
955961
start_epoch = t_data.min()
956-
start_time = datetime.datetime.fromtimestamp(
957-
start_epoch, datetime.timezone.utc
958-
)
962+
start_time = datetime.datetime.timezone.utcfromtimestamp(start_epoch)
959963
_time["units"] = make_time_unit_str(start_time)
960964
_time["data"] = (t_data - start_epoch).astype(float)
961965

0 commit comments

Comments
 (0)