⇐ ⇒

[CF-metadata] vertical coordinates and positive attributes

From: John Graybeal <john.graybeal>
Date: Fri, 24 Jan 2014 11:49:05 -0800

I am wrestling with how CF identifies vertical coordinates and uses the positive attribute. Can someone confirm what I've come up with? (All the relevant sections I found are appended to the end of this mail, to save people searching.)

I'll just list the questions that follow from close analysis of the specification, and the answers I've pieced together.

1) What are the exact conditions that _require_ the positive attribute?
    I believe they are: a) variable is a coordinate variable => '1-dimensional netCDF variables whose dimension names are identical to their variable names', OR is an auxiliary coordinate variable; b) the variable represents a vertical axis in the real world; c) units are not pressure.

2) What is appropriate application behavior if standard_name conflicts with the positive attribute? For example, standard_name=depth, but positive=up -- this is a conflict, since depth for example is defined as "Depth is the vertical distance below the surface."
   I think this situation is undefined, but given the ambiguity of the definition with respect to sign, perhaps the positive attribute should be treated as definitive.

3) Can positive attribute be applied to a variable that is not a (auxiliary) coordinate variable? The existing language says "This attribute may be applied to either coordinate variables or auxillary coordinate variables that contain vertical coordinate data.", which is silent about just regular data, and the attributes list says it only applies to Coordinate variables.
   It should be OK; I see nothing expressly prohibiting this, either in the spec or in undesirable side effects. Often depth (for example) is just a measured value, and is not used in the file as a coordinate axis. And I think it is common to use positive for any vertically-oriented variable; as long as that variable is not a coordinate variable already (1D name(name)), the system will not promote it to one just based on the positive attribute. And, everyone does it.

4) Can an application infer a vertical axis entirely from the existence of axis=Z or standard_name=depth or altitude? Or does it have to check the units/positive to confirm?
   If I understand correctly, while conformance with CF requires the units/positive attributes as described above, the intent of the axis and standard_name options is to make it possible for an application to confirm a vertical coordinate as soon as it finds either of those indications.

John



*** CF 1.3 Overview

Vertical coordinates with units of pressure may also be identified by the units attribute. Other vertical coordinates must use the attribute positive which determines whether the direction of increasing coordinate value is up or down. Because identification of a coordinate type by its units involves the use of an external software package [UDUNITS], we provide the optional attribute axis for a direct identification of coordinates that correspond to latitude, longitude, vertical, or time axes.


*** CF 4. Coordinate Types

We continue to support the special role that the units and positive attributes play in the COARDS convention to identify coordinate type.
...
Because identification of a coordinate type by its units is complicated by requiring the use of an external software package [UDUNITS], we provide two optional methods that yield a direct identification. The attribute axis may be attached to a coordinate variable and given one of the values X, Y, Z or T which stand for a longitude, latitude, vertical, or time axis respectively. Alternatively the standard_name attribute may be used for direct identification. But note that these optional attributes are in addition to the required COARDS metadata.
...
The methods of identifying coordinate types described in this section apply both to coordinate variables and to auxiliary coordinate variables named by the coordinates attribute (see Chapter 5, Coordinate Systems ).


*** CF 4.3. Vertical (Height or Depth) Coordinate

The direction of positive (i.e., the direction in which the coordinate values are increasing), whether up or down, cannot in all cases be inferred from the units. The direction of positive is useful for applications displaying the data. For this reason the attribute positive as defined in the COARDS standard is required if the vertical axis units are not a valid unit of pressure (a determination which can be made using the udunits routine, utScan) -- otherwise its inclusion is optional. The positive attribute may have the value up or down (case insensitive). This attribute may be applied to either coordinate variables or auxillary coordinate variables that contain vertical coordinate data.

For example, if an oceanographic netCDF file encodes the depth of the surface as 0 and the depth of 1000 meters as 1000 then the axis would use attributes as follows:
   axis_name:units = "meters" ;
   axis_name:positive = "down" ;
      
If, on the other hand, the depth of 1000 meters were represented as -1000 then the value of the positive attribute would have been up. If the units attribute value is a valid pressure unit the default value of the positive attribute is down.

A vertical coordinate will be identifiable by:
        ? units of pressure; or
        ? the presence of the positive attribute with a value of up or down (case insensitive).

Optionally, the vertical type may be indicated additionally by providing the standard_name attribute with an appropriate value, and/or the axis attribute with the value Z.


*** CF Appendix A. Attributes

Attribute Type Use Links Description
positive S C [COARDS] Direction of increasing vertical coordinate value.


*** COARDS Vertical (height or depth) dimension: (not quite identical to 4.3 -- in particular 4.3 adds a final sentence)

The direction of positive, whether up or down, cannot in all cases be inferred from the units. The direction of positive is useful for applications displaying the data. For this reason the new attribute positive is defined in this standard. The inclusion of the positive attribute is required by this standard if the vertical axis units are not a valid unit of pressure (a determination which can be made using the udunits routine, utScan) -- otherwise its inclusion is optional. The positive attribute may have the value "up" or "down" (case insensitive).

For example, if an oceanographic netCDF file encodes the depth of the surface as 0 and the depth of 1000 meters as 1000 then the axis would use attributes as follows:

   axis_name:units="meters";
   axis_name:positive="down";

If, on the other hand, the depth of 1000 meters were represented as -1000 then the value of the positive attribute would have been "up". If the units attribute value is a valid pressure unit the default value of the positiveattribute is "down".

A vertical coordinate variable will be identifiable by

        ? units of pressure; or
        ? the presence of the positive attribute with a value of "up" or "down" (case insensitive).


*** COARDS Coordinate Variables:

1-dimensional netCDF variables whose dimension names are identical to their variable names are regarded as "coordinate variables" (axes of the underlying grid structure of other variables defined on this dimension).



------------------------------------
John Graybeal
Marine Data Manager

M +1 408 675-5445
skype: graybealski
Marinexplore
920 Stewart Drive
Sunnyvale 94085
California, USA
www.marinexplore.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cgd.ucar.edu/pipermail/cf-metadata/attachments/20140124/8e5f49d0/attachment-0001.html>
Received on Fri Jan 24 2014 - 12:49:05 GMT

This archive was generated by hypermail 2.3.0 : Tue Sep 13 2022 - 23:02:41 BST

⇐ ⇒