lutraconsulting / MDAL

Mesh Data Abstraction Library
http://www.mdal.xyz/
MIT License
160 stars 50 forks source link

HDF5-DIAG error #342

Closed jmpmcmanus closed 3 years ago

jmpmcmanus commented 3 years ago

Hi - This problem is related to issue 155 (https://github.com/lutraconsulting/MDAL/issues/155). I'm using MDAL, in QGIS 3.16.1, to read ADCIRC NetCDF mesh files. The files are being read correctly, however the following HDF5-DIAG error message is printed to screen. This is causing problems when we try running our program using kubernetes.

HDF5-DIAG: Error detected in HDF5 (1.10.6) thread 139951069413888:

000: H5A.c line 430 in H5Aopen(): unable to load attribute info from object header for attribute: 'File Type'

major: Attribute
minor: Can't open object

001: H5Aint.c line 433 in H5A__open(): unable to load attribute info from object header for attribute: 'File Type'

major: Attribute
minor: Can't open object

002: H5Oattribute.c line 497 in H5O__attr_open_by_name(): can't open attribute

major: Attribute
minor: Can't open object

003: H5Adense.c line 429 in H5A__dense_open(): can't locate attribute in name index

major: Attribute
minor: Object not found

What is the reason for this error?

Thanks Jim

PeterPetrik commented 3 years ago

I think it is coming from the different driver when MDAL tries to detect which one to use... can you force Ugrid driver by prefixing your filename with Ugrid:"filename" ?

if that does not help, it means we need to use HDF api differently to not throw the errors.

can you give a minimum example to replicate?

jmpmcmanus commented 3 years ago

Would Ugrid:"filename" be in the netcdf file as meta data, or would I use it when running mdal? I'm using pyqgis to read the mesh data, in the netcdf file, with mdal. The pyqgis command is layer = QgsMeshLayer(inputFile, meshlayer, 'mdal')

Where inputFile is the netcdf file name including its directory path: /home/jmcmanus/Work/Surge/Data/apsviz/input/maxele.63.nc

and meshlayer is the name of the variable in the netcdf file: maxele

I did try the command: layer = QgsMeshLayer('Ugrid:'+inputFile, meshlayer, 'mdal')

but got this error: ERROR: Status 2: File Ugrid:/home/jmcmanus/Work/Surge/Data/apsviz/input/maxele.63.nc could not be found

ThanksJim On Thursday, March 4, 2021, 04:18:36 AM EST, Peter Petrik notifications@github.com wrote:

I think it is coming from the different driver when MDAL tries to detect which one to use... can you force Ugrid driver by prefixing your filename with Ugrid:"filename" ?

if that does not help, it means we need to use HDF api differently to not throw the errors.

can you give a minimum example to replicate?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

PeterPetrik commented 3 years ago
layer = QgsMeshLayer('Ugrid:"/Users/peter/MDAL/UGRID/QGIS_UGRID_1D2D/c02_classmap_ucmagdir/simplebox_clm.nc"', "meshlayer", 'mdal')
layer
<QgsMeshLayer: 'meshlayer' (mdal)>
jmpmcmanus commented 3 years ago

Thanks!

On Friday, March 5, 2021, 02:16:25 AM EST, Peter Petrik <notifications@github.com> wrote:  

Closed #342.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.