diff --git a/paint/data/juelich_weather_stac_item.py b/paint/data/juelich_weather_stac_item.py new file mode 100644 index 0000000..14dac29 --- /dev/null +++ b/paint/data/juelich_weather_stac_item.py @@ -0,0 +1,87 @@ +from typing import Any, Dict + +import pandas as pd + +import paint.util.paint_mappings as mappings + + +def make_juelich_weather_item( + data: pd.Series, +) -> Dict[str, Any]: + """ + Generate a STAC item for the Juelich weather data. + + Parameters + ---------- + data : pd.Series + The metadata for the juelich weather data file. + + Returns + ------- + dict[str, Any] + The STAC item data as dictionary. + """ + return { + "stac_version": mappings.STAC_VERSION, + "stac_extensions": [], + "id": "juelich-weather", + "type": "Feature", + "title": "Weather data from Juelich", + "description": "Weather data from the Juelich weather station", + "collection": mappings.WEATHER_COLLECTION_ID, + "geometry": { + "type": "Point", + "coordinates": [ + mappings.POWER_PLANT_LAT, + mappings.POWER_PLANT_LON, + 0, # TODO: Correct Elevation + ], + }, + "bbox": [ + mappings.POWER_PLANT_LAT, + mappings.POWER_PLANT_LON, + 0, # TODO: Correct Elevation + mappings.POWER_PLANT_LAT, + mappings.POWER_PLANT_LON, + 0, # TODO: Correct Elevation + ], + "properties": { + "datetime": "null", + }, + "start_datetime": data[mappings.JUELICH_START], + "end_datetime": data[mappings.JUELICH_END], + "links": [ + { + "rel": "self", + "href": f"./{mappings.JUELICH_STAC_NAME}", + "type": mappings.MIME_GEOJSON, + "title": "Reference to this STAC file", + }, + { + "rel": "root", + "href": f"./{mappings.CATALOGUE_URL}", + "type": mappings.MIME_GEOJSON, + "title": f"Reference to the entire catalogue for {mappings.POWER_PLANT_GPPD_ID}", + }, + { + "rel": "parent", + "href": mappings.WEATHER_COLLECTION_URL, + "type": mappings.MIME_GEOJSON, + "title": "Reference to the collection STAC file", + }, + { + "rel": "collection", + "href": mappings.WEATHER_COLLECTION_FILE, + "type": mappings.MIME_GEOJSON, + "title": "Reference to the collection STAC file", + }, + ], + "assets": { + mappings.WEATHER_DATA_KEY: { + "href": "./juelich-weather.h5", + "roles": ["data"], + "type": mappings.MIME_HDF5, + "title": "Weather data from the Juelich weather station", + } + }, + }