Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • scenes scenes
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • umr-tetis
  • scenesscenes
  • Issues
  • #24

Closed
Open
Created Sep 07, 2022 by Cresson Remi@remi.cressonOwner7 of 9 tasks completed7/9 tasks

Support de STAC

Base

  • Publication scene --> STAC Item (cf. https://pystac.readthedocs.io/en/stable/tutorials/how-to-create-stac-catalogs.html):
    • rendre bbox similaire à rasterio
    • ajouter footprint (doit être similaire à rasterio)
  • Instanciation de scenes à partir de catalogue STAC
    • instancier un object Scene à partir d'un STAC Item

A investiguer

  • Genericité de l'API STAC pour faire des recherches par bbox et date
  • Mapping générique STAC Item --> SensorScene permettant l'ajout de multiples fournisseurs pour un capteur donné

Refonte des constructeurs de classes Scene

Avant

classDiagram
Scene <|-- Spot67Scene
Scene <|-- Sentinel2SceneBase
Sentinel2SceneBase <|-- Sentinel22AScene
Sentinel2SceneBase <|-- Sentinel23AScene

Scene : __init__(acquisition_date, epsg, extent_wgs84)
Scene : datetime acquisition_date
Scene : list extent_wgs84
Scene : int epsg
Scene : BoundingBox bbox_wgs84

Spot67Scene : __init__(dim_xs, dim_pan)
Spot67Scene : Spot67Source get_xs(reflectance)
Spot67Scene : Spot67Source get_pan(reflectance)
Spot67Scene : list extent_wgs84_xs
Spot67Scene : list extent_wgs84_pan
Spot67Scene : float sun_az
Spot67Scene : float sun_elev
Spot67Scene : str cld_msk_file_xs
Spot67Scene : str cld_msk_file_pan
Spot67Scene : str roi_msk_file_xs
Spot67Scene : str roi_msk_file_pan

Sentinel2SceneBase : __init__(archive, tag)
Sentinel2SceneBase : str archive
Sentinel2SceneBase : str tag

Sentinel22AScene : __init__(archive)
Sentinel22AScene : Sentinel22ASource get_10m_bands()
Sentinel22AScene : Sentinel22ASource get_20m_bands()
Sentinel22AScene: str clm_r1_msk_file
Sentinel22AScene: str edg_r1_msk_file
Sentinel22AScene: str clm_r2_msk_file
Sentinel22AScene: str edg_r2_msk_file

Sentinel23AScene : __init__(archive)
Sentinel23AScene : Sentinel23ASource get_10m_bands()
Sentinel23AScene : Sentinel23ASource get_20m_bands()
Sentinel23AScene: str flg_r1_msk_file
Sentinel23AScene: str flg_r2_msk_file

Après

Scenes

classDiagram

Scene <|-- Spot67Base
Spot67Base <|-- Spot67DRS
Spot67Base <|-- Spot67IGN

Scene <|-- Sentinel2Base
Sentinel2Base <|-- Sentinel2Theia2A
Sentinel2Base <|-- Sentinel2Theia3A
Sentinel2Base <|-- Sentinel2MPC2A

Scene : __init__(acquisition_date, epsg, extent_wgs84)
Scene : datetime acquisition_date
Scene : list extent_wgs84
Scene : int epsg
Scene : BoundingBox bbox_wgs84
Scene : dict[str, str] sources_paths

Spot67Base : __init__(src_xs, src_pan)
Spot67Base : list extent_wgs84_xs
Spot67Base : list extent_wgs84_pan

Sentinel2Base : __init__(assets_dict)
Sentinel2Base : class SourceClass

Sources

classDiagram


Source <|-- Spot67DRSSource

Source <|-- Sentinel2Source
Sentinel2Source <|-- Sentinel2Theia2ASource
Sentinel2Source <|-- Sentinel2Theia3ASource

Spot67DRSSource: reflectance(kwargs)
Spot67DRSSource: cld_msk_drilled(nodata)

Sentinel2Source: msk_drilled(msk_dict, exp, nodata)

Sentinel2Theia2ASource: get_cld_drilled(nodata)

Sentinel2Theia3ASource: get_flg_drilled(keep_flags_values, nodata)

Use cases

Local ADS-DRS Spot-6/7 products (DIMAP format)

sc = scenes.spot.from_dimaps(dim_xs='/path/to/DIM_SPOT6_XS_..._1.XML', 
                             dim_pan='/path/to/DIM_SPOT6_P_..._1.XML')
print(sc.sources)
['xs', 'p', 'cld_msk', 'xs_cld_msk', 'pan_cld_msk']

Remote ADS-DRS Spot-6/7 products from Dinamis STAC catalog

scs = scenes.stac.search(url = "https://stacapi.147.100.200.143.nip.io"
                         collections = ["Spot-6-7-DRS-collection"],
                         bbox_wgs84=bbox)

print(scs[0].sources)
['xs', 'p', 'cld_msk', 'xs_cld_msk', 'pan_cld_msk']

Remote IGN Spot-6/7 orthos from Dinamis STAC catalog

scs = scenes.stac.search(url = "https://stacapi.147.100.200.143.nip.io"
                         collections = ["Spot-6-7-IGN-collection"],
                         bbox_wgs84=bbox)

print(scs[0].sources)
['xs', 'p']

Sentinel-2 Level 2A from Microsoft Planetary Computer

mpc_scs = scenes.stac.search(url="https://planetarycomputer.microsoft.com/api/stac/v1",
                             collections=["sentinel-2-l2a"],
                             bbox_wgs84=bbox)
print(mpc_scs[0].sources)
['10m_bands', '20m_bands', '60m_bands']

Sentinel-2 Level 2A from Theia

theia_scs = scenes.theia.search(level="2A", 
                                bbox_wgs84=bbox)
print(theia_scs[0].sources)
['10m_bands', '20m_bands', '60m_bands', '10m_CLM', '20m_CLM', '10m_EDG', '20m_EDG']

Sentinel-2 Level 3A from Theia

theia_scs = scenes.theia.search(level="3A", 
                                bbox_wgs84=bbox)
print(theia_scs[0].sources)
['10m_bands', '20m_bands', '60m_bands', '10m_FLG', '20m_FLG']

Howto

approche pragmatique

  • add get_10m_CLM, get_20m_CLM, get_10m_FLG, get_20m_FLG, get_10m_EDG, get_20m_EDG in Sentinel2Source
  • add get_cld_msk and get_xs_cld_msk, get_pan_cld_msk in Spot67DRSSource
  • add optional band indices in get_10m_bands and get_20m_bands in Sentinel2Scene
  • utiliser sources_paths pour garder les paths (urls, uris, filenames) des assets disponibles, summarizer cela dans les metadatas automatiquement (suppression des surcharges de get_metadata dans les classes héritant de Scene)

idee, trop compliqué à mettre en place

  • single Source class
  • add capabilities attribute to Source: list of all inherited capabilities (e.g. ['drilled', 'masked', 'resample_over', 'clip_over_img', 'clip_over_vec', 'reproject'] for any basic Source)
  • implement dynamic sources get (use a dict to store sources)
Edited Nov 02, 2022 by Cresson Remi
Assignee
Assign to
Time tracking