Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect base_time for ARM radars in columnsect.get_field_location #1527

Closed
aamatthews opened this issue Mar 8, 2024 · 1 comment · Fixed by #1529
Closed

Incorrect base_time for ARM radars in columnsect.get_field_location #1527

aamatthews opened this issue Mar 8, 2024 · 1 comment · Fixed by #1529
Assignees
Labels
Bug Issue in the Code

Comments

@aamatthews
Copy link

  • Py-ART version: 1.14.1
  • Python version: 3.10.9
  • Operating System: ARM Jupyterhub

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)

@mgrover1 mgrover1 self-assigned this Mar 11, 2024
@mgrover1 mgrover1 added the Bug Issue in the Code label Mar 11, 2024
@mgrover1
Copy link
Collaborator

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue in the Code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants