Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/stac output #84

Merged
merged 15 commits into from
May 7, 2024
Merged

Conversation

emileten
Copy link
Collaborator

@emileten emileten commented May 6, 2024

This PR adds functionality to convert the OS-C hazard inventory model to STAC.

OS-C hazard has a legacy custom JSON structure to describe an inventory of the indicators produced. For interoperatibility, there is a long standing goal of having these inventories be STAC-compliant. The goal of this PR is to support this option, while preserving the legacy behavior.

More specifically :

  • We add a to_stac_item(self) -> pystac.Item method to the HazardResource class.
  • We add a to_stac_items(self) -> List[pystac.Item] method to the HazardResources class.
  • In docs_store and the I/O methods that read/write inventories, we add a format option that takes by default the value 'osc' and optionally 'stac'.

We kept it as simple as possible with minimal coding, which means that the resulting STAC metadata is sub-optimal. Ideally, we would want one item to describe a single zarr array. Instead, one STAC item and its single asset map to one HazardResource, that may describe a group of zarr arrays. As a consequence, the asset of the item isn't pointing to an actual dataset, but displays the path to zarr arrays that has to be built with parameters and scenarios described in properties. This isn't how STAC is supposed to be used, but for now this will fulfill the basic requirement.

@emileten emileten requested a review from joemoorhouse May 6, 2024 16:57
@emileten emileten merged commit 709b945 into os-climate:main May 7, 2024
11 of 17 checks passed
@emileten emileten deleted the feat/stac-output branch May 7, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant