Open thmihnea opened 1 month ago
Hey @thmihnea,
so what you have is multiple files such as simData_0.h5, simData_10.h5, simData_20.h5
and you want to merge them into a single one, e.g. simData.h5
?
We already have a command-line tool that can do exactly that, it is installed along with openPMD-api. You can look up its documentation via openpmd-pipe --help
. Something like openpmd-pipe --infile simData_%T.h5 --outfile simData.h5
should do the trick.
I'm not sure what causes the error that you see. In any case, I'd suggest running it_new.close()
at the end of each Iteration to avoid building up too much memory. If you're then still interested in debugging this, the environment variable export OPENPMD_VERBOSE=1
will give more information on what is internally happening.
Hey @franzpoeschel, Thank you very much for the prompt response.
I have devised a workaround using h5py directly, and I achieved the result I wanted. For now, it seems that it is working properly - I will come back if I encounter any bugs and I choose to use the command.
Thank you again!
Combining multiple openPMD files into a single one.
Hi, I am trying to combine multiple openPMD files into a single one. Currently, I have wrote the piece of code as seen below:
However, whenever I attempt to create the file using flush(), openPMD cannot create the file:
Does anybody know why exactly this fails? I am essentially trying to copy off data from each iteration within the OpenPMDTimeSeries object into a new object and then save it.