Skip to content

SPohlabeln/S2_TCVIS

Repository files navigation

Sentinel-2 TCVIS

Cloudmasking_tests_Phidown.ipynb : Cloud masking tests with Omnicloudmask & Phidown Downloads S2_workflow_1.ipynb : TCVIS trend calculations with unsufficient masking & long loading (stac_load) S2_workflow_1_omc.ipynb: TCVIS trend calculations with omnicloudmask integrated

Installation

  • recommended to use uv

uv sync

Usage

Scripts

Usage example

Download images

uv run download_scenes.py --month-start 07-01 --month-end 08-31 --years-start 2017 --years-end 2025 --n-parallel 4 --output-dir data/coverage70/scenes_raw

Mask images

running with CPU (ca 1:45 min per image)

uv run mask_scenes.py --device cpu --input-dir data/coverage70/scenes_raw/2017

running on cuda device (ca. 0:10 min per image)
  • use cuda or cpu
    • cuda:0 or cuda (GPU 0)
    • cuda:1 for specifying cuda device (here GPU 1)

uv run mask_scenes.py --input-dir data/coverage70/ scenes_raw/2017 --output-dir data/coverage70/scenes_masked/2017 --device cuda:2

All years
  • looks for files recursively and uses same relative file structure
  • data
    • coverage70
      • 2017
      • 2018
      • 2019
      • ...

uv run mask_scenes.py --input-dir data/coverage70/ scenes_raw --output-dir data/coverage70/scenes_masked --device cuda:2

Create mosaics

uv run calculate_medians.py --year-start 2017 --year-end 2025 --tif-dir data/coverage70/scenes_masked --output-dir data/coverage70/medians

Calculate Indices

uv run calculate_tc.py --median-dir data/coverage70/medians --output-dir data/coverage70/tc

Calculate Trends

  • parallelized execution with dask

uv run calculate_trend.py --dask-n-workers 32 --dask-memory-limit "16GB" --dask-chunksize 256 --output-file data/coverage70/trends/trend.tif

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors