Skip to content

Sometimes you can have two CF_Roles #1284

@RoryMMMM

Description

@RoryMMMM

Version of compliance checker running:
5.4.2

Describe the checker this affects:
CF-1.11 Checker

Attach a minimal CDL or NetCDF file which is able to reproduce the issue
I have a file with attributes:

global_attributes:
  conventions: "CF-1.11" # Should this be verified or trusted?
  title: "Oceanographic Sensor Data" # title for this sensors observations...
  institution: "VLIZ (MRC)"
  source: "Sensor Observation"
  history: "Created by 'mrc-ingest' Python library"
  references: "https://git.vliz.be/mrc/data-processing/sensor-ingest"
  featureType: timeSeriesProfile #https://cfconventions.org/Data/cf-conventions/cf-conventions-1.13/cf-conventions.html#time-series-profiles

and with both "depth" having a cf_role = "profile_id" and and "time" with a cf_role of "timeseries_id"

To Reproduce:

Describe the issue below:

I'm running a self generated netCDF file through the CF checker. This is generated from CTD sensor observations and, from my understanding, should be considered a "timeSeriesProfile". Data is related to time and depth (as the CTD winch is lowered and raised over time).
In my netcdf there are attributes linked to time and depth: "depth" having a cf_role = "profile_id" and and "time" with a cf_role of "timeseries_id"
I get the error: "There may only be one variable containing the cf_role attribute. Currently the following variables have cf_role attributes: ['Depth', 'time']"

but having a look at the CF standards:
CF files that contain timeSeries, profile or trajectory featureTypes, should include only a single occurrence of a cf_role attribute; CF files that contain timeSeriesProfile or trajectoryProfile may contain two occurrences, corresponding to the two levels of structure in these feature types.

Looks like the logic in check_single_cf_role(self, ds): might need to be tweaked a little.

I'm very inexperienced with all this, so I might be making a mistake here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions