Skip to content

Commit 090183f

Browse files
committed
Merge branch 'meteoswiss-dev' into metoffice
2 parents 36596a9 + 5cecb05 commit 090183f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mwr_raw2l1/readers/reader_radiometrics_helpers.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ def get_data(data_raw, header, no_mwr=False, **kwargs):
1616
a dictionary with variable name as key and :class:`numpy.ndarray` as values
1717
"""
1818
data = get_simple_vars(data_raw, header)
19-
data['time'] = get_time(data_raw, header, 'date/time', '%m/%d/%y %H:%M:%S')
19+
try:
20+
data['time'] = get_time(data_raw, header, 'date/time', '%m/%d/%y %H:%M:%S')
21+
except ValueError:
22+
# Radiometrics changed its timestamps format with upgrade to VizMetPro.
23+
# The new format is '%Y/%m/%d %H:%M:%S' instead of '%m/%d/%y %H:%M:%S'.
24+
# This is a workaround to support both formats but a better solution would be to
25+
# add this pattern to the config file.
26+
data['time'] = get_time(data_raw, header, 'date/time', '%Y/%m/%d %H:%M:%S')
2027
if not no_mwr:
2128
data['Tb'], data['frequency'] = get_mwr(data_raw, header, **kwargs)
2229
return data

0 commit comments

Comments
 (0)