-
Notifications
You must be signed in to change notification settings - Fork 265
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
BUG: read_odim_hdf5 - TypeError: 'numpy.float32' object cannot be interpreted as an integer #1408
Comments
Do you have a sample file that could be used here? For testing? |
This ODIM It might be that there is something with the file and the way it encodes time. But I don't see anything wrong on that part. I think the problem is that |
@Vforcell My guess, too, is that it's connected to the dtype. ODIM_H5 is referencing these values as One special thing is still to this file as it contains a compound type dataset ( |
ODIM spec explicitly states the time of the startazT and stopazT must be a double aka float64. The array initialization here will coerce it into an array of float32. This seems like a fairly straightforwardly a bug, that array should be initialized as float64 and changing it to such fixes this error. |
@kmuehlbauer @tealmill thanks for your answers. @mgrover1 thanks for the Fix being implemented. Didn't know about the |
@Vforcell testing on that file to make sure things are fixed before merging |
Description
An error is raised when using
pyart.aux_io.odim_hdf5.read_odim_hdf5
:TypeError: 'numpy.float32' object cannot be interpreted as an integer
The line to blame is
pyart/pyart/aux_io/odim_h5.py
Line 333 in 75cb884
The
datetime.datetime.utcfromtimestamp
function doesn't seem to likenumpy.float32
dtype anymore.A fix (that worked for me) is to specify "float64" in the dtype of
t_data
, instead of "float32":pyart/pyart/aux_io/odim_h5.py
Line 327 in 75cb884
The text was updated successfully, but these errors were encountered: