pwcazenave/netcdf2json

how to use it?

Closed this issue · 1 comments

hello,I'm learning the earth project.Then I found your project,but I do not know how to use your tool.I have never learn the python.I try to understand the code,Then I want to know how to use.And Could you show me the .nc file? How many this tool needs the .nc file?And that,I need the ocean data.

You need to know the variable names of the fields you want to plot from the netCDF file, then you need to initialise a Config class:

data_config = Config(file='file.nc', uname='u_variable', vname='v_variable', xname='lon', yname='lat', xdim='x', ydim='y', tdim='time')

Then you can process those files defined in data_config:

velocity = Process('file.nc', data_config.uname, config=data_config)

That should produce the JSON files of the velocity data. You will need to repeat this for the colour field (e.g. Chlorophyll, in my case).

If, however, this is your first foray into python, it might not be the best place to start as this was something I wrote quickly and have since largely ignored.