ioos / compliance-checker

Python tool to check your datasets against compliance standards
http://ioos.github.io/compliance-checker/
Apache License 2.0
108 stars 58 forks source link

Add check for coordinate system definition #372

Closed lukecampbell closed 8 years ago

lukecampbell commented 8 years ago

All of a variable’s spatiotemporal dimensions that are not latitude, longitude, vertical, or time dimensions are required to be associated with the relevant latitude, longitude, vertical, or time coordinates via the new coordinates attribute of the variable. The value of the coordinates attribute is a blank separated list of the names of auxiliary coordinate variables. There is no restriction on the order in which the auxiliary coordinate variables appear in the coordinates attribute string. The dimensions of an auxiliary coordinate variable must be a subset of the dimensions of the variable with which the coordinate is associated, with two exceptions. First, string-valued coordinates (Section 6.1, "Labels") have a dimension for maximum string length. Second, in the ragged array representations of data (Chapter 9, Discrete Sampling Geometries), special methods are needed to connect the data and coordinates

This was a hard read but basically:

for each geophysical variable
  for each coordinate-type that is lat/lon/time/z
    assert coordinate-type is associated to the geophysical variable.

The association can be:

lukecampbell commented 8 years ago

The more I read this the more it hurts, and my interpretation has changed. CF allows for multiple coordinate variables, for example in ROMS datasets with staggered grids, there are 3 types of coordinates, eta_u, eta_v and rho. This is allowed, so the idea that every geophysical variable must be associated with every coordinate is wrong.

I think the best we can do with this one is to check that any auxiliary coordinates have a subset of dimensions, like we do with grids.