NCAS-CMS / cfa-conventions

NetCDF Climate and Forecast Aggregation (CFA) Conventions
https://github.com/NCAS-CMS/cfa-conventions/blob/main/source/cfa.md
1 stars 1 forks source link

Allow scalar `address` variables #45

Closed davidhassell closed 1 year ago

davidhassell commented 1 year ago

For the file formats, we allow a scalar variable to contain a file format that applies to all files, e.g.

  aggregation_file = "January-June.nc", "July-December.nc" ;
  aggregation_address = "temp", "temp" ;
  aggregation_format = "nc" ;

The text that describes this is:

A scalar format variable is a convenience feature that may be used when all
named fragment files have the same format. In this case the single value is
assumed to apply to all fragments that have a file representation, i.e. those
fragments that correspond to non-missing values in the file variable. If the
file variable contains only missing values, then the format variable is not
used, and so may take an arbitrary value.

I propose extending this to the address variable. I.e. if all of the file addresses are the same then they can be collapsed to a scalar. In the above example this could look like:

  aggregation_file = "January-June.nc", "July-December.nc" ;
  aggregation_address = "temp" ;
  aggregation_format = "nc" ;

I think that this makes the address and format variables consistent, and in many use cases all of the netCDF (not PP!) addresses will indeed be the same.

JonathanGregory commented 1 year ago

That makes sense.

davidhassell commented 1 year ago

Thanks - everyone seems happy with this small change, so I'll merge ...