一千萬個為什麽

搜索

關於NetCDF與HDF5關於存儲科學數據的意見?

在NetCDF和HDF5中,任何人都有足夠的經驗來提供一些關於它們的優缺點作為存儲科學數據的方式?

我已經使用了HDF5,並希望通過Java進行讀/寫,但接口本質上是C庫的一個包裝,這讓我感到困惑,所以NetCDF似乎很有趣,但我對它幾乎一無所知。

edit: my application is "only" for datalogging, so that I get a file that has a self-describing format. Important features for me are being able to add arbitrary metadata, having fast write access for appending to byte arrays, and having single-writer/multiple-reader concurrency (strongly preferred but not a must-have. NetCDF docs say they have SWMR but don't say whether they support any mechanism for ensuring that two writers can't open the same file at once with disastrous results). I like the hierarchical aspect of HDF5 (in particular I love the directed-acyclic-graph hierarchy, much more flexible than a "regular" filesystem-like hierarchy), am reading the NetCDF docs now... if it only allows one dataset per file then it probably won't work for me. :(

update — looks like NetCDF-Java reads from netCDF-4 files but only writes from netCDF-3 files which don't support hierarchical groups. darn.

update 2009-Jul-14: I am starting to get really upset with HDF5 in Java. The library available isn't that great and it has some major stumbling blocks that have to do with Java's abstraction layers (compound data types). A great file format for C but looks like I just lose. >:(

最佳答案

我強烈建議你使用HDF5而不是NetCDF。 NetCDF是平坦的,如果你不能分類的東西,它會在一段時間後變得非常骯臟。當然分類也是一個爭論的問題,但至少你有這種靈活性。

當我編寫Q5Cost時,我們對HDF5與NetCDF進行了精確的評估,最終的結果是HDF5下手。

轉載註明原文: 關於NetCDF與HDF5關於存儲科學數據的意見?