Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
979e5f2
Use of CF names for fields. Adding a vertical definition object
drandyziegler Mar 25, 2025
fe04f1e
Changed vertical dimension values to array.
drandyziegler Mar 25, 2025
1960a0e
enriching collection example
drandyziegler Mar 25, 2025
2c0f630
added link to NetCDF Users Guide
drandyziegler Mar 25, 2025
5cbcdaf
description of CF Object
drandyziegler Mar 25, 2025
7aaa04a
add asset_variable_name and schema.json based on schema_template.json
drandyziegler Mar 30, 2025
940f6ac
Follow STAC Item readme for conditional required field
drandyziegler Mar 30, 2025
9b4db60
Schema now enforces the updated Readme better
drandyziegler Mar 31, 2025
f291e6f
Using datacube with CF extension
drandyziegler Jun 9, 2025
dc9e64f
some backup files, for deletion later.
drandyziegler Jun 9, 2025
f96d318
Update examples/collection.json
drandyziegler Jul 7, 2025
c3dceec
Reduced to defining fields, and making long_name and units optional
drandyziegler Oct 23, 2025
f02e48b
reducing to defining the essential fields, meant to embed in other ex…
drandyziegler Oct 23, 2025
2d812c2
Fix markdown issue with breaking long lines
drandyziegler Oct 23, 2025
25a9882
fix line break
drandyziegler Nov 3, 2025
25b58bc
update after STAC community meeting
drandyziegler Nov 3, 2025
0ac091e
further alignment with meeting outcome
drandyziegler Nov 3, 2025
86762e4
align examples and markdown fixes
drandyziegler Nov 3, 2025
e11748e
typo
drandyziegler Nov 3, 2025
aed66d3
markdown typo
drandyziegler Nov 3, 2025
5785fd5
markdown typo
drandyziegler Nov 9, 2025
7c5327b
cell_methods exemptions
drandyziegler Nov 9, 2025
95532b2
links pointing to latest CF version
drandyziegler Nov 9, 2025
3632de3
lost a bracket
drandyziegler Nov 9, 2025
86804b3
typos
drandyziegler Nov 9, 2025
01db534
Tidy up of interim files that were added to the git repo
drandyziegler Nov 11, 2025
858b8a9
suggested changes from review
drandyziegler Nov 11, 2025
95a5ed2
tweak to readme
drandyziegler Nov 11, 2025
0156dc7
Fix Markdown and item example
m-mohr Dec 1, 2025
6c6897e
Either cell_method is used or not. No need for enforcing its existenc…
drandyziegler Dec 4, 2025
7d0bc92
aligned example. scheme and README on use of cf:cell_methods with nul…
drandyziegler Dec 4, 2025
8456ba7
added more info how to use cell_methods
drandyziegler Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/remark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins:
- remark-lint-blockquote-indentation
- remark-lint-no-consecutive-blank-lines
- - remark-lint-maximum-line-length
- 150
- 170
# Code
- remark-lint-fenced-code-flag
- remark-lint-fenced-code-marker
Expand Down
99 changes: 73 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CF Extension Specification

- **Title:** CF
- **Identifier:** <https://stac-extensions.github.io/cf/v0.2.0/schema.json>
- **Identifier:** <https://stac-extensions.github.io/cf/v0.3.0/schema.json>
- **Field Name Prefix:** cf
- **Scope:** Item, Collection
- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal
Expand All @@ -13,50 +13,94 @@ It adds a field to provide the Standard Name Table based on the [CF metadata con
- Examples:
- [Item](examples/item.json) and [Collection](examples/collection.json):
Shows the basic usage of the extension in a STAC Item and a corresponding summarizing STAC Collection
- [Standalone Collection](examples/standalone_collection.json):
Shows the basic usage of the extension in a STAC Collection without items
- [JSON Schema](json-schema/schema.json)
- [Changelog](./CHANGELOG.md)

## Fields

The fields in the table below can be used in these parts of STAC documents:

- [ ] Catalogs
- [x] Collections
- [x] Item Properties (incl. Summaries in Collections)
- [x] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections)
- [x] Bands
- [x] Data Cube Extension (`cube:variables`, `cube:dimensions`)
- [ ] Links

| Field Name | Type | Description |
| ------------ | --------------------------- | ------------------------------------ |
| cf:parameter | \[[CF Object](#CF-object)\] | **REQUIRED**. CF Standard Name Table |
| Field Name | Type | Description |
| ---------------- | --------- | ----------- |
| cf:standard_name | string | Corresponds to the [CF Standard Name](https://cfconventions.org/Data/cf-standard-names/current/build/cf-standard-name-table.html). |
| cf:cell_methods | \[string|null] | A list of string or `null` attributes that describe the "method" applied to the data as defined in the CF conventions. |
| description | string | Corresponds to the [CF `long_name`](https://cfconventions.org/cf-conventions/cf-conventions.html#long-name). |
| unit | string | Corresponds to the [CF `units`](https://cfconventions.org/cf-conventions/cf-conventions.html#units). |

### Additional Field Information

#### cf:parameter
#### cf:standard_name

The CF standard name is a controlled vocabulary term used in Climate and Forecast (CF) metadata conventions
to unambiguously describe the physical quantity represented by a variable in climate and geophysical data files.
If variable has a standard_name definition in the CF convention, it must be a non-empty value from the
[CF Standard Name Table](https://cfconventions.org/Data/cf-standard-names/current/build/cf-standard-name-table.html).
Otherwise `cf:standard_name` is an empty value.

#### cf:cell_methods

The cell_methods attribute in the CF (Climate and Forecast) convention is designed to describe how the values in a data variable
were derived with respect to one or more axes (e.g., time, latitude, longitude). Each "method" represents the statistical or
computational operations applied to data along specific axes. For example, if used within the datacube extension then the
order of cell_methods aligns with the order of spatial and temporal extensions.

```json
"cube:variables": {
"some_variable": {
"cf:cell_methods": [null, "minimum"],
Comment thread
m-mohr marked this conversation as resolved.
"dimensions": [
"vertical_dimension1",
"time_interval2"
]
}
}
```

The `cf:parameter` array is used to describe the parameters in an Asset or Collection.
It requires at least one entry with a non-empty name.
This enables clients to read the file and understand which parameters are available.
In this case `null` indicates that no method is applied over the first dimension `vertical_dimension1` but
the `minimum` method is applied over the second dimension `time_interval2`.
These dimensions would be defined in the `cube:dimensions` fields.

If a data value is representative of variation over a combination of axes this approach is not sufficient \(e.g. the standard
deviation of topographic height within a longitude-latitude gridbox would have `cell_methods="latitude: longitude: standard_deviation"`\).
Such `cell_methods` cannot be described as per dimension methods in an array and would need a plain string representation.

```json
"cube:variables": {
"some_variable": {
"cf:cell_methods": "latitude: longitude: standard_deviation",
"dimensions": [
"latitude",
"longitude"
]
}
}
```

If assets with a `cf:parameter` array are provided, the field may optionally be used in the
Item Properties or Collection and it must summarize the available parameters in the assets.
This must be the 'union' of all the possible parameters represented in assets.
If no assets are provided in a Collection, the field can be used freely to describe the Collection for e.g. search.
An Item is only allowed to use `cf:parameter` in its Properties if it has at least one asset with a defined parameter array.
See [CF Cell Methods](https://cfconventions.org/cf-conventions/cf-conventions.html#cell-methods) for more details.

The `cf:parameter` list in Item Properties or Collections should be considered merely informative -
clients should rely on the `cf:parameter` of each asset, if available.
#### description

#### CF Object
The description field as defined by the [NUG](https://docs.unidata.ucar.edu/nug/current/index.html) is meant to contain a long descriptive
name which may, for example, be used for labeling plots.
See [CF "long_name"](https://cfconventions.org/cf-conventions/cf-conventions.html#long-name) for more details.

This object should contain a variable name from the [CF list](https://cfconventions.org/Data/cf-standard-names/current/build/cf-standard-name-table.html)
and where applicable a unit from the [UDUNITS-2 database](https://docs.unidata.ucar.edu/udunits/current/)
#### unit

| Field Name | Type | Description |
| ---------- | ------ | ----------- |
| name | string | **REQUIRED**. Should be a non-empty value from the CF standard names list |
| unit | string | Indicates the unit, preferably available in the database from the UDUNITS-2 package (unidata) |
The unit of measurement for the values, preferably compliant to [UCUM](https://ucum.org/[) (unit code)
or [UDUNITS-2](https://ncics.org/portfolio/other-resources/udunits2/) (unit symbol or alternatively singular unit name).
Unit is not required for dimensionless quantities. A variable with no unit attribute is assumed to be
dimensionless. The conforming unit for quantities that represent fractions, or parts of a whole, is "1".
Descriptive information about dimensionless quantities, such as sea-ice concentration, cloud fraction,
probability, etc., should be given in the "description" attribute rather than the unit field.
See [CF "units"](https://cfconventions.org/cf-conventions/cf-conventions.html#dimensionless-units) for more details.

Comment thread
m-mohr marked this conversation as resolved.
Comment thread
m-mohr marked this conversation as resolved.
## Contributing

Expand All @@ -68,23 +112,26 @@ for running tests are copied here for convenience.

### Running tests

The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/).

First you'll need to install everything with npm once. Just navigate to the root of this repository and on
First you'll need to install everything with npm once. Just navigate to the root of this repository and on
your command line run:

```bash
npm install
```

Then to check markdown formatting and test the examples against the JSON schema, you can run:

```bash
npm test
```

This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.

If the tests reveal formatting problems with the examples, you can fix them with:

```bash
npm run format-examples
```
123 changes: 84 additions & 39 deletions examples/collection.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"stac_version": "1.0.0",
"stac_extensions": [
"https://stac-extensions.github.io/cf/v0.2.0/schema.json"
"https://stac-extensions.github.io/cf/v0.3.0/schema.json"
],
"type": "Collection",
"id": "collection",
"title": "Collection with an Item",
"title": "A title",
"description": "A description",
"license": "Apache-2.0",
"extent": {
Expand All @@ -28,31 +28,15 @@
]
}
},
"assets": {
"example": {
"href": "https://example.com/examples/file.xyz"
}
},
"item_assets": {
"sea_surface_temperature": {
"type": "application/netcdf",
"cf:parameter": [
{
"name": "sea_surface_temperature",
"unit": "K"
},
{
"name": "depth",
"unit": "m"
}
]
},
"sea_ice_surface_temperature": {
"type": "application/netcdf",
"cf:parameter": [
{
"name": "sea_ice_surface_temperature",
"unit": "K"
},
{
"name": "depth",
"unit": "m"
}
"data": {
"roles": [
"data"
]
}
},
Expand All @@ -61,29 +45,90 @@
"minimum": "2015-06-23T00:00:00Z",
"maximum": "2019-07-10T13:44:56Z"
},
"cf:parameter": [
{
"name": "sea_surface_temperature",
"unit": "K"
"cube:dimensions": {
"time_interval1": {
"type": "temporal",
"description": "time interval that cell_methods is applied over",
"values": [
-24
],
"unit": "h"
},
{
"name": "sea_ice_surface_temperature",
"unit": "K"
"vertical_dimension1": {
"type": "spatial",
"axis": "z",
"cf:standard_name": "height",
"description": "Height above ground level",
"unit": "m",
"values": [
10
]
},
"time_interval2": {
"type": "temporal",
"description": "time interval that cell_methods is applied over",
"values": [
-60
],
"unit": "min"
},
{
"name": "depth",
"unit": "m"
"vertical_dimension2": {
"type": "spatial",
"axis": "z",
"cf:standard_name": "height",
"description": "Air pressure",
"unit": "hPa",
"values": [
500
]
}
]
},
"cube:variables": {
"sea_surface_temperature": {
"type": "data",
"cf:standard_name": "sea_surface_temperature",
"description": "Average temperature on sea surface for preceding 24 hours",
"unit": "K",
"cf:cell_methods": [
"mean"
],
"dimensions": [
"time_interval1"
]
},
"wind_speed_at_10m": {
"type": "data",
"cf:standard_name": "wind_speed",
"description": "minimum wind speed in 1 hour at 10 m agl",
"unit": "kt",
"cf:cell_methods": [
null,
"minimum"
],
"dimensions": [
"vertical_dimension1",
"time_interval2"
]
},
"temp_at_500hPa": {
"type": "data",
"cf:standard_name": "air_temperature",
"description": "air temperature at 500 hPa",
"unit": "degC",
"dimensions": [
"vertical_dimension2"
]
}
}
},
"links": [
{
"href": "https://example.com/examples/collection.json",
"rel": "self"
},
{
"href": "./item.json",
"href": "https://example.com/examples/item.json",
"rel": "item"
}
]
}
}
Loading