cf-python
cf-python copied to clipboard
Accessibility of key domain information
In introducing CF concepts I find I want to introduce three separate ideas (see [attached lecture excerpt])(https://github.com/NCAS-CMS/cf-python/files/15261595/lecture05-cfconcepts.pdf)
- We are generally dealing with an field with a range of property values distributed across the domain of a sampling feature.
- Each of those property values is representative of the distribution of that property within or across a cell which needs to be defined by bounds.
- We use cell methods to tell us about that distribution (e.g it can be a mean over the area of the cell). cell measures tell us about the cell itself.
While I understand this stuff to some extent, I find it difficult to use the CF-Python machinery to expose their application in actual data files. In particular, e.g. for the "statistics over axes and areas", what's the most elegant method of extracting that information for a given field, domain, and set of coordinate axes? Currently I can get it in the print statement on a field, but I can't extract it in it's own right.
E.g. for this field:
Field: air_temperature (ncvar%tas)
----------------------------------
Data : air_temperature(time(1980), latitude(143), longitude(144)) K
Cell methods : area: time(1980): mean
Dimension coords: time(1980) = [1850-01-16 12:00:00, ..., 2014-12-16 12:00:00] gregorian
: latitude(143) = [-90.0, ..., 90.0] degrees_north
: longitude(144) = [0.0, ..., 357.5] degrees_east
: height(1) = [2.0] m
Cell measures : measure:area (external variable: ncvar%areacella)
Is there an elegant way of extracting
air_temperature: cell_methods='area: time : mean'
?
in some method like f.cell_methods4humans()
?