sertit / eoreader

Remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
https://eoreader.readthedocs.io/en/latest/
Apache License 2.0
278 stars 22 forks source link

Add temporary thumbnail asset - Cosmo product #148

Closed jteulade closed 3 months ago

jteulade commented 4 months ago

When you open this product s3://sertit-projects-archives/projects/2024/Formation_SAR_DESCARTES_2023/Inondations/data/CosmoSkyMed/RAW and create a STAC item. It generates a quicklook .tif in a temporary path. here Then, we add a temporary path in the stac catalog asset:

"assets":{
      "thumbnail":{
         "href":"/tmp/tmpx81isn1j/tmp_20221013T070355_CSK_HH_HI_SCS/20221013T070355_CSK_HH_HI_SCS_QLK.tif",
         "type":"image/tiff; application=geotiff"
      },
      "HH":{
         "href":"s3://sertit-projects/stac/VALID_PRODUCTS/CSK/20221013T070355_CSK_HH_HI_SCS/CSKS4_SCS_B_HI_16_HH_RD_FF_20221013070356_20221013070403.h5",
         "title":"HH",
         "description":"No description available",
         "eoreader_name":"HH",
         "eo:bands":[
            {
               "name":"HH",
               "description":"No description available"
            }
         ],
         "created":"2024-05-23T21:46:05.008280Z",
         "updated":"2024-05-23T21:46:05.008314Z",
         "start_datetime":"2022-10-13T07:03:55.823965Z",
         "end_datetime":"2022-10-13T07:03:55.823965Z",
         "instruments":[
            "SAR-2000"
         ],
         "constellation":"cosmo-skymed",
         "gsd":2.5,
         "roles":[
            "intensity"
         ]
      }
   },

Solutions:

remi-braun commented 4 months ago

I think quicklooks are very valuable for stac items 😄 So I'd manage it in some way, maybe storing the quicklook along the raw product? Or in a mirrored filetree with additional files? (maybe we'll have to create quicklooks for every product that doesn't have one, but this is a task to be done outside EOReader)

jteulade commented 4 months ago

So, according to you, I should manage quicklooks outside EOReader. However, you add a comment to manage S3 folder inside here I can modify EOReader cosmo_product.py to write in S3 instead of a temporary folder, OR don't touch EOReader and move after the quicklook from temporary to S3. But the first solution seems better.

jteulade commented 3 months ago

Finally I did the second solution. I fix this problem here