### The problem

When a data variable has dimensions that have been compressed by gathering 
(http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html#compression-by-gathering),
 the conventions currently make no statement on whether or not any related 
auxiliary coordinate, cell measure or ancillary variables that spans those 
dimensions must also be compressed, or whether such attached variables may be 
compressed across a different list of dimensions.

The situation is, however, clarified in the conformance document 
(http://cfconventions.org/Data/cf-documents/requirements-recommendations/requirements-recommendations-1.7.html),
 which states that attached variables must span a subset of the actual 
dimensions spanned by the data variable (sections 5 and 7.2). There are 
exceptions to this rule for auxiliary coordinate variables, for character 
arrays and DSG ragged arrays, but they do not apply to compression by gathering.

### Proposed solution

I propose that the conformance document is correct, and we would be fixing a 
defect in the conventions to clarify this in the main text.

### Backwards compatibility
I see no problems, because If there are existing datasets that apply 
compression differently to related variables than to the data variable, then 
these datasets would already fail the tests from the conformance document.

### Changes required

#### A. Add a third paragraph to section 8.2

```
Any auxillary coordinate, cell measure or ancillary variables related
to a compressed data variable must not be compressed unless it can be
compressed using the same list variable indices as used by the data
variable, in which case compression must be applied. This will occur
for a related variable for which, when uncompressed, the individual
compressed axes appear adjacently and in the same order as the data
variable.
```

#### B. Update Example 8.1 to include a 2-d auxiliary coordinate variable:

Example 8.1. Horizontal compression of a three-dimensional array

```
dimensions:
  lat=73;
  lon=96;
  landpoint=2381;
  depth=4;
variables:
  int landpoint(landpoint);
    landpoint:compress="lat lon";
  float landsoilt(depth,landpoint);
    landsoilt:long_name="soil temperature";
    landsoilt:units="K";
    landsoilt:coordinates="soil_type";
  float depth(depth);
  float lat(lat);
  float lon(lon);
  int soil_type(landpoint);
     soil_type:long_name="integer code defining the soil type";
data:
  landpoint=363, 364, 365, ...;
```
  

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/cf-convention/cf-conventions/issues/147

Reply via email to