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

Rebuild stac scripts #158

Merged
merged 6 commits into from
Sep 18, 2024
Merged

Rebuild stac scripts #158

merged 6 commits into from
Sep 18, 2024

Conversation

GriffinBabe
Copy link
Contributor

Implemented scripts to build the STAC catalogue from the extracted patches. The procedure is done in three steps

  1. scripts/stac/build_paths.py Parses a folder of S1/S2 patches (for example /vitodata/worldcereal_data/EXTRACTIONS/SENTINEL2/) and creates a file of a pickled list of paths to parallelize & parse in the next script.
  2. scripts/stac/cataloguer_builder.py Using the Spark cluster to read the extracted patches and build catalogues, then each separate catalogue is pickled in a different output file in a specified output folder.
  3. scripts/stac/split_catalogues.py Merges all the catalogues built by the previous script together and separates them by UTM as required by OpenEO. Separated by GFMAP's functionality openeo_gfmap.utils.split_stac.split_collection_by_epsg. The output folder will contain each STAC fully written as json.

In addition, I moved constants previously defined in the extraction scripts such as Asset Definitions in worldcereal's source folder. As from know on multiple scripts will use those values.

Finally, I disabled the creation/management of STAC assets from GFMAPJobManager in the extraction scripts.

To ease up the execution of the catalogue_builder.py script, I used the package mepsy developed by Daniele which allows to run Spark Jobs in our cluster with less hassle. I didn't add this dependency in the package as it is not publicly installable but instead accessible in our private git server: https://git.vito.be/projects/TAP-VEGTEAM/repos/mepsy/browse

We could make this more broadly available by not using mepsy, but then not many have a spark cluster for themselves and each one works on different configuration. Let me know what you think...

…tiles + Moved the asset definitions to worldcereal's source folder as they are accessef from multiple points
@GriffinBabe GriffinBabe self-assigned this Sep 16, 2024
@GriffinBabe GriffinBabe linked an issue Sep 16, 2024 that may be closed by this pull request
1 task
@GriffinBabe GriffinBabe linked an issue Sep 16, 2024 that may be closed by this pull request
@GriffinBabe GriffinBabe merged commit ec7fd58 into main Sep 18, 2024
4 checks passed
@GriffinBabe GriffinBabe deleted the 151-rebuild-stac branch September 18, 2024 09:12
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.

Replace the update_nc_attributes Develop script to re-build STAC catalogue
2 participants