NCAS-CMS / NCAS-CMS/cf-python

Accessibility of key domain information

Open
#771 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API review (4.0.0) enhancement
Dominant language
Python
Stars
150
Forks
23
Avg merge
1d 11h
Merged PRs (30d)
2

Description

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()?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Field representation shown in the issue and inspect how cell methods, cell measures, domains, and coordinate axes are exposed. Determine an appropriate public entry point for retrieving the statistics information independently of print output. Done means a field, domain, and selected axes can return the relevant cell-method information in a usable form, with behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.