Open neumannd opened 4 years ago
The CF Conventions just recommend (2.4. Dimensions):
All other dimensions should, whenever possible, be placed to the left of the spatiotemporal dimensions.
However, in the IOOS CC CF Plugin this is check as requirement and not as recommendation (regx = regex.compile(r"^[^TZYX]*T?Z?Y?X?$")
):
def _dims_in_order(self, dimension_order):
"""
:param list dimension_order: A list of axes
:rtype: bool
:return: Returns True if the dimensions are in order U*, T, Z, Y, X,
False otherwise
"""
regx = regex.compile(r"^[^TZYX]*T?Z?Y?X?$")
dimension_string = "".join(dimension_order)
return regx.match(dimension_string) is not None
I would suggest to check for "^[^TZYX]*T?Z?Y?X?[^TZYX]*$"
. However, this might lead to some new issues as some errors might not be captured anymore: if spatio-temporal dimensions are not recognized as such, they might be given in any order.
Correction. The additional dimension of histogram_
standard names is suggested to be left of TZYX as this example from a mailing list post indicates (by Jonathan Gregory, Fri Oct 14 03:27:22 MDT 2016).
// source variable
float tair(time,altitude,latitude,longitude);
tair:units="K";
tair:standard_name="air_temperature";
tair:cell_methods="altitude: mean area: mean time: mean";
// resulting probability_density_function_ variable
float pair(tair,time,altitude);
pair:standard_name="probability_density_function_of_air_temperature";
pair:units="K-1";
pair:cell_methods="altitude: mean time: mean area: sum tair: mean";
pair:coordinates="latitude longitude"; // to record the ranges
This only leaves the taxon names concept of CF 1.8 to be special case as example 6.1.2 suggests:
float abundance(time,taxon) ;
abundance:standard_name = "number_concentration_of_organisms_in_taxon_in_sea_water" ;
abundance:coordinates = "taxon_lsid taxon_name" ;
There are some CF standard names that need an additional dimension beyond the temporal and spatial dimensions. These standard names are of one of these types (see Guidelines for Construction of CF Standard Names):
An examples header using one of these standard names is this one:
If we provide this header to the IOOS Compliance Checker CF Plugin we get:
I don't have a fix yet. If I find some time in the beginning of next week, I will try to provide a PR. After that I will not be available for two month.