Skip to content

Commit

Permalink
fix: use application/x-netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Apr 25, 2023
1 parent 5ef6dfb commit db4ebdc
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 57 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.4
hooks:
- id: codespell
args: [--ignore-words=.codespellignore]
Expand All @@ -17,7 +17,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
rev: v1.2.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ number as needed.
- Summaries for the ocean heat content collection ([#50](https://github.com/stactools-packages/noaa-cdr/pull/50))
- `max_depth` to ocean heat content netcdf items ([#52](https://github.com/stactools-packages/noaa-cdr/pull/52))

### Changed

- Use `application/x-netcdf` for media types instead of `application/netcdf` ([#55](https://github.com/stactools-packages/noaa-cdr/pull/55))

### Removed

- Spurious bitfield for sea ice concentration ([#53](https://github.com/stactools-packages/noaa-cdr/pull/53))
Expand Down
88 changes: 44 additions & 44 deletions examples/noaa-cdr-ocean-heat-content/collection.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/noaa-cdr-sea-ice-concentration/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
"item_assets": {
"netcdf": {
"type": "application/netcdf",
"type": "application/x-netcdf",
"roles": [
"data"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"assets": {
"netcdf": {
"href": "../../../tests/data-files/seaice_conc_daily_nh_20211231_f17_v04r00.nc",
"type": "application/netcdf",
"type": "application/x-netcdf",
"title": "NOAA/NSIDC Climate Data Record of Passive Microwave Sea Ice Concentration Version 4 NetCDF",
"description": "This data set provides a passive microwave sea ice concentration climate data record (CDR) based on gridded brightness temperatures (TBs) from the Defense Meteorological Satellite Program (DMSP) series of passive microwave radiometers: the Nimbus-7 Scanning Multichannel Microwave Radiometer (SMMR), the Special Sensor Microwave Imager (SSM/I) and the Special Sensor Microwave Imager/Sounder (SSMIS). The sea ice concentration CDR is an estimate of sea ice concentration that is produced by combining concentration estimates from two algorithms developed at the NASA Goddard Space Flight Center (GSFC): the NASA Team algorithm and the Bootstrap algorithm. The individual algorithms are used to process and combine brightness temperature data at NSIDC. This product is designed to provide a consistent time series of sea ice concentrations (the fraction, or percentage, of ocean area covered by sea ice) from November 1978 to the present which spans the coverage of several passive microwave instruments. The data are gridded on the NSIDC polar stereographic grid with 25 x 25 km grid cells, and are available in NetCDF file format. Each file contains a variable with the CDR concentration values as well as variables that hold the NASA Team and Bootstrap processed concentrations for reference Variables containing standard deviation, quality flags, and projection information are also included. Data are available via FTP.",
"created": "2022-03-07T21:45:24Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
"item_assets": {
"netcdf": {
"type": "application/netcdf",
"type": "application/x-netcdf",
"roles": [
"data"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"assets": {
"netcdf": {
"href": "../../../tests/data-files/external/oisst-avhrr-v02r01.20220913.nc",
"type": "application/netcdf",
"type": "application/x-netcdf",
"title": "NOAA/NCEI 1/4 Degree Daily Optimum Interpolation Sea Surface Temperature (OISST) Analysis, Version 2.1 - Final NetCDF",
"description": "NOAAs 1/4-degree Daily Optimum Interpolation Sea Surface Temperature (OISST) (sometimes referred to as Reynolds SST, which however also refers to earlier products at different resolution), currently available as version v02r01, is created by interpolating and extrapolating SST observations from different sources, resulting in a smoothed complete field. The sources of data are satellite (AVHRR) and in situ platforms (i.e., ships and buoys), and the specific datasets employed may change over time. At the marginal ice zone, sea ice concentrations are used to generate proxy SSTs. A preliminary version of this file is produced in near-real time (1-day latency), and then replaced with a final version after 2 weeks. Note that this is the AVHRR-ONLY DOISST, available from Oct 1981, but there is a companion DOISST product that includes microwave satellite data, available from June 2002",
"created": "2022-09-28T09:14:00Z",
Expand Down
2 changes: 1 addition & 1 deletion src/stactools/noaa_cdr/ocean_heat_content/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def create_collection(
href=href,
title=ASSET_METADATA[key]["title"],
description=ASSET_METADATA[key]["description"],
media_type="application/netcdf",
media_type="application/x-netcdf",
roles=["data", "source"],
),
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"netcdf": {
"type": "application/netcdf",
"type": "application/x-netcdf",
"roles": [
"data"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"netcdf": {
"type": "application/netcdf",
"type": "application/x-netcdf",
"roles": [
"data"
]
Expand Down
2 changes: 1 addition & 1 deletion src/stactools/noaa_cdr/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def create_item(
href=href,
title=f"{ds.title} NetCDF",
description=ds.summary,
media_type="application/netcdf",
media_type="application/x-netcdf",
roles=["data"],
)
asset.common_metadata.created = dateutil.parser.parse(ds.date_created)
Expand Down
2 changes: 1 addition & 1 deletion tests/ocean_heat_content/test_stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_create_collection() -> None:
for asset in collection.assets.values():
assert asset.title is not None
assert asset.description is not None
assert asset.media_type == "application/netcdf"
assert asset.media_type == "application/x-netcdf"
assert asset.roles
assert set(asset.roles) == {"data", "source"}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_create_item() -> None:
assert len(item.assets) == 1
asset = item.assets["netcdf"]
assert asset.href == path
assert asset.media_type == "application/netcdf"
assert asset.media_type == "application/x-netcdf"
assert asset.roles
assert set(asset.roles) == {"data"}
assert asset.common_metadata.created == datetime.datetime(
Expand Down

0 comments on commit db4ebdc

Please sign in to comment.