You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pyart.util.columnsect.get_field_location function is not converting time correctly when applied to the ARM SACR data. After we ran some more tests, we discovered that in that function, there is a line that converts the time units to a datetime which was outputting the incorrect timestamp (line 354). This means that it misses the hour/min/second of the file start and assumes the file starts at 00 UTC, which then provides an incorrect time_offset in the output data.
We only notice this issue with the ARM data, and had no issues with NEXRAD or GUC XPRECIP data.
What I Did
File used for testing: epckasacrcfrS2.a1.20230918.081701.nc
radar.time['units'] is '2023-09-18 08:17:01 0:00'
But the output for basetime in the columnsect function is: numpy.datetime64('2023-09-18T00:00:00.000000000')
One workaround we found is pre-processing the time units variable:
test_units = radar.time['units'][0:24] + 'T' + radar.time['units'][25:33] + 'Z'
radar.time['units'] = test_units
We haven't tested this, but I am wondering if the pyart function pyart.util.datetime_from_radar would also work for this case without having to modify the units of the variable. The output for this function from the file tested is cftime.DatetimeGregorian(2023, 9, 18, 8, 17, 1, 104959, has_year_zero=False)
The text was updated successfully, but these errors were encountered:
@aamatthews - #1529 should fix your issue! Thanks for the recommendation here on using the existing datetime util in Py-ART. We will review that, and get back to you ASAP when that is merged + released!
Description
The pyart.util.columnsect.get_field_location function is not converting time correctly when applied to the ARM SACR data. After we ran some more tests, we discovered that in that function, there is a line that converts the time units to a datetime which was outputting the incorrect timestamp (line 354). This means that it misses the hour/min/second of the file start and assumes the file starts at 00 UTC, which then provides an incorrect time_offset in the output data.
We only notice this issue with the ARM data, and had no issues with NEXRAD or GUC XPRECIP data.
What I Did
File used for testing: epckasacrcfrS2.a1.20230918.081701.nc
radar.time['units'] is '2023-09-18 08:17:01 0:00'
But the output for basetime in the columnsect function is: numpy.datetime64('2023-09-18T00:00:00.000000000')
One workaround we found is pre-processing the time units variable:
test_units = radar.time['units'][0:24] + 'T' + radar.time['units'][25:33] + 'Z'
radar.time['units'] = test_units
We haven't tested this, but I am wondering if the pyart function pyart.util.datetime_from_radar would also work for this case without having to modify the units of the variable. The output for this function from the file tested is cftime.DatetimeGregorian(2023, 9, 18, 8, 17, 1, 104959, has_year_zero=False)
The text was updated successfully, but these errors were encountered: