hdf5-udf
hdf5-udf copied to clipboard
Possible to parameterize UDF with dataset selection coordinates?
I think this is a super cool library. I was wondering if it would be possible, instead of writing a function with no arguments, whether this library could be extended so that the user defined function only has to generate data corresponding to the selection of the read operation. Even if coordinate + offset was the only supported selection functionality I still think this would be super useful. Now that I think about it more, I suppose it might be possible to emulate some of this functionality with virtual datasets?
Hi, Nicholas. Thanks for the compliment!
HDF5-UDF is implemented on top of the HDF5 I/O filter API. That API is a bit limited in the sense that it does not provide important information to the filter callback: the file, dataspace and hyperslab handles are not known to the filter, for instance. I have a working patchset that modifies the filter API to pass some of that information to the callbacks, but it has not been merged into HDF5 yet. I will look into submitting the patch once again to the project in the coming days.
One possible workaround for now would be to use environment variables, but you'd have to modify the reader so that the selection area is exported through setenv() and to include calls to getenv() on the UDF side.
Virtual datasets should be able to do that as long as all you need to do is to "glue" different datasets (as in a mosaic).