Structural interoperability

Interoperability in Climate and Atmospheric sciences
FAIR NetCDF Data

What is structural interoperability?

The Problem

Can another tool determine how the dataset is organised and process it without bespoke instructions from the person who created it?

Ash, a researcher

Structural Interoperability

Different software tools can reliably understand the organisation of a dataset

  • What data objects exist (records, columns, arrays, variables)
  • How they are represented (data types, dimensions, coordinates)
  • How they relate to one another
  • Which values represent missing data
  • Whether the dataset follows expected structural rules

Machines can determine how a dataset is organised (structure), even if they do not yet understand what the values represent (semantics).

How to achieve structural interoperability?

A shared data contract

A shared data contract is an agreement about how data are organised.


At its centre is the data model: the logical structure that software expects to find.


A file extension (.csv, .nc, .tif, .zarr) is not the data model. It hints at how data are stored, but not how they are organised.

Choosing a data model

The choice reflects how you conceptualise the scientific data. Choose a representation that preserves that structure with the least flattening, reconstruction, or artificial complexity.

I think of my data as… Natural model
“a collection of observations” Tabular
“variables varying along several shared dimensions” Multidimensional arrays
“a collection of meteorological forecast fields” GRIB
“a georeferenced spatial surface” Raster
“geographic objects with properties” Geospatial features

Choosing a data model: Example

Forecast dataset:

  • 5 variables
  • 10 pressure levels
  • 24 time steps
  • latitude-longitude grid

Image representing forecast data with 5 variables, 10 pressure levels, 24 time steps and  2D latitude-longitude grid

Which model fits best?

NetCDF: Network Common Data Form

NetCDF: A data model for multidimensional scientific data

Diagram of a NetCDF file consisting of dimensions, variables, and attributes

A portable, self-describing format for array data, created at Unidata (UCAR) in the late 1980s.

  • Dimensions: named axes and their lengths
  • Variables: typed N-dimensional arrays
  • Attributes: metadata on a variable or the whole dataset
float air_temperature(time, latitude, longitude)
float surface_pressure(time, latitude, longitude)

air_temperature:units = "K"

Both variables share dimensions: the relationship is explicit, not inferred from where values sit in the file.

NetCDF guarantees a structure, not a common one

Dataset A

dimensions:
  time = 24, lat = 180, lon = 360
variables:
  float time(time)
  float lat(lat)
  float lon(lon)
  float temp(time, lat, lon)
  temp:_FillValue = -999.0

Dataset B

dimensions:
  lon = 360, lat = 180, t = 24
variables:
  float T(lon, lat, t)
  (no coordinate variables)
  (missing values = -999,
   not declared)

Both are valid NetCDF. A generic tool can read both, but it cannot tell which axis is which, or what marks missing data, without extra rules.

NetCDF is the shared data model. CF Conventions are the community contract for using it consistently: coordinate variables, axes, fill values, grid mappings.

Exercise: help Ash inspect a NetCDF file

Ash has received a radar dataset and wants to know how it is organised before writing any code.

Open the OPeNDAP page for the IDRA dataset:
https://edu.nl/xp63n

Help Ash identify:

  1. the global attributes
  2. the dimensions and their lengths
  3. the coordinate variables (variables with the same name as a dimension, holding its values)
  4. three data variables and their dimensions
  5. the data types of those variables
  6. one variable-level attribute that controls how missing data are represented
  7. any variables that hold descriptive metadata as data values rather than as global attributes

Ash, a researcher

⏱ 8 minutes, in pairs. Do as much as time allows.

Solution: Ash’s findings (1/2)

1. Global attributes

title, institution, history, references, Conventions, location, source, example

Conventions = "CF-1.4": the producer’s intention to follow CF, not proof of conformance.

2. Dimensions

time_raw_data       = 73728
sample_beat_signal  = 1024
time_processed_data = 144
range               = 512
scalar              = 1

3. Coordinate variables

time_raw_data(time_raw_data)
sample_beat_signal(sample_beat_signal)
time_processed_data(time_processed_data)
range(range)

scalar has no variable of the same name: it is just a length-one dimension used by several variables.

Solution: Ash’s findings (2/2)

4 and 5. Data variables, dimensions, types

i_hh(time_raw_data, sample_beat_signal)
    16-bit integer
equivalent_reflectivity_factor(
    time_processed_data, range)
    32-bit real
radial_velocity(time_processed_data, range)
azimuth_processed_data(time_processed_data)

6. Missing data

_FillValue: -999.0 on equivalent_reflectivity_factor, differential_reflectivity, radial_velocity, spectrum_width.

Its existence, location, and type are structural. Whether to exclude or interpolate missing values is an analytical decision.

7. Metadata stored as variables

iso_dataset, product, station_details: string variables, not global attributes.

Ash learned all of this from the file itself, with no bespoke instructions: that is structural interoperability at work.

Key takeaways

  • Structural interoperability is a shared, machine-actionable contract about how data are organised
  • A file extension is not the data model; it only hints at how data are stored
  • Choose the representation that matches your data model
  • NetCDF provides a shared model: dimensions, variables, attributes
  • CF adds the community rules for scientific interpretation