Re: Copying HDF5 datasets to a new HDF5 file [message #93879 is a reply to message #93876] |
Mon, 14 November 2016 17:14   |
ZP Yin
Messages: 3 Registered: April 2016
|
Junior Member |
|
|
On Tuesday, November 15, 2016 at 4:22:36 AM UTC+8, kimber...@noaa.gov wrote:
> Hello,
>
> I am using data from an existing HDF5 file to create new products that I would like to save into a new HDF5 file. Is there an easy way to copy some of the information from the input file to the output file? For example, I would like to retain all of the file attribute information and some, but not all, of the original datasets, and then add my new data products.
>
> The other way I thought to accomplish this was to create a copy of the original file and then delete the datasets and/or attributes I no longer need, but I didn't see an easy way to delete information either.
>
> Lastly, I was wondering if there is any good information on creating HDF5 files in IDL. I have found the IDL help to be less than informative and I was hoping to find some good explanations of what some of the H5x_xxx programs do.
>
> Any suggestions or ideas would be greatly appreciated.
>
> Thanks,
> Kim
Hello, Kim!
I have met the same problems too. Here is my suggestions and I hope they could be useful for you.
For the first problem, I find there is no 'easy' way to transfer the information. And I will choose the information manually, then transfer them one by one. Then add my new datasets. I think 'H5_PUTDATA'(IDL 8.5) will be helpful.
http://www.harrisgeospatial.com/docs/H5_PUTDATA.html
For the second problem, it seems that 'HDF5 does not provide a mechanism to remove a dataset from a file at this time, it is not possible to put a dataset into a file if the ID to that dataset already exists.'(http://www.harrisgeospatial.com/docs/H5_PUTDATA.html
). But there is an way to make the datasets invisible( https://support.hdfgroup.org/HDF5/doc1.6/UG/10_Datasets.html) instead of deleting it.
For the third problem, I have the same feelings with you. So when I deal with these problems about H5x_xxx programs I will try a lot and read a lot information in some websites. And then ask for help like you do!
:)
|
|
|