Skip to content
GitLab
    • Explore Projects Groups Topics Snippets
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • scenes scenes
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

La forge institutionnelle d'INRAE étant en production depuis le 10 juin 2025, nous vous invitons à y créer vos nouveaux projets.

  • umr-tetisumr-tetis
  • scenesscenes
  • Merge requests
  • !39

DOC: improve doc

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Cresson Remi requested to merge improve_mkdoc_doc into develop 3 years ago
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1
Compare
  • develop (base)

and
  • latest version
    1803c3fd
    1 commit, 3 years ago

1 file
+ 94
− 4

    Preferences

    File browser
    Compare changes
doc/arch.md
+ 94
− 4
  • View file @ 1803c3fd

  • Edit in single-file editor

  • Open in Web IDE


@@ -8,9 +8,56 @@ Currently, supported sensors are:
@@ -8,9 +8,56 @@ Currently, supported sensors are:
- Sentinel-2 (Theia, Level 2)
- Sentinel-2 (Theia, Level 2)
- Sentinel-2 (Theia, Level 3)
- Sentinel-2 (Theia, Level 3)
## Imagery access
# Spot-6 and Spot-7
### Use cases
## Instantiation
 
 
Spot 6/7 scenes are instantiated from XS and PAN XML files of DIMAPS products.
 
``` py
 
from scenes.spot import Spot67Scene
 
sc = Spot67Scene(dimap_file_xs="/path/to/DIM_SPOT7_MS_..._1.XML",
 
dimap_file_pan="/path/to/DIM_SPOT7_P_..._1.XML")
 
```
 
 
## Metadata
 
 
Like any `Scene` objects, the `Spot67Scene` has a `get_metadata()` method to access the dictionary containing the metadata.
 
``` py
 
for key, value in sc.get_metadata():
 
print(f"md[{key}]: {value}")
 
```
 
 
## Imagery
 
 
The `Imagery` is the root for the `Sources`.
 
In the case of Spot-6/7, the `Spot67Imagery` enables to select the radiometry of the different sources (DN, TOA or TOC).
 
 
``` py
 
dn = sc.get_imagery()
 
toa = sc.get_imagery("toa")
 
toc = sc.get_imagery("toc")
 
```
 
 
## Sources
 
 
Spot-6/7 image have 3 sources:
 
 
- XS
 
- PAN
 
- PXS
 
 
Each source can be masked with the cloud masks of the original product.
 
The no-data value can be chosen.
 
 
``` py
 
for img in [dn, toa, toc]:
 
for src in [img.get_xs(), img.get_pan(), img.get(pxs)]:
 
masked_src = src.cld_msk_drilled() # (1)
 
```
 
 
1. To change the no-data inside the clouds mask: `masked_src = src.cld_msk_drilled(nodata=-999)`
 
 
## Examples
Computing NDVI from XS image in TOA reflectance:
Computing NDVI from XS image in TOA reflectance:
@@ -36,7 +83,7 @@ The next example is a set of preprocessing operations on a Spot-6/7 XS image:
@@ -36,7 +83,7 @@ The next example is a set of preprocessing operations on a Spot-6/7 XS image:
``` py
``` py
toa = scene.get_imagery(reflectance="toa") # (1)
toa = scene.get_imagery(reflectance="toa") # (1)
pxs = toa.get_pxs() # (2)
pxs = toa.get_pxs() # (2)
drilled = pxs.drilled() # (3)
drilled = pxs.cld_msk_drilled() # (3)
ref_img = "/tmp/S2A_2020...._FRE_10m.tif"
ref_img = "/tmp/S2A_2020...._FRE_10m.tif"
subset = drilled.clip_over_img(ref_img) # (4)
subset = drilled.clip_over_img(ref_img) # (4)
subset.write("subset.tif")
subset.write("subset.tif")
@@ -62,7 +109,50 @@ superimposed = toa.resample_over(ref_img)
@@ -62,7 +109,50 @@ superimposed = toa.resample_over(ref_img)
superimposed.write("superimposed.tif")
superimposed.write("superimposed.tif")
```
```
## Spatial and temporal indexation
# Sentinel-2
 
 
Currently, Level-2 and Level-3 products from the [Theia land data center](https://www.theia-land.fr/en/product/sentinel-2-surface-reflectance/) are supported.
 
 
## Instantiation
 
 
Sentinel-2 scenes are instantiated from the product archive or folder.
 
 
``` py
 
from scenes.sentinel import Sentinel22AScene, Sentinel23AScene
 
sc_level2 = Sentinel22AScene("/path/to/SENTINEL2A_..._V1-8/.zip")
 
sc_level3 = Sentinel23AScene("/path/to/SENTINEL2X_...L3A_T31TEJ_D/.zip")
 
```
 
 
## Imagery and sources
 
 
Sentinel-2 images have a single imagery instance, containing 2 sources:
 
 
- 10m bands
 
- 20m bands
 
 
Each source can be drilled with no-data values:
 
 
- for Level 2 products: using the cloud mask
 
 
``` py
 
src = sc_level2.get_imagery().get_10m_bands()
 
masked_src = src.cld_msk_drilled() # (1)
 
```
 
 
1. To change the no-data inside the clouds mask: `masked_src = src.cld_msk_drilled(nodata=-999)`
 
 
- for Level 3 products: using the quality mask
 
 
``` py
 
src = sc_level2.get_imagery().get_10m_bands()
 
masked_src = src.flg_msk_drilled() # (1)
 
```
 
 
1. To change the no-data inside the clouds mask: `masked_src = src.flg_msk_drilled(nodata=-999)`.
 
Also, the `keep_flags_values` can be used to select the pixels to keep from a list of values in the quality mask (land, water, snow, ...).
 
 
 
# Spatial and temporal indexation
Perform a query in space (WGS84 bounding box) and time (optional) with an indexation structure.
Perform a query in space (WGS84 bounding box) and time (optional) with an indexation structure.
``` py
``` py
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
1
Doc
1
Doc
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 Participant
Cresson Remi
Reference: umr-tetis/scenes!39
Source branch: improve_mkdoc_doc

Menu

Explore Projects Groups Topics Snippets