Hi Charlie !
So, I am doing that exact same thing.
1) The specification to convert netCDF/HDF5 to "a" JSON format (note the "a"
2) I wrote the parsing of the JSON format using an open source C JSON
3) left to do: the actual C code of reading/writing netCDF/HDF5 to JSON and
vice-versa (the straightforward part).
The "a" above means that JSON is not really a format in the sense of netCDF
but really a format that allows to define formats , for a lack of a better
This means that anyone that writes this tool has to write code that write in
a particular JSON representation , only valid for that tool.
Like you , I searched and there was not a good one, so I wrote one.
The first criteria was that it had to be obvious for anyone looking at the
JSON text file, that that was indeed a netCDF/HDF5 file: hierarchy clearly
show, metadata and data
My first look was HDF5-JSON
but the format seemed like a mess to look at
and the reader is written in Python
(why Phyton? HDF5 developer tools should be all about writing in C/C++)
The specification is here
Click on menu
"netCDF/HDF5 to JSON and vice-versa"
In the process I learned all about JSON and it is a neat format to represent
In particular, it allows nested structures and arrays, which suits perfectly
here are two nested groups
"dset1" : ["dataset", "STAR_INT32", 2, [3, 4], [1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12]]
This is still under development,
I would like to make this some kind of "official" netCDF/HDF5 JSON format
for the community, so I encourage anyone to read the specification
If you see any flaw in the design or antything in the design that you would
like to have change please let me know now
At the moment it only (intentionally) uses common generic features of both
netCDF and HDF5, which are the numeric atomic types and strings.
----- Original Message -----
From: "Charlie Zender" <zen...@uci.edu>
To: "netCDF Mail List" <netcdfgr...@unidata.ucar.edu>
Sent: Thursday, October 13, 2016 11:10 PM
Subject: [netcdfgroup] How to dump netCDF to JSON?
A project I am working on wants to convert netCDF files to JSON.
The requirements are to dump an arbitrary netCDF-extended file
(with groups but without funky vlen/compound types) to JSON.
The first few solutions that we googled (ncdump-json, netcdf2json.py)
do not satisfy these requirements. What is the most robust and easy
command-line tool (not web-service) that dumps netCDF to JSON?
Ideally it would be somewhat configurable like ncdump -h/-x or
Charlie Zender, Earth System Sci. & Computer Sci.
University of California, Irvine 949-891-2429 )'(
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web. Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.
netcdfgroup mailing list
For list information or to unsubscribe, visit:
Hdf-forum is for HDF software users discussion.