Skip to content

truncated comments in cell_methods  #4427

@larsbarring

Description

@larsbarring

🐛 Bug Report

In code that sequentially aggregated observational data it seems that cell_methods comments may be truncated under certain circumstances. This is an excerpt from a file produced by iris 3.1.0:

 !ncdump -h myfile.nc 
     float tasmin(y, x) ;
        tasmin:standard_name = "air_temperature" ;
        tasmin:long_name = "Daily Minimum Near-Surface Air Temperature" ;
        tasmin:units = "K" ;
        tasmin:cell_methods = "time: minimum within days (comment: 18h(day-1)-18h) time: mean over days time: mean" ;
        tasmin:grid_mapping = "lambert_conformal_conic" ;
        tasmin:coordinates = "height lat lon time" ;

Note the parenthesis within the cell_method comment. The cell methods represent

  1. minimum within day (i.e., 18 UTC the day before to 18 UTC)
  2. mean over days [within the month] of the daily minima
  3. mean over months [within the year] of the daily minima

where the aim is to compact 2 and 3 to
2. mean over days [within the year] of the daily minima

However, this is how it looks when reading this file into iris:

 air_temperature / (K)                                  (projection_y_coordinate: 823; projection_x_coordinate: 567)
    ....
    Cell methods:
        minimum within days                              time (18h(day-1)
        mean over days                                   time
        mean                                             time

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions