CDM implementation of CF discrete sampling features

April 2012

These notes refer to the current release of CDM 4.3. Section headers reference the CF 1.6 doc at:

http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#discrete-sampling-geometries

 

Short guide to writing files using CF-1.6 Discrete Sampling Features Conventions

Step 1: Requirements

Step 2: Which feature type?

What kind of data do you have:

  1. Point (unconnected) data: data is located at different, unconnected locations. Examples: earthquake data, lightning data.
  2. Time series (station) data: data is located at named locations, called stations. There can be many stations, and usually for each station you have multiple data with different time coordinates. Stations have a unique identifier. Examples: weather station data, fixed buoys.
  3. Profile data: A series of connected observations along a vertical line. Each profile has only one lat, lon coordinate (possibly nominal), so that the points along the profile differ only in z coordinate and possibly time coordinate. There can be multiple profiles in the same file, and each profile has a unique identifier If you have many profiles with the same lat, lon location, use the Time series Profile type. Examples: atmospheric profiles from satellites, moving profilers.
  4. Time series (station) Profile data: Profile data at fixed locations. This is a combination of Time series type and Profile type, so one has time series of Profiles at fixed locations. A file can contain many stations and many time series at each station. Examples: profilers, balloon soundings.
  5. Trajectory data: A series of connected observations along a 1D curve in time and space. There can be multiple trajectories in the same file, each with a unique identifier. Examples: aircraft data, drifting buoys.
  6. Trajectory of Profiles:  a collection of profile features which originate along a trajectory. So these are trajectories which have profile data (varying with z) at each (lat, lon) location. Examples: ship soundings.

 Step 3: Which representation should I use?

  1. Point (unconnected) data: use CF H.1
  2. Time series (station) data:
    1. You will put only one station in the file: you may use CF H.2.3
    2. All stations have the exact same time coordinates: you may use CF H.2.1
    3. Each station has almost the same number of time coordinates and the values may be different: you may use CF H.2.2
    4. Each station has different number of coordinates and you want to keep file size as small as possible:
      1. you have all the data already, and you want to optimize reading all the data for one station: you may use H.2.4
      2. you want to write the data as it arrives, in any order: you may use H.2.5
  3. Profile data:
    1. You will put only one profile in the file: you may use CF H.3.3
    2. All profiles have the exact same vertical coordinates: you may use CF H.3.1
    3. Each profile has almost the same number of vertical coordinates and the values may be different: you may use CF H.3.2
    4. Each profile has a different number of vertical coordinates and you want to keep file size as small as possible:
      1. you have all the data already, and you want to optimize reading all the data for one profile: you may use H.3.4
      2. you want to write the data as it arrives, in any order: you may use H.3.5
  4. Time series (station) Profile data:
    1. You will put only one station in the file: you may use CF H.5.2
    2. Each station has the same number of profiles, and the same number of vertical levels for each profile : you may use CF H.5.1
    3. Each station has a different number of profiles and/or the level coordinates for each station may vary : you may use CF H.5.3
  5. Trajectory data:
    1. You will put only one trajectory in the file: you may use CF H.4.2
    2. All trajectories have the same or almost the same number of points: you may use CF H.4.1
    3. Each trajectory has different number of points and you want to keep file size as small as possible:
      1. you have all the data already, and you want to optimize reading all the data for one trajectory: you may use H.4.3
      2. you want to write the data as it arrives, in any order: you may use H.4.4
  6. Trajectory of Profiles:  
    1. You will put only one trajectory in the file: you may use CF H.6.2
    2. All trajectories have the same or almost the same number of points: you may use CF H.6.1
    3. Each trajectory has different number of profiles and/or vertical coordinates: you may use H.6.3

Step 4: Test a sample file

  1. Write a test file with some sample data in it.

  2. Test in ToolsUI 4.3 (webstart link)

    1. Go to Feature Types / Point Features Tab
    2. On the right is a combobox with the feature type choices. Select the correct type (or leave ANY_POINT to let the CDM figure it out).
    3. Enter the file name or navigate with the FileChooser
    4. If it works, the various tables will be filled in - click on a table row to navigate the feature heirarchy. The context menu (right-click) on the large table lets you show the data.
    5. This widget is pretty clumsy (sorry - we will improve as soon as the MacArthur money arrives). For point data you have to click the "Get ALL Data" button above the right navigation pane.
    6. This essentially tests the CDM ability to read your file. The CDM is a bit more lenient than CF in some ways, and a bit more restrictive in others (see below for details).
    7. The CF compliance checkers may also help diagnose issues.

Miscellaneous questions and advice

  1. Should I use the unlimited dimension? This can have a huge impact on performance for large files, because it affects the data layout on disk. The answer is: it depends.
  2. Should I use coordinate variables or auxiliary coordinate variables?
  3. What's the reason to include ids for things like trajectories or profiles?
  4. How big should I make my files? How should I divide the data between files?
  5. Why should I bother to do all this extra work?

 

Differences from CF

9.1 Limits on coordinate types

Horizontal coordinates:

Vertical coordinates:

9.3 Limits on dimension ordering

9.4 Attribute featureType is required

9.5  Feature instance id variable is required

Notes on representations

In all cases, latitude, longitude, altitude and time coordinates must be recognized in the usual CF way. The altitude coordinate is optional in some of the forms.

also see: DSG Encoding Table

H.1 Point Data

In the CDM, point data is recognized by the featureType = "point" global attribute. The altitude coordinate is optional. All coordinates must have the same dimension, called the obs or sample dimension. All variables with the obs dimension as outer dimension are data variables.

H.2 Time Series Data

In the CDM, this form is recognized by the featureType = "timeSeries" global attribute. The altitude coordinate is optional.

Special station variables are recognized by standard names as given below. For backwards compatibility, the given aliases are allowed.

standard_name alias
"timeseries_id"
"station_id"
"platform_name"
"station_description"
"surface_altitude"
"station_altitude"
"platform_id"
"station_WMO_id"

H.2.1 / H.2.2 Multidimensional Time Series Representation

The lat, lon and altitude coordinates must have the same dimension, called the station or instance dimension. All variables with the station dimension as outer dimension are station variables. The time dimension must be of the form time(time) or time(station, time), where the time dimension is the obs or sample dimension. All data variables must have the form data(station, time).

For compatibility with earlier versions

H.2.3. Single time series, including deviations from a nominal fixed spatial location

The CDM uses the axis attribute to choose the correct coordinate. However, it provides no special handling for the precise coordinates.

H.2.4. Contiguous ragged array representation of time series

standard alias
sample_dimension
CF:ragged_row_count
instance_dimension
CF:ragged_parent_index

H.3.5. Indexed ragged array representation of profiles

Example only shows double time(profile) but double time(obs) is also possible, when the observation varies by time.

H.5.1. Multidimensional array representations of time series profiles

Specification says "The pressure(i,p,o), temperature(i,p,o), and humidity(i,p,o) data for element o of profile p at station i are associated with the coordinate values time(i,p), z(i,p,o), lat(i), and lon(i). Any of the three dimensions could be the netCDF unlimited dimension, if it might be useful to be able enlarge it."

Since CDM currently only allows dimensions to be in the order (station, profile, z), then only the station dimension could be unlimited in the multidimensional representation.

 


This document is maintained by Unidata. Send comments to THREDDS support. Last updated: April 2011