stactools-met-office-deterministic
stactools-met-office-deterministic is a Python package designed for generating SpatioTemporal Asset Catalog (STAC) metadata specifically for data originating from the Met Office Deterministic Numerical Weather Prediction model. It is part of the broader stactools ecosystem, which provides utilities for working with STAC. The current version is 0.4.2, and it typically sees rapid releases within the stactools-packages organization.
Warnings
- gotcha Specific API documentation, detailed usage examples, and explicit breaking change logs for `stactools-met-office-deterministic` are not readily available in public search results (GitHub README or official docs). Users should consult the source code for precise API usage or refer to general `stactools` patterns.
- gotcha The library relies on raw Met Office NWP data, typically NetCDF files. Incorrect file paths, unsupported data formats, or deviations from the expected Met Office data structure will lead to failures during STAC item generation.
Install
-
pip install stactools-met-office-deterministic
Imports
- stac
from stactools.met_office_deterministic import stac
Quickstart
import pystac
from stactools.met_office_deterministic import stac
# Placeholder for your Met Office Deterministic NWP data file path
# Replace with an actual path to a NetCDF file from the Met Office UKV 2km deterministic forecast.
input_data_path = "/path/to/your/met_office_deterministic_data.nc"
# Assuming a 'create_item' function exists to generate a STAC Item from a data file
# The exact parameters may vary; this is a common pattern in stactools packages.
try:
item = stac.create_item(input_data_path)
print(f"Successfully created STAC Item: {item.id}")
print(f"Item datetime: {item.datetime}")
# Optionally, save the item to a file
# item.save_object(dest_href='/tmp/met_office_item.json')
except AttributeError:
print("Error: 'stac.create_item' or similar function not found or failed. "
"Please refer to the actual library source or a more detailed example if available.")
except FileNotFoundError:
print(f"Error: Input data file not found at {input_data_path}. Please provide a valid path.")
except Exception as e:
print(f"An unexpected error occurred: {e}")