-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
952fbd4
commit 8f2213c
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
} | ||
}, | ||
} |