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

Automatically calculate temporal/spatial extent attributes #17

Closed mhidas closed 5 years ago

mhidas commented 6 years ago

Once a template has been fully completed with data arrays, the code could use the ranges in the relevant time and spatial variables to calculate the values of the global attributes time_coverage_min/max, geospattial_lat_min/max etc..., as done e.g. here

lbesnard commented 6 years ago

all of these features are IMOS specific ones. It should be optional

ocehugo commented 6 years ago

I agree, this should be handled by a top class that use the template infrastructure. This doesn't even need to lie in this repo i think.

mhidas commented 6 years ago

Ok, it's not part of templating, but this repo is about more than that. The way I see it, its main purpose is to streamline the creation of netCDF files within the AODN infrastructure. Most of these files will need to be CF and usually IMOS compliant. If we can have generic code here that fills out these global attributes, then we don't need to do the same thing over and over again in all the aodndata code.

Yes, this functionality can be optional, and could be part of a sub-class. It can be added in a later version, but I think it will be useful.

By the way, these global attributes are also recommended by ACDD

ggalibert commented 6 years ago

By the way, these global attributes are also recommended by ACDD

and adopted/recommended by NODC NOAA's NetCDF templates.

lbesnard commented 6 years ago

By the way, these global attributes are also recommended by ACDD

and adopted/recommended by NODC NOAA's NetCDF templates.

yes, but this tool is a generic netcdf writer. it doesn't have to be made for geographical data. So this should be optional.

Most of these files will need to be CF and usually IMOS compliant

actually no. Most won't be IMOS compliant. IMOS global attributes are IMOS only, not AODN

ocehugo commented 6 years ago

Just provide a staticmethod in a meta-class that will do the min/max and after we can inherit and use in IMOS or AODN classes...

My opinion is that those classes can be in the source of this repo, as long it has proper names and is separated from the main core source file ( we could add say NOAA.py/IMOS.py/etc...). In the end, they can will work also as examples of post processing of attributes.