aodn / python-aodntools

Repository for templates and code relating to generating standard NetCDF files for the Australia Ocean Data Network
GNU Lesser General Public License v3.0
10 stars 3 forks source link

Import Hugo's code #1

Closed mhidas closed 6 years ago

mhidas commented 6 years ago

As a starting point, we're going to import @ocehugo's nc_dict.py, which already does most of what we need for netCDF templating.

ocehugo commented 6 years ago

The example is just an example.

The code accepts an empty dimension or no dimension dictionary at all (AFAICR). It will just fail at creation time though, but you can change it on the fly by going into the methods of the class before calling the create netcdf file or adding from another instance.

EDIT: I was wrong in the statement above. The code accepts only empty dims dictionaries if variables dicts are also empty. The dimensions keys (name of dimension) on the dict have to be defined in that case (they can be anything). This is a residual of feeding this class with cdlreader derived dicts.

mhidas commented 6 years ago

I'm just going to merge this in for now. We can add other tweaks and fixes after we've added some tests.