Skip to content
Snippets Groups Projects
Commit 1b4d8423 authored by TGermain's avatar TGermain
Browse files

rtd 03072023

parent d75d91cb
No related branches found
No related tags found
No related merge requests found
Showing
with 138 additions and 43 deletions
Sen2cor 2.10.01
===============
Sen2cor 2.10
============
.. role:: bash(code)
:language: bash
......
<PAMDataset>
<Metadata domain="IMAGE_STRUCTURE">
<MDI key="INTERLEAVE">PIXEL</MDI>
</Metadata>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MEAN">224.90926240332</MDI>
<MDI key="STATISTICS_MINIMUM">0</MDI>
<MDI key="STATISTICS_STDDEV">67.116161408218</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="2">
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MEAN">221.1103565365</MDI>
<MDI key="STATISTICS_MINIMUM">5</MDI>
<MDI key="STATISTICS_STDDEV">69.493557576905</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="3">
<Metadata>
<MDI key="STATISTICS_MAXIMUM">255</MDI>
<MDI key="STATISTICS_MEAN">227.7741396502</MDI>
<MDI key="STATISTICS_MINIMUM">18</MDI>
<MDI key="STATISTICS_STDDEV">59.174002889391</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
......@@ -8,7 +8,7 @@ EODAG
.. code-block:: bash
pip install eodag==2.8.0
python -m pip install eodag==2.8.0
python3 -m pip install eodag-sentinelsat
......
......@@ -9,7 +9,6 @@ Why sen2chain, how to install, configure it, go!
:maxdepth: 2
:caption: Contents:
intro
my_install
eodag
sen2cor
......
=====================================
Why sen2chain?
=====================================
sen2chain was developped because blablabla
BLABLABLA
....... thomas
......@@ -7,7 +7,7 @@ pip
-----
.. code-block:: bash
python -m pip install --upgrade pip
sudo apt install python-pip
GDAL
-----
......
......@@ -3,10 +3,10 @@ Setting up recurrent routines : Jobs
====================================
Sen2Chain uses jobs to execute whole processing operations (downloading L1C, computing L2A with Sen2Cor, masking clouds, and producing indices) on any tile.
All os sen2chain's functions parameters can be specified, allowing for the production of multiple products in one go.
All of sen2chain's functions parameters can be specified, allowing for the production of multiple products in one go.
Jobs can be launched once or at regular intervals using crontab.
Jobs can be launched once or at scheduled hours using crontab.
Jobs config files are stored in your ``~/sen2chain_data/config/jobs/``.
......@@ -19,8 +19,8 @@ Each job is made of 2 files :
With *jid* the job identifier.
Jobs()
******
Job listing
***********
The *Jobs* class is used to list all jobs created in your sen2chain install.
......@@ -79,7 +79,7 @@ The configuration file first section is a list of global parameters for the job
- **logs**: True | False
- **timing**: Recurrence of the job when added to cron, in cron format
- **provider**: tProvider to download L1C products from, Default peps, values: peps | scihub
- **provider**: Provider to download L1C products from, Default peps, values: peps | scihub
- **tries**: Number of tries the download should loop before stopping, to download OFFLINE products
- **sleep**: Time in min to wait between download tries
- **nb_proc**: Number of cpu cores to use for this job, Default 8
......@@ -102,4 +102,60 @@ The second section of the configuration file is a list of tasks that will be pro
Configure Job
---------------
To
To configure a job with a large number of tasks on different tiles, we recommend manually editing the configuration file ``nano ~/sen2chain_data/config/jobs/job_jid.cfg``
Make sure to keep the same table structure too.
A job can also be configured with command lines. Add a task to a job config file with the *task_add()* method :
.. code-block:: python
>>>from sen2chain import Job
>>>j=Job(jid="jid")
INFO:sen2chain.jobs:Reading existing config...
>>>j.task_add()
Edit a task with *task_edit(task_id, **kwargs)* :
.. code-block:: python
>>> j.task_edit(task_id=0,tile='40KEC',remove='l1C')
Remove a task with *task_remove(task_id)*
.. code-block:: python
>>> j.task_remove(task_id=0)
Save and Launch a Job
---------------------
Save the config file to your local database. If the job you created is not saved, you will not be able to load it next time.
.. code-block:: python
j.save()
To launch a job directly from the command line :
.. code-block:: python
j.run()
Job in cron
-----------
You can add, deactivate and delete a job in cron with *cron_enable()*, *cron_disable()* and *cron_remove()*.
Cron will run the job at the frequency specified by the cron parameter (minute - hour - day - month - weekday) in ``job_jid.cfg``.
.. code-block:: python
j.cron_enable()
j.cron_disable()
j.cron_remove()
# TimeSeries
=====================
Time Series
=====================
Sen2chain latest functionality is Time Series Extraction. It allows to spatially extract masked radiometric indices from a spatial layer, like geojson or shapefile, and produce spatial statistics of these radiometric indices on the time period of your preferences.
Make sure the radiometric indices were produced for the right cloudmask version, otherwise an empty file will be generated.
Multiprocessing is available to speed up calculations. Finally, output data is exported to csv format.
.. code-block:: python
from sen2chain import TimeSeries
ts=TimeSeries(vectors_layers='/path/to/shapefile.shp',date_min=date_min,date_max=date_max,indices=['NDVI','NBR','BIGR'],cm_version='CM004',iterations =1,nb_proc=10)
....
....
ts.to_csv(out_path='/path/out_path')
......@@ -9,6 +9,6 @@ The next pages will help you learn how to properly use Sen2chain from the comman
:caption: Contents:
Tile
Library
Jobs
Library
TimeSeries
......@@ -3,12 +3,9 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to sen2chain's documentation!
Welcome to sen2chain documentation!
=====================================
| Currently under development. -thomasG
| Sen2Chain is a simple utility written in Python 3 to download and process Sentinel-2 images.
| It uses EODAG package to find and download data, and ESA's Sen2Cor processor to perform atmospheric, terrain and cirrus correction.
......@@ -31,12 +28,11 @@ INTERREG Renovrisk-impact project (2018-2020).
**Development and improvements :**
Jérémy Commins, Pascal Mouquet, Charlotte Wolff.
Jérémy Commins, Pascal Mouquet, Charlotte Wolff
**Conceptualization and Coordination :**
Vincent Herbreteau, Christophe Révillion.
Vincent Herbreteau, Christophe Révillion
.. toctree::
:maxdepth: 2
......@@ -53,5 +49,13 @@ Vincent Herbreteau, Christophe Révillion.
configure_sen2cor/index
contribute
release_hist
[Git repository] <https://framagit.org/espace-dev/sen2chain>
.. image:: ird_logo.png
:width: 24%
.. image:: esdev3.PNG
:width: 24%
.. image:: univ_reunion_logo.jpg
:width: 24%
.. image:: cnes_logo.png
:width: 24%
=======
library
Library
=======
.. automodule:: sen2chain.library
......
......@@ -7,10 +7,7 @@ Every package
.. toctree::
tiles
download_and_process
indices
library
products
sen2cor
products
......@@ -8,6 +8,7 @@ CloudMask 1
***********
Sen2chain historical cloud mask method is mask CM001. This product is directly extracted from the cloud probability mask output of Sen2cor, at 20m resolution.
This layer is a Quality indicator that calculates the probability(0-100%) that the earth surface is obstructed by clouds or optically thick aerosols like ice or snow.
Then, a binary image is generated by applying a threshold of cloud porbbaility over 25%.
......@@ -19,8 +20,10 @@ CloudMask 2
Sen2chain second mask is CM002, an evolution of CM001 that allows in some specific cases to reduce false cloud detection linked to unusually high snow probabilities in the CLDPRB layer of Sen2Cor.
These high probability values can be found on high reflectance rivers or in beach areas (specular surface reflections, high turbidity, white sand beaches...)
To get rid of these artefacts the SWIR spectral band, centered around 1600nm and relatively insensitive to these anomalies, is used.
SWIR Band B11 is transformed in a mask in 2 steps : First a binary image is generated with a reflectance threshold of 15%, then a binary dilatation filter of a 11x11 pixel round kernel is applied.
Then, the newly computed Cloud Mask CM002 is applied on the CM001, followed by a dilatation on a round kernel of 13x13 pixels.
The cloudmask CM002 is less sensitive on the areas mentionned before, but also slightly more dilated than CM001, allowing for a better interpretation of clouds with ambiguous boundaries.
......
......@@ -7,4 +7,3 @@ Product User Guide
Cloudmasks
Indices
Example
TimeSeries
========================
Release history
========================
Sen2chain 0.1.0 - 2019
Sen2chain 0.1.1 - 2023
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment