diff --git a/datasets/noaa-cdr/collections/ocean-heat-content-netcdf/description.md b/datasets/noaa-cdr/collections/ocean-heat-content-netcdf/description.md new file mode 100644 index 00000000..00f2c234 --- /dev/null +++ b/datasets/noaa-cdr/collections/ocean-heat-content-netcdf/description.md @@ -0,0 +1,3 @@ +The Ocean Heat Content Climate Data Record (CDR) is a set of ocean heat content anomaly (OHCA) time-series for 1955-present on 3-monthly, yearly, and pentadal (five-yearly) scales. This CDR quantifies ocean heat content change over time, which is an essential metric for understanding climate change and the Earth's energy budget. It provides time-series for multiple depth ranges in the global ocean and each of the major basins (Atlantic, Pacific, and Indian) divided by hemisphere (Northern, Southern). + +This is a NetCDF-only collection, for Cloud-Optimized GeoTIFFS use collection 'noaa-cdr-ocean-heat-content'. \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/ocean-heat-content-netcdf/template.json b/datasets/noaa-cdr/collections/ocean-heat-content-netcdf/template.json new file mode 100644 index 00000000..692cde01 --- /dev/null +++ b/datasets/noaa-cdr/collections/ocean-heat-content-netcdf/template.json @@ -0,0 +1,91 @@ +{ + "type": "Collection", + "id": "noaa-cdr-ocean-heat-content-netcdf", + "stac_version": "1.0.0", + "description": "{{ collection.description }}", + "links": [ + { + "rel": "license", + "href": "https://www.ncei.noaa.gov/pub/data/sds/cdr/CDRs/Ocean_Heat_Content/UseAgreement_01B-41.pdf", + "type": "application/pdf", + "title": "NOAA CDR Ocean Heat Content Use Agreement" + }, + { + "rel": "about", + "href": "https://www.ncei.noaa.gov/products/climate-data-records/global-ocean-heat-content", + "type": "text/html", + "title": "Global Ocean Heat Content CDR" + }, + { + "rel": "cite-as", + "href": "https://doi.org/10.7289/v53f4mvp" + } + ], + "stac_extensions": [ + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json" + ], + "sci:doi": "10.7289/v53f4mvp", + "sci:citation": "Levitus, Sydney; Antonov, John I.; Boyer, Tim P.; Baranova, Olga K.; García, Hernán E.; Locarnini, Ricardo A.; Mishonov, Alexey V.; Reagan, James R.; [Seidov, Dan; Yarosh, Evgeney; Zweng, Melissa M. (2017). NCEI ocean heat content, temperature anomalies, salinity anomalies, thermosteric sea level anomalies, halosteric sea level anomalies, and total steric sea level anomalies from 1955 to present calculated from in situ oceanographic subsurface profile data (NCEI Accession 0164586).NOAA National Centers for Environmental Information. Dataset. https://doi.org/10.7289/v53f4mvp.", + "item_assets": { + "netcdf": { + "type": "application/netcdf", + "roles": [ + "data" + ] + } + }, + "title": "Global Ocean Heat Content CDR NetCDFs", + "keywords": [ + "Global", + "Climate", + "NOAA", + "Temperature", + "Ocean" + ], + "providers": [ + { + "name": "National Centers for Environmental Information", + "description": "NCEI is the Nation's leading authority for environmental data, and manage one of the largest archives of atmospheric, coastal, geophysical, and oceanic research in the world. NCEI contributes to the NESDIS mission by developing new products and services that span the science disciplines and enable better data discovery.", + "roles": [ + "producer", + "processor", + "licensor" + ], + "url": "https://www.ncei.noaa.gov/" + }, + { + "name": "Microsoft", + "roles": [ + "processor", + "host" + ], + "url": "https://planetarycomputer.microsoft.com" + } + ], + "msft:short_description": "The Ocean Heat Content Climate Data Record (CDR) is a set of ocean heat content anomaly (OHCA) time-series for 1955-present on 3-monthly, yearly, and pentadal (five-yearly) scales.", + "msft:storage_account": "noaacdr", + "msft:container": "ocean-heat-content", + "msft:group_id": "noaa-cdr", + "extent": { + "spatial": { + "bbox": [ + [ + -180.0, + -90.0, + 180.0, + 90.0 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1972-03-01T00:00:00Z", + "2022-03-31T23:59:59Z" + ] + ] + } + }, + "license": "proprietary" +} \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/ocean-heat-content/description.md b/datasets/noaa-cdr/collections/ocean-heat-content/description.md new file mode 100644 index 00000000..33c93645 --- /dev/null +++ b/datasets/noaa-cdr/collections/ocean-heat-content/description.md @@ -0,0 +1 @@ +The Ocean Heat Content Climate Data Record (CDR) is a set of ocean heat content anomaly (OHCA) time-series for 1955-present on 3-monthly, yearly, and pentadal (five-yearly) scales. This CDR quantifies ocean heat content change over time, which is an essential metric for understanding climate change and the Earth's energy budget. It provides time-series for multiple depth ranges in the global ocean and each of the major basins (Atlantic, Pacific, and Indian) divided by hemisphere (Northern, Southern). \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/ocean-heat-content/template.json b/datasets/noaa-cdr/collections/ocean-heat-content/template.json new file mode 100644 index 00000000..cf0a9ed3 --- /dev/null +++ b/datasets/noaa-cdr/collections/ocean-heat-content/template.json @@ -0,0 +1,168 @@ +{ + "type": "Collection", + "id": "noaa-cdr-ocean-heat-content", + "stac_version": "1.0.0", + "description": "{{ collection.description }}", + "links": [ + { + "rel": "license", + "href": "https://www.ncei.noaa.gov/pub/data/sds/cdr/CDRs/Ocean_Heat_Content/UseAgreement_01B-41.pdf", + "type": "application/pdf", + "title": "NOAA CDR Ocean Heat Content Use Agreement" + }, + { + "rel": "about", + "href": "https://www.ncei.noaa.gov/products/climate-data-records/global-ocean-heat-content", + "type": "text/html", + "title": "Global Ocean Heat Content CDR" + }, + { + "rel": "cite-as", + "href": "https://doi.org/10.7289/v53f4mvp" + } + ], + "stac_extensions": [ + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json" + ], + "sci:doi": "10.7289/v53f4mvp", + "sci:citation": "Levitus, Sydney; Antonov, John I.; Boyer, Tim P.; Baranova, Olga K.; García, Hernán E.; Locarnini, Ricardo A.; Mishonov, Alexey V.; Reagan, James R.; [Seidov, Dan; Yarosh, Evgeney; Zweng, Melissa M. (2017). NCEI ocean heat content, temperature anomalies, salinity anomalies, thermosteric sea level anomalies, halosteric sea level anomalies, and total steric sea level anomalies from 1955 to present calculated from in situ oceanographic subsurface profile data (NCEI Accession 0164586).NOAA National Centers for Environmental Information. Dataset. https://doi.org/10.7289/v53f4mvp.", + "item_assets": { + "heat_content": { + "title": "Ocean Heat Content anomalies from WOA09", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": [ + "data" + ], + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32", + "unit": "10^18 joules" + } + ] + }, + "mean_halosteric_sea_level": { + "title": "Mean halosteric sea level anomalies from WOA09", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": [ + "data" + ], + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32", + "unit": "millimeters" + } + ] + }, + "mean_salinity": { + "title": "Mean salinity anomalies from WOA09", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": [ + "data" + ], + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32" + } + ] + }, + "mean_temperature": { + "title": "Mean temperature anomalies from WOA09", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": [ + "data" + ], + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32", + "unit": "degrees Celsius" + } + ] + }, + "mean_thermosteric_sea_level": { + "title": "Mean thermosteric sea level anomalies from WOA09", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": [ + "data" + ], + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32", + "unit": "millimeters" + } + ] + }, + "mean_total_steric_sea_level": { + "title": "Mean total steric sea level anomalies from WOA09", + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": [ + "data" + ], + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32", + "unit": "millimeters" + } + ] + } + }, + "title": "Global Ocean Heat Content CDR", + "keywords": [ + "Global", + "Climate", + "NOAA", + "Temperature", + "Ocean" + ], + "providers": [ + { + "name": "National Centers for Environmental Information", + "description": "NCEI is the Nation's leading authority for environmental data, and manage one of the largest archives of atmospheric, coastal, geophysical, and oceanic research in the world. NCEI contributes to the NESDIS mission by developing new products and services that span the science disciplines and enable better data discovery.", + "roles": [ + "producer", + "processor", + "licensor" + ], + "url": "https://www.ncei.noaa.gov/" + }, + { + "name": "Microsoft", + "roles": [ + "processor", + "host" + ], + "url": "https://planetarycomputer.microsoft.com" + } + ], + "msft:short_description": "The Ocean Heat Content Climate Data Record (CDR) is a set of ocean heat content anomaly (OHCA) time-series for 1955-present on 3-monthly, yearly, and pentadal (five-yearly) scales.", + "msft:storage_account": "noaacdr", + "msft:container": "ocean-heat-content", + "msft:group_id": "noaa-cdr", + "extent": { + "spatial": { + "bbox": [ + [ + -180.0, + -90.0, + 180.0, + 90.0 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1972-03-01T00:00:00Z", + "2022-03-31T23:59:59Z" + ] + ] + } + }, + "license": "proprietary" +} \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-ice-concentration/description.md b/datasets/noaa-cdr/collections/sea-ice-concentration/description.md new file mode 100644 index 00000000..71945564 --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-ice-concentration/description.md @@ -0,0 +1 @@ +The Sea Ice Concentration Climate Data Record (CDR) provides a consistent daily and monthly time series of sea ice concentrations for both the north and south Polar Regions on a 25 km x 25 km grid. These data can be used to estimate how much of the ocean surface is covered by ice, and monitor changes in sea ice concentration. The CDR combines concentration estimates using two algorithms developed at the NASA Goddard Space Flight Center (GSFC). Gridded brightness temperatures acquired from a number of Defense Meteorological Satellite Program (DMSP) passive microwave radiometers provide the necessary input to produce the dataset. \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-ice-concentration/template.json b/datasets/noaa-cdr/collections/sea-ice-concentration/template.json new file mode 100644 index 00000000..08ede9d5 --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-ice-concentration/template.json @@ -0,0 +1,538 @@ +{ + "type": "Collection", + "id": "noaa-cdr-sea-ice-concentration", + "stac_version": "1.0.0", + "description": "{{ collection.description }}", + "links": [ + { + "rel": "license", + "href": "https://www.ncei.noaa.gov/pub/data/sds/cdr/CDRs/Sea_Ice_Concentration/UseAgreement_01B-11.pdf", + "type": "application/pdf", + "title": "NOAA CDR Sea Ice Concentration Use Agreement" + }, + { + "rel": "about", + "href": "https://www.ncei.noaa.gov/products/climate-data-records/sea-ice-concentration", + "type": "text/html", + "title": "Sea Ice Concentration CDR" + }, + { + "rel": "cite-as", + "href": "https://doi.org/10.7265/efmz-2t65" + } + ], + "stac_extensions": [ + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json" + ], + "item_assets": { + "netcdf": { + "type": "application/netcdf", + "roles": [ + "data" + ] + }, + "cdr_seaice_conc": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": 255, + "data_type": "uint8", + "scale": 0.009999999776482582, + "spatial_resolution": 25000.0 + } + ], + "classification:classes": [ + { + "value": 251, + "name": "pole_hole" + }, + { + "value": 252, + "name": "lakes" + }, + { + "value": 253, + "name": "coastal" + }, + { + "value": 254, + "name": "land_mask" + }, + { + "value": 255, + "name": "missing_data" + } + ], + "roles": [ + "data" + ] + }, + "nsidc_bt_seaice_conc": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": 255, + "data_type": "uint8", + "scale": 0.009999999776482582, + "spatial_resolution": 25000.0 + } + ], + "classification:classes": [ + { + "value": 251, + "name": "pole_hole" + }, + { + "value": 252, + "name": "unused" + }, + { + "value": 253, + "name": "coastal" + }, + { + "value": 254, + "name": "land_mask" + }, + { + "value": 255, + "name": "missing_data" + } + ], + "roles": [ + "data" + ] + }, + "nsidc_nt_seaice_conc": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": 255, + "data_type": "uint8", + "scale": 0.009999999776482582, + "spatial_resolution": 25000.0 + } + ], + "roles": [ + "data" + ] + }, + "qa_of_cdr_seaice_conc": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint8", + "spatial_resolution": 25000.0 + } + ], + "classification:bitfields": [ + { + "name": "BT_weather_filter_applied", + "offset": 0, + "length": 1, + "classes": [ + { + "name": "BT_weather_filter_not_applied", + "value": 0 + }, + { + "name": "BT_weather_filter_applied", + "value": 1 + } + ] + }, + { + "name": "NT_weather_filter_applied", + "offset": 1, + "length": 1, + "classes": [ + { + "name": "NT_weather_filter_not_applied", + "value": 0 + }, + { + "name": "NT_weather_filter_applied", + "value": 1 + } + ] + }, + { + "name": "BT_land_spillover_filter_applied", + "offset": 2, + "length": 1, + "classes": [ + { + "name": "BT_land_spillover_filter_not_applied", + "value": 0 + }, + { + "name": "BT_land_spillover_filter_applied", + "value": 1 + } + ] + }, + { + "name": "NT_land_spillover_filter_applied", + "offset": 3, + "length": 1, + "classes": [ + { + "name": "NT_land_spillover_filter_not_applied", + "value": 0 + }, + { + "name": "NT_land_spillover_filter_applied", + "value": 1 + } + ] + }, + { + "name": "valid_ice_mask_applied", + "offset": 4, + "length": 1, + "classes": [ + { + "name": "valid_ice_mask_not_applied", + "value": 0 + }, + { + "name": "valid_ice_mask_applied", + "value": 1 + } + ] + }, + { + "name": "spatial_interpolation_applied", + "offset": 5, + "length": 1, + "classes": [ + { + "name": "spatial_interpolation_not_applied", + "value": 0 + }, + { + "name": "spatial_interpolation_applied", + "value": 1 + } + ] + }, + { + "name": "temporal_interpolation_applied", + "offset": 6, + "length": 1, + "classes": [ + { + "name": "temporal_interpolation_not_applied", + "value": 0 + }, + { + "name": "temporal_interpolation_applied", + "value": 1 + } + ] + }, + { + "name": "", + "offset": 7, + "length": 1, + "classes": [ + { + "name": "not_", + "value": 0 + }, + { + "name": "", + "value": 1 + } + ] + } + ], + "roles": [ + "data" + ] + }, + "spatial_interpolation_flag": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint8", + "spatial_resolution": 25000.0 + } + ], + "classification:bitfields": [ + { + "name": "19v_tb_value_interpolated", + "offset": 0, + "length": 1, + "classes": [ + { + "name": "19v_tb_value_not_interpolated", + "value": 0 + }, + { + "name": "19v_tb_value_interpolated", + "value": 1 + } + ] + }, + { + "name": "19h_tb_value_interpolated", + "offset": 1, + "length": 1, + "classes": [ + { + "name": "19h_tb_value_not_interpolated", + "value": 0 + }, + { + "name": "19h_tb_value_interpolated", + "value": 1 + } + ] + }, + { + "name": "22v_tb_value_interpolated", + "offset": 2, + "length": 1, + "classes": [ + { + "name": "22v_tb_value_not_interpolated", + "value": 0 + }, + { + "name": "22v_tb_value_interpolated", + "value": 1 + } + ] + }, + { + "name": "37v_tb_value_interpolated", + "offset": 3, + "length": 1, + "classes": [ + { + "name": "37v_tb_value_not_interpolated", + "value": 0 + }, + { + "name": "37v_tb_value_interpolated", + "value": 1 + } + ] + }, + { + "name": "37h_tb_value_interpolated", + "offset": 4, + "length": 1, + "classes": [ + { + "name": "37h_tb_value_not_interpolated", + "value": 0 + }, + { + "name": "37h_tb_value_interpolated", + "value": 1 + } + ] + }, + { + "name": "pole_hole_value_interpolated", + "offset": 5, + "length": 1, + "classes": [ + { + "name": "pole_hole_value_not_interpolated", + "value": 0 + }, + { + "name": "pole_hole_value_interpolated", + "value": 1 + } + ] + } + ], + "roles": [ + "data" + ] + }, + "stdev_of_cdr_seaice_conc": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32", + "spatial_resolution": 25000.0 + } + ], + "classification:classes": [ + { + "value": 251, + "name": "pole_hole" + }, + { + "value": 252, + "name": "lakes" + }, + { + "value": 253, + "name": "coastal" + }, + { + "value": 254, + "name": "land_mask" + }, + { + "value": 255, + "name": "missing_data" + } + ], + "roles": [ + "data" + ] + }, + "temporal_interpolation_flag": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": 0, + "data_type": "uint8", + "spatial_resolution": 25000.0 + } + ], + "classification:classes": [ + { + "value": 1, + "name": "1_day_following" + }, + { + "value": 2, + "name": "2_days_following" + }, + { + "value": 3, + "name": "3_days_following" + }, + { + "value": 4, + "name": "4_days_following" + }, + { + "value": 5, + "name": "5_days_following" + }, + { + "value": 10, + "name": "1_day_prior" + }, + { + "value": 11, + "name": "mean_of_prior_and_following_1_day" + }, + { + "value": 20, + "name": "2_days_prior" + }, + { + "value": 22, + "name": "mean_of_prior_and_following_2_days" + }, + { + "value": 30, + "name": "3_days_prior" + }, + { + "value": 33, + "name": "mean_of_prior_and_following_3_days" + }, + { + "value": 40, + "name": "4_days_prior" + }, + { + "value": 44, + "name": "mean_of_prior_and_following_4_days" + }, + { + "value": 50, + "name": "5_days_prior" + }, + { + "value": 55, + "name": "mean_of_prior_and_following_5_days" + } + ], + "roles": [ + "data" + ] + } + }, + "sci:doi": "10.7265/efmz-2t65", + "sci:citation": "Meier, W. N., F. Fetterer, A. K. Windnagel, and S. Stewart. 2021. NOAA/NSIDC Climate Data Record of Passive Microwave Sea Ice Concentration, Version 4. [Indicate subset used]. Boulder, Colorado USA. NSIDC: National Snow and Ice Data Center https://doi.org/10.7265/efmz-2t65. ", + "title": "Sea Ice Concentration CDR", + "keywords": [ + "Climate", + "NOAA", + "Sea ice", + "Polar" + ], + "providers": [ + { + "name": "National Snow and Ice Data Center", + "description": "The National Snow and Ice Data Center (NSIDC) at the University of Colorado Boulder (CU Boulder), part of the CU Boulder Cooperative Institute for Research in Environmental Sciences (CIRES), conducts innovative research and provides open data to understand how the frozen parts of Earth affect the rest of the planet and impact society.", + "roles": [ + "producer", + "processor", + "licensor" + ], + "url": "https://nsidc.org/data/g02202/versions/4" + }, + { + "name": "Microsoft", + "roles": [ + "processor", + "host" + ], + "url": "https://planetarycomputer.microsoft.com" + } + ], + "msft:short_description": "The Sea Ice Concentration Climate Data Record (CDR) provides a consistent daily and monthly time series of sea ice concentrations for both the north and south Polar Regions on a 25 km x 25 km grid.", + "msft:storage_account": "noaacdr", + "msft:container": "sea-ice-concentration", + "msft:group_id": "noaa-cdr", + "extent": { + "spatial": { + "bbox": [ + [ + -180.0, + -90, + 180, + 90 + ], + [ + -180, + 31.1, + 180.0, + 90 + ], + [ + -180, + -90, + 180.0, + -39.36 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1978-10-25T00:00:00Z", + null + ] + ] + } + }, + "license": "proprietary" +} \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-surface-temperature-optimum-interpolation/description.md b/datasets/noaa-cdr/collections/sea-surface-temperature-optimum-interpolation/description.md new file mode 100644 index 00000000..4351024b --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-surface-temperature-optimum-interpolation/description.md @@ -0,0 +1 @@ +The NOAA 1/4° daily Optimum Interpolation Sea Surface Temperature (or daily OISST) Climate Data Record (CDR) provides complete ocean temperature fields constructed by combining bias-adjusted observations from different platforms (satellites, ships, buoys) on a regular global grid, with gaps filled in by interpolation. The main input source is satellite data from the Advanced Very High Resolution Radiometer (AVHRR), which provides high temporal-spatial coverage from late 1981-present. This input must be adjusted to the buoys due to erroneous cold SST data following the Mt Pinatubo and El Chichon eruptions. Applications include climate modeling, resource management, ecological studies on annual to daily scales. \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-surface-temperature-optimum-interpolation/template.json b/datasets/noaa-cdr/collections/sea-surface-temperature-optimum-interpolation/template.json new file mode 100644 index 00000000..8d374466 --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-surface-temperature-optimum-interpolation/template.json @@ -0,0 +1,148 @@ +{ + "type": "Collection", + "id": "noaa-cdr-sea-surface-temperature-optimum-interpolation", + "stac_version": "1.0.0", + "description": "{{ collection.description }}", + "links": [ + { + "rel": "license", + "href": "https://www.ncei.noaa.gov/pub/data/sds/cdr/CDRs/Sea_Surface_Temperature_Optimum_Interpolation/UseAgreement_01B-09.pdf", + "type": "application/pdf", + "title": "NOAA CDR Sea Surface Temperature - Optimum Interpolation Use Agreement" + }, + { + "rel": "about", + "href": "https://www.ncei.noaa.gov/products/climate-data-records/sea-surface-temperature-optimum-interpolation", + "type": "text/html", + "title": "Sea Surface Temperature - Optimum Interpolation CDR" + }, + { + "rel": "cite-as", + "href": "https://doi.org/10.25921/RE9P-PT57" + } + ], + "stac_extensions": [ + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json" + ], + "item_assets": { + "netcdf": { + "type": "application/netcdf", + "updated": "2022-09-28T09:14:00Z", + "roles": [ + "data" + ] + }, + "sst": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": -999, + "data_type": "int16", + "unit": "Celsius", + "scale": 0.009999999776482582 + } + ], + "roles": [ + "data" + ] + }, + "anom": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": -999, + "data_type": "int16", + "unit": "Celsius", + "scale": 0.009999999776482582 + } + ], + "roles": [ + "data" + ] + }, + "err": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": -999, + "data_type": "int16", + "unit": "Celsius", + "scale": 0.009999999776482582 + } + ], + "roles": [ + "data" + ] + }, + "ice": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": -999, + "data_type": "int16", + "unit": "%", + "scale": 0.009999999776482582 + } + ], + "roles": [ + "data" + ] + } + }, + "sci:doi": "10.25921/RE9P-PT57", + "sci:citation": "Huang, Boyin; Liu, Chunying; Banzon, Viva F.; Freeman, Eric; Graham, Garrett; Hankins, Bill; Smith, Thomas M.; Zhang, Huai-Min. (2020): NOAA 0.25-degree Daily Optimum Interpolation Sea Surface Temperature (OISST), Version 2.1. NOAA National Centers for Environmental Information. https://doi.org/10.25921/RE9P-PT57.", + "title": "Sea Surface Temperature - Optimum Interpolation CDR", + "keywords": [ + "Global", + "Climate", + "NOAA", + "Temperature", + "Ocean" + ], + "providers": [ + { + "name": "National Centers for Environmental Information", + "description": "NCEI is the Nation's leading authority for environmental data, and manage one of the largest archives of atmospheric, coastal, geophysical, and oceanic research in the world. NCEI contributes to the NESDIS mission by developing new products and services that span the science disciplines and enable better data discovery.", + "roles": [ + "producer", + "processor", + "licensor" + ], + "url": "https://www.ncei.noaa.gov/" + }, + { + "name": "Microsoft", + "roles": [ + "processor", + "host" + ], + "url": "https://planetarycomputer.microsoft.com" + } + ], + "msft:short_description": "The NOAA 1/4° daily Optimum Interpolation Sea Surface Temperature (or daily OISST) Climate Data Record (CDR) provides complete ocean temperature fields constructed by combining bias-adjusted observations from different platforms (satellites, ships, buoys) on a regular global grid, with gaps filled in by interpolation.", + "msft:storage_account": "noaacdr", + "msft:container": "sea-surface-temperature-optimum-interpolation", + "msft:group_id": "noaa-cdr", + "extent": { + "spatial": { + "bbox": [ + [ + -180.0, + -90.0, + 180.0, + 90.0 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1981-09-01T00:00:00Z", + null + ] + ] + } + }, + "license": "proprietary" +} \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-surface-temperature-whoi-netcdf/description.md b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi-netcdf/description.md new file mode 100644 index 00000000..58133f71 --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi-netcdf/description.md @@ -0,0 +1,3 @@ +The Sea Surface Temperature-Woods Hole Oceanographic Institution (WHOI) Climate Data Record (CDR) is one of three CDRs which combine to form the NOAA Ocean Surface Bundle (OSB) CDR. The resultant sea surface temperature (SST) data are produced through modeling the diurnal variability in combination with AVHRR SST observations. The final record is output to a 3-hourly 0.25° resolution grid over the global ice-free oceans from January 1988—present. + +This is a NetCDF-only collection, for Cloud-Optimized GeoTIFFS use collection 'noaa-cdr-sea-surface-temperature-whoi'. \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-surface-temperature-whoi-netcdf/template.json b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi-netcdf/template.json new file mode 100644 index 00000000..fc39cb5e --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi-netcdf/template.json @@ -0,0 +1,91 @@ +{ + "type": "Collection", + "id": "noaa-cdr-sea-surface-temperature-whoi-netcdf", + "stac_version": "1.0.0", + "description": "{{ collection.description }}", + "links": [ + { + "rel": "license", + "href": "https://www.ncei.noaa.gov/pub/data/sds/cdr/CDRs/Sea%20Surface%20Temperature%20-%20WHOI/UseAgreement_01B-27a.pdf", + "type": "application/pdf", + "title": "NOAA CDR Sea Surface Temperature - WHOI Use Agreement" + }, + { + "rel": "about", + "href": "https://www.ncei.noaa.gov/products/climate-data-records/sea-surface-temperature-whoi", + "type": "text/html", + "title": "Sea Surface Temperature - WHOI CDR" + }, + { + "rel": "cite-as", + "href": "https://doi.org/10.7289/V5FB510W" + } + ], + "stac_extensions": [ + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json" + ], + "item_assets": { + "netcdf": { + "type": "application/netcdf", + "roles": [ + "data" + ] + } + }, + "sci:doi": "10.7289/V5FB510W", + "sci:citation": "Clayson, Carol Anne; Brown, Jeremiah; and NOAA CDR Program (2016). NOAA Climate Data Record (CDR) of Sea Surface Temperature - WHOI, Version 2. NOAA National Climatic Data Center. doi:10.7289/V5FB510W", + "title": "Sea Surface Temperature - WHOI CDR NetCDFs", + "keywords": [ + "Global", + "Climate", + "NOAA", + "Ocean", + "Temperature" + ], + "providers": [ + { + "name": "National Centers for Environmental Information", + "description": "NCEI is the Nation's leading authority for environmental data, and manage one of the largest archives of atmospheric, coastal, geophysical, and oceanic research in the world. NCEI contributes to the NESDIS mission by developing new products and services that span the science disciplines and enable better data discovery.", + "roles": [ + "producer", + "processor", + "licensor" + ], + "url": "https://www.ncei.noaa.gov/" + }, + { + "name": "Microsoft", + "roles": [ + "processor", + "host" + ], + "url": "https://planetarycomputer.microsoft.com" + } + ], + "msft:short_description": "The Sea Surface Temperature-Woods Hole Oceanographic Institution (WHOI) Climate Data Record (CDR) is one of three CDRs which combine to form the NOAA Ocean Surface Bundle (OSB) CDR. The resultant sea surface temperature (SST) data are produced through modeling the diurnal variability in combination with AVHRR SST observations.", + "msft:storage_account": "noaacdr", + "msft:container": "sea-surface-temperature-whoi", + "msft:group_id": "noaa-cdr", + "extent": { + "spatial": { + "bbox": [ + [ + -180.0, + -90, + 180, + 90 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1988-01-01T00:00:00Z", + null + ] + ] + } + }, + "license": "proprietary" +} \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-surface-temperature-whoi/description.md b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi/description.md new file mode 100644 index 00000000..7bd8ab7d --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi/description.md @@ -0,0 +1 @@ +The Sea Surface Temperature-Woods Hole Oceanographic Institution (WHOI) Climate Data Record (CDR) is one of three CDRs which combine to form the NOAA Ocean Surface Bundle (OSB) CDR. The resultant sea surface temperature (SST) data are produced through modeling the diurnal variability in combination with AVHRR SST observations. The final record is output to a 3-hourly 0.25° resolution grid over the global ice-free oceans from January 1988—present. \ No newline at end of file diff --git a/datasets/noaa-cdr/collections/sea-surface-temperature-whoi/template.json b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi/template.json new file mode 100644 index 00000000..81f909a4 --- /dev/null +++ b/datasets/noaa-cdr/collections/sea-surface-temperature-whoi/template.json @@ -0,0 +1,110 @@ +{ + "type": "Collection", + "id": "noaa-cdr-sea-surface-temperature-whoi", + "stac_version": "1.0.0", + "description": "{{ collection.description }}", + "links": [ + { + "rel": "license", + "href": "https://www.ncei.noaa.gov/pub/data/sds/cdr/CDRs/Sea%20Surface%20Temperature%20-%20WHOI/UseAgreement_01B-27a.pdf", + "type": "application/pdf", + "title": "NOAA CDR Sea Surface Temperature - WHOI Use Agreement" + }, + { + "rel": "about", + "href": "https://www.ncei.noaa.gov/products/climate-data-records/sea-surface-temperature-whoi", + "type": "text/html", + "title": "Sea Surface Temperature - WHOI CDR" + }, + { + "rel": "cite-as", + "href": "https://doi.org/10.7289/V5FB510W" + } + ], + "stac_extensions": [ + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json", + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json" + ], + "item_assets": { + "sea_surface_temperature": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32", + "unit": "degree Celsius" + } + ], + "roles": [ + "data" + ] + }, + "fill_missing_qc": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "raster:bands": [ + { + "nodata": "nan", + "data_type": "float32" + } + ], + "roles": [ + "data" + ] + } + }, + "sci:doi": "10.7289/V5FB510W", + "sci:citation": "Clayson, Carol Anne; Brown, Jeremiah; and NOAA CDR Program (2016). NOAA Climate Data Record (CDR) of Sea Surface Temperature - WHOI, Version 2. NOAA National Climatic Data Center. doi:10.7289/V5FB510W", + "title": "Sea Surface Temperature - WHOI CDR", + "keywords": [ + "Global", + "Climate", + "NOAA", + "Ocean", + "Temperature" + ], + "providers": [ + { + "name": "National Centers for Environmental Information", + "description": "NCEI is the Nation's leading authority for environmental data, and manage one of the largest archives of atmospheric, coastal, geophysical, and oceanic research in the world. NCEI contributes to the NESDIS mission by developing new products and services that span the science disciplines and enable better data discovery.", + "roles": [ + "producer", + "processor", + "licensor" + ], + "url": "https://www.ncei.noaa.gov/" + }, + { + "name": "Microsoft", + "roles": [ + "processor", + "host" + ], + "url": "https://planetarycomputer.microsoft.com" + } + ], + "msft:short_description": "The Sea Surface Temperature-Woods Hole Oceanographic Institution (WHOI) Climate Data Record (CDR) is one of three CDRs which combine to form the NOAA Ocean Surface Bundle (OSB) CDR. The resultant sea surface temperature (SST) data are produced through modeling the diurnal variability in combination with AVHRR SST observations.", + "msft:storage_account": "noaacdr", + "msft:container": "sea-surface-temperature-whoi", + "msft:group_id": "noaa-cdr", + "extent": { + "spatial": { + "bbox": [ + [ + -180.0, + -90, + 180, + 90 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1988-01-01T00:00:00Z", + null + ] + ] + } + }, + "license": "proprietary" +} \ No newline at end of file diff --git a/datasets/noaa-cdr/dataset.yaml b/datasets/noaa-cdr/dataset.yaml new file mode 100644 index 00000000..e44098be --- /dev/null +++ b/datasets/noaa-cdr/dataset.yaml @@ -0,0 +1,88 @@ +id: noaa-cdr +image: ${{ args.registry }}/pctasks-task-base:latest +args: + - registry +code: + src: ${{ local.path(./noaa_cdr.py) }} + requirements: ${{ local.path(./requirements.txt) }} +environment: + AZURE_TENANT_ID: ${{ secrets.task-tenant-id }} + AZURE_CLIENT_ID: ${{ secrets.task-client-id }} + AZURE_CLIENT_SECRET: ${{ secrets.task-client-secret }} +collections: + - id: noaa-cdr-ocean-heat-content + template: ${{ local.path(./collections/ocean-heat-content) }} + class: noaa_cdr:OceanHeatContentCollection + asset_storage: + - uri: blob://noaacdr/ocean-heat-content + chunks: + options: + name_starts_with: data/derived + extensions: [.nc] + limit: 1 + chunk_storage: + uri: blob://ai4edataeuwest/pctasks-scratch-etl-data/noaa-cdr/ocean-heat-content + - id: noaa-cdr-ocean-heat-content-netcdf + template: ${{ local.path(./collections/ocean-heat-content-netcdf) }} + class: noaa_cdr:OceanHeatContentNetcdfCollection + asset_storage: + - uri: blob://noaacdr/ocean-heat-content + chunks: + options: + name_starts_with: data/derived + extensions: [.nc] + limit: 1 + chunk_storage: + uri: blob://ai4edataeuwest/pctasks-scratch-etl-data/noaa-cdr/ocean-heat-content-netcdf + - id: noaa-cdr-sea-ice-concentration + template: ${{ local.path(./collections/sea-ice-concentration) }} + class: noaa_cdr:SeaIceConcentrationCollection + asset_storage: + - uri: blob://noaacdr/sea-ice-concentration + chunks: + options: + name_starts_with: data + extensions: [.nc] + # TODO remove this line when we've moved the netcdfs to europe + limit: 1 + chunk_storage: + uri: blob://ai4edataeuwest/pctasks-scratch-etl-data/noaa-cdr/sea-ice-concentration + - id: noaa-cdr-sea-surface-temperature-optimum-interpolation + template: ${{ local.path(./collections/sea-surface-temperature-optimum-interpolation) }} + class: noaa_cdr:SeaSurfaceTemperatureOptimumInterpolationCollection + asset_storage: + - uri: blob://noaacdr/sea-surface-temp-optimum-interpolation + chunks: + options: + name_starts_with: data/v2.1/avhrr + extensions: [.nc] + # TODO remove this line when we've moved the netcdfs to europe + limit: 1 + chunk_storage: + uri: blob://ai4edataeuwest/pctasks-scratch-etl-data/noaa-cdr/sea-surface-temperature-optimum-interpolation + - id: noaa-cdr-sea-surface-temperature-whoi + template: ${{ local.path(./collections/sea-surface-temperature-whoi) }} + class: noaa_cdr:SeaSurfaceTemperatureWhoiCollection + asset_storage: + - uri: blob://noaacdr/sea-surface-temp-whoi + chunks: + options: + name_starts_with: data + extensions: [.nc] + # TODO remove this line when we've moved the netcdfs to europe + limit: 1 + chunk_storage: + uri: blob://ai4edataeuwest/pctasks-scratch-etl-data/noaa-cdr/sea-surface-temperature-whoi + - id: noaa-cdr-sea-surface-temperature-whoi-netcdf + template: ${{ local.path(./collections/sea-surface-temperature-whoi-netcdf) }} + class: noaa_cdr:SeaSurfaceTemperatureWhoiNetcdfCollection + asset_storage: + - uri: blob://noaacdr/sea-surface-temp-whoi + chunks: + options: + name_starts_with: data + extensions: [.nc] + # TODO remove this line when we've moved the netcdfs to europe + limit: 1 + chunk_storage: + uri: blob://ai4edataeuwest/pctasks-scratch-etl-data/noaa-cdr/sea-surface-temperature-whoi-netcdf diff --git a/datasets/noaa-cdr/noaa_cdr.py b/datasets/noaa-cdr/noaa_cdr.py new file mode 100644 index 00000000..b0e556a5 --- /dev/null +++ b/datasets/noaa-cdr/noaa_cdr.py @@ -0,0 +1,205 @@ +import logging +import os.path +from tempfile import TemporaryDirectory +from typing import List, Union + +import stactools.noaa_cdr.constants +import stactools.noaa_cdr.ocean_heat_content.stac +import stactools.noaa_cdr.sea_ice_concentration.stac +import stactools.noaa_cdr.sea_surface_temperature_optimum_interpolation.stac +import stactools.noaa_cdr.sea_surface_temperature_whoi.stac +import stactools.noaa_cdr.stac +from pystac import Item, MediaType + +from pctasks.core.models.task import WaitTaskResult +from pctasks.core.storage import StorageFactory +from pctasks.dataset.collection import Collection + +logger = logging.getLogger(__name__) + + +def cog_uri(name: str) -> str: + return f"blob://ai4edataeuwest/pctasks-scratch-etl-data/noaa-cdr/{name}/cogs/" + + +class OceanHeatContentCollection(Collection): + @classmethod + def create_item( + cls, asset_uri: str, storage_factory: StorageFactory + ) -> Union[List[Item], WaitTaskResult]: + directory = "/".join(asset_uri.split("/")[:-1]) + asset_storage = storage_factory.get_storage(directory) + files = asset_storage.list_files(extensions=[".nc"]) + # TODO remove this reassignment + files = list( + ( + file + for file in files + if file.endswith("heat_content_anomaly_0-2000_yearly.nc") + ) + ) + + cog_storage = storage_factory.get_storage(cog_uri("ocean-heat-content")) + cog_files = cog_storage.list_files(extensions=[".tif"]) + cog_hrefs = [cog_storage.get_url(file) for file in cog_files] + + with TemporaryDirectory() as temporary_directory: + local_netcdf_paths = [] + for file in files: + path = os.path.join(temporary_directory, os.path.basename(file)) + asset_storage.download_file(file, path) + local_netcdf_paths.append(path) + items = stactools.noaa_cdr.ocean_heat_content.stac.create_items( + hrefs=local_netcdf_paths, + directory=temporary_directory, + cog_hrefs=cog_hrefs, + ) + # TODO add a derived-from link + for item in items: + for key, asset in item.assets.items(): + if asset.href.startswith( + temporary_directory + ) and asset.href.endswith(".tif"): + file_name = os.path.basename(asset.href) + cog_url = cog_storage.get_url(file_name) + cog_storage.upload_file(asset.href, file_name) + asset.href = cog_url + item.assets[key] = asset + return items + + +class OceanHeatContentNetcdfCollection(Collection): + @classmethod + def create_item( + cls, asset_uri: str, storage_factory: StorageFactory + ) -> Union[List[Item], WaitTaskResult]: + directory = "/".join(asset_uri.split("/")[:-1]) + asset_storage = storage_factory.get_storage(directory) + files = asset_storage.list_files(extensions=[".nc"]) + # TODO remove this reassignment + files = list( + ( + file + for file in files + if file.endswith("heat_content_anomaly_0-2000_yearly.nc") + ) + ) + + items = list() + with TemporaryDirectory() as temporary_directory: + for file in files: + path = os.path.join(temporary_directory, os.path.basename(file)) + asset_storage.download_file(file, path) + item = stactools.noaa_cdr.stac.create_item(path, decode_times=False) + item.assets[ + stactools.noaa_cdr.constants.NETCDF_ASSET_KEY + ].href = asset_storage.get_url(file) + items.append(item) + + return items + + +class SeaIceConcentrationCollection(Collection): + @classmethod + def create_item( + cls, asset_uri: str, storage_factory: StorageFactory + ) -> Union[List[Item], WaitTaskResult]: + asset_storage, asset_path = storage_factory.get_storage_for_file(asset_uri) + year = asset_path.split("/")[1] + cog_storage = storage_factory.get_storage(cog_uri("sea-ice-concentration")) + with TemporaryDirectory() as temporary_directory: + file_name = os.path.basename(asset_path) + outfile = os.path.join(temporary_directory, file_name) + asset_storage.download_file(asset_path, outfile) + item = stactools.noaa_cdr.sea_ice_concentration.stac.create_item(outfile) + item.assets[ + stactools.noaa_cdr.constants.NETCDF_ASSET_KEY + ].href = asset_storage.get_url(asset_path) + + item = stactools.noaa_cdr.sea_ice_concentration.stac.add_cogs( + item, temporary_directory + ) + for key, asset in item.assets.items(): + if asset.media_type == MediaType.COG: + cog_path = f"{year}/{os.path.basename(asset.href)}" + cog_storage.upload_file(asset.href, cog_path) + asset.href = cog_storage.get_url(cog_path) + item.assets[key] = asset + return [item] + + +class SeaSurfaceTemperatureOptimumInterpolationCollection(Collection): + @classmethod + def create_item( + cls, asset_uri: str, storage_factory: StorageFactory + ) -> Union[List[Item], WaitTaskResult]: + asset_storage, asset_path = storage_factory.get_storage_for_file(asset_uri) + prefix = asset_path.split("/")[-2] + cog_storage = storage_factory.get_storage( + cog_uri("sea-surface-temperature-optimum-interpolation") + ) + with TemporaryDirectory() as temporary_directory: + file_name = os.path.basename(asset_path) + outfile = os.path.join(temporary_directory, file_name) + asset_storage.download_file(asset_path, outfile) + item = stactools.noaa_cdr.sea_surface_temperature_optimum_interpolation.stac.create_item( + outfile + ) + item.assets[ + stactools.noaa_cdr.constants.NETCDF_ASSET_KEY + ].href = asset_storage.get_url(asset_path) + + item = stactools.noaa_cdr.stac.add_cogs(item, temporary_directory) + for key, asset in item.assets.items(): + if asset.media_type == MediaType.COG: + cog_path = f"{prefix}/{os.path.basename(asset.href)}" + cog_storage.upload_file(asset.href, cog_path) + asset.href = cog_storage.get_url(cog_path) + item.assets[key] = asset + return [item] + + +class SeaSurfaceTemperatureWhoiCollection(Collection): + @classmethod + def create_item( + cls, asset_uri: str, storage_factory: StorageFactory + ) -> Union[List[Item], WaitTaskResult]: + asset_storage, asset_path = storage_factory.get_storage_for_file(asset_uri) + year = asset_path.split("/")[1] + cog_storage = storage_factory.get_storage( + cog_uri("sea-surface-temperature-whoi") + ) + with TemporaryDirectory() as temporary_directory: + file_name = os.path.basename(asset_path) + outfile = os.path.join(temporary_directory, file_name) + asset_storage.download_file(asset_path, outfile) + items = ( + stactools.noaa_cdr.sea_surface_temperature_whoi.stac.create_cog_items( + outfile, temporary_directory + ) + ) + for item in items: + for key, asset in item.assets.items(): + if asset.media_type == MediaType.COG: + cog_path = f"{year}/{os.path.basename(asset.href)}" + cog_storage.upload_file(asset.href, cog_path) + asset.href = cog_storage.get_url(cog_path) + item.assets[key] = asset + return items + + +class SeaSurfaceTemperatureWhoiNetcdfCollection(Collection): + @classmethod + def create_item( + cls, asset_uri: str, storage_factory: StorageFactory + ) -> Union[List[Item], WaitTaskResult]: + asset_storage, asset_path = storage_factory.get_storage_for_file(asset_uri) + with TemporaryDirectory() as temporary_directory: + file_name = os.path.basename(asset_path) + outfile = os.path.join(temporary_directory, file_name) + asset_storage.download_file(asset_path, outfile) + item = stactools.noaa_cdr.stac.create_item(outfile, temporary_directory) + item.assets[ + stactools.noaa_cdr.constants.NETCDF_ASSET_KEY + ].href = asset_storage.get_url(asset_path) + return [item] diff --git a/datasets/noaa-cdr/requirements.txt b/datasets/noaa-cdr/requirements.txt new file mode 100644 index 00000000..1600d9eb --- /dev/null +++ b/datasets/noaa-cdr/requirements.txt @@ -0,0 +1 @@ +git+https://github.com/stactools-packages/noaa-cdr@e220e1e05297cfcc3d71af25e41f8f3f3b7a6383 diff --git a/datasets/noaa-cdr/scripts/create_collections.py b/datasets/noaa-cdr/scripts/create_collections.py new file mode 100644 index 00000000..7c353bd5 --- /dev/null +++ b/datasets/noaa-cdr/scripts/create_collections.py @@ -0,0 +1,97 @@ +from dataclasses import dataclass +from pathlib import Path +from typing import Any, Dict + +import orjson +from pystac import Collection, Provider, ProviderRole +from stactools.noaa_cdr.constants import NETCDF_ASSET_KEY + +RAW_EXAMPLES_URL = ( + "https://raw.githubusercontent.com/stactools-packages/noaa-cdr/main/examples" +) +COLLECTIONS = Path(__file__).parents[1] / "collections" +SHORT_DESCRIPTION = { + "ocean-heat-content": "The Ocean Heat Content Climate Data Record (CDR) is a set of ocean heat content anomaly (OHCA) time-series for 1955-present on 3-monthly, yearly, and pentadal (five-yearly) scales.", + "sea-ice-concentration": "The Sea Ice Concentration Climate Data Record (CDR) provides a consistent daily and monthly time series of sea ice concentrations for both the north and south Polar Regions on a 25 km x 25 km grid.", + "sea-surface-temperature-optimum-interpolation": "The NOAA 1/4° daily Optimum Interpolation Sea Surface Temperature (or daily OISST) Climate Data Record (CDR) provides complete ocean temperature fields constructed by combining bias-adjusted observations from different platforms (satellites, ships, buoys) on a regular global grid, with gaps filled in by interpolation.", + "sea-surface-temperature-whoi": "The Sea Surface Temperature-Woods Hole Oceanographic Institution (WHOI) Climate Data Record (CDR) is one of three CDRs which combine to form the NOAA Ocean Surface Bundle (OSB) CDR. The resultant sea surface temperature (SST) data are produced through modeling the diurnal variability in combination with AVHRR SST observations.", +} + + +@dataclass +class CollectionFileContent: + template: Dict[str, Any] + description: str + + @classmethod + def from_name(cls, name: str) -> "CollectionFileContent": + url = f"{RAW_EXAMPLES_URL}/noaa-cdr-{name}/collection.json" + collection = Collection.from_file(url) + description = collection.description + collection.description = "{{ collection.description }}" + collection.clear_items() + assert collection.providers + noaa = collection.providers[0] + noaa.roles = [ + ProviderRole.PRODUCER, + ProviderRole.PROCESSOR, + ProviderRole.LICENSOR, + ] + microsoft = Provider( + name="Microsoft", + roles=[ProviderRole.PROCESSOR, ProviderRole.HOST], + url="https://planetarycomputer.microsoft.com", + ) + collection.providers = [noaa, microsoft] + collection.extra_fields["msft:short_description"] = SHORT_DESCRIPTION[name] + collection.extra_fields["msft:storage_account"] = "noaacdr" + collection.extra_fields["msft:container"] = name + collection.extra_fields["msft:group_id"] = "noaa-cdr" + + collection_as_dict = collection.to_dict(include_self_link=False) + collection_as_dict["links"] = [ + l for l in collection_as_dict["links"] if l["rel"] not in {"root", "parent"} + ] # Required until https://github.com/stac-utils/pystac/pull/896 + if "assets" in collection_as_dict: + del collection_as_dict["assets"] + return CollectionFileContent( + template=collection_as_dict, description=description + ) + + def write(self, name: str) -> None: + directory = COLLECTIONS / name + directory.mkdir(exist_ok=True) + with open(directory / "template.json", "w") as f: + f.write( + orjson.dumps(self.template, option=orjson.OPT_INDENT_2).decode("utf-8") + ) + with open(directory / "description.md", "w") as f: + f.write(self.description) + + +def create_collection(name: str) -> None: + collection_file_content = CollectionFileContent.from_name(name) + collection_file_content.write(name) + + +def create_netcdf_collection(name: str) -> None: + collection_file_content = CollectionFileContent.from_name(name) + collection = collection_file_content.template + collection_file_content.description += f"\n\nThis is a NetCDF-only collection, for Cloud-Optimized GeoTIFFS use collection '{collection['id']}'." + collection["id"] += "-netcdf" + collection["item_assets"] = { + NETCDF_ASSET_KEY: { + "type": "application/netcdf", + "roles": ["data"], + } + } + collection["title"] += " NetCDFs" + collection_file_content.write(f"{name}-netcdf") + + +create_collection("ocean-heat-content") +create_netcdf_collection("ocean-heat-content") +create_collection("sea-ice-concentration") +create_collection("sea-surface-temperature-optimum-interpolation") +create_collection("sea-surface-temperature-whoi") +create_netcdf_collection("sea-surface-temperature-whoi")