You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-14Lines changed: 42 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Automatization of the SEN-et SNAP plugin for multi-temporal analysis
2
2
## Description
3
3
4
-
The [SEN-ET project](https://www.esa-sen4et.org/) has been founded for ESA with the main object to "develop an optimal methodology for estimating evapotranspiration at fine (tens of meters) spatial scale, based on synergistic use of Sentinel 2 and Sentinel 3 satellites’ observations" as reported by the website of the project.
4
+
The [SEN-ET project](https://www.esa-sen4et.org/) has been founded for ESA with the main object to *"develop an optimal methodology for estimating evapotranspiration at fine (tens of meters) spatial scale, based on synergistic use of Sentinel 2 and Sentinel 3 satellites’ observations"* as reported by the website of the project.
5
5
6
-
The plugin is mainly thought for use inside SNAP, so a manual operation where the user has to make the different operations manually. However, also the python script for the operation have been released.
6
+
The plugin is mainly thought for use inside SNAP, so a manual operation where the user has to make the different operations manually. However, also the python scripts for the operation have been released.
7
7
The scope of this repository is to create the possibility to automatize the process, allowing the computation of multiple days without the manual input of the operator. So, it is possible to compute monthly means on an area of interest.
8
8
9
9
The original schema for the plugin is represented in the image below:
@@ -12,14 +12,36 @@ The original schema for the plugin is represented in the image below:
12
12
13
13
The automation process reduces it to one step and presents this schema:
14
14
15
-

15
+

16
16
17
17
## Installation
18
18
It is needed to have installed SNAP (with Python 3.6) and the [SEN-ET plugin](https://www.esa-sen4et.org/static/media/Sen-ET-plugin-v1.0.1.b41ae6c8.zip) as indicated in the [official plugin documentation](https://www.esa-sen4et.org/static/media/sen-et-user-manual-v1.1.0.5d1ac526.pdf) in Section 3.2. In case of troubleshooting, see Section 3.4.
19
19
20
-
The test that everything is working will be the download of the ERA5 Data in the next step.
20
+
The suggested version of python to be used for Windows is the 3.6.8, it should be download before the installation of SNAP. The installer could installed [here](https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe).
21
21
22
-
It is also needed for Windows computers to install the Git Bash terminal provided with the installation of [Git](https://git-scm.com/downloads).
22
+
At the first start, it is needed to run an operator to complete the bundle installation as indicated in the documentation:
23
+
24
+
*The first time any of the Sen-ET operators is run the user will receive a SNAP - Warning message about path not existing. After clicking OK another dialog will appear asking user if they want to proceed with bundle download/installation (Figure 3.4). After clicking "Yes" the download and installation of the plugin bundle (the self-contained Python environment) will happen automatically. When the bundle installation finishes, a message will notify of the successful installation of the bundle. The Sen-ET SNAP plugin is installed and ready for use.*
25
+
26
+
The installation and the test that everything is working will be done in the step of the download of the ERA5 Data. This will be later explained.
27
+
28
+
For Windows computers, it is also needed to install the Git Bash terminal provided with the installation of [Git](https://git-scm.com/downloads).
For the automatization of the project, it is needed to have python installed on the computer. Also, these libraries are needed:
37
+
- xarray
38
+
- netcdf4
39
+
- h5netcdf
40
+
41
+
It is possible and recommended to use conda to create the environment with all the dependencies with the command:
42
+
```
43
+
conda env create -f env.yml
44
+
```
23
45
24
46
## Data download
25
47
### ECMWF Reanalysis v5 (ERA5) Data
@@ -43,7 +65,7 @@ The images request needs to be of the product type:
43
65
That option could be added in the filters, zoom to the area of interest and drawn a rectangular in the area. Open the filter panel and add in the sensing date, the timespan of interest for your analysis, and the desired timespan. Using the preview, it is also possible to check the cloud coverage visually.
44
66
45
67
### Folder structure
46
-
Once the data are downloaded, it is needed to organize them in a specific way. An analysis of the data for one month will produce products for around 500 GB. The main folder that could be named as prefered, in the schema below `MAIN_FOLDER`. One folder for each type of data called `era`, `S2` and `S3`. Inside the `S2` and `S3` folders, a folder for each of the days of the images, the folder should be named in this format `YYYY_MM_DD`.
68
+
Once the data are downloaded, it is needed to organize them in a specific way. An analysis of the data for one month will produce products for around 500 GB. The main folder that could be named as preferred, in the schema below `MAIN_FOLDER`. One folder for each type of data is called `era`, `S2` and `S3`. Inside the `S2` and `S3` folders, a folder for each of the days of the images, the folder should be named in this format `YYYY_MM_DD`.
47
69
48
70
Once the structure has been created, the `era5.nc` and the images should be moved to the correct folder. Also, it is needed to unzip the images.
49
71
As example:
@@ -88,25 +110,31 @@ MAIN_FOLDER
88
110
Set the parameters in the file [`parameters.json`](input/parameters.json):
89
111
- Set the coordinates of the Area Of Interest (AOI), which could be the portion of the Sentinel 2 images or a bigger area; it is used to cut the Sentinel 3 images and improve the speed of the computation.
90
112
- The absolute path indicated by `MAIN_FOLDER` in the previous schema should be inserted in the `general_path` variable. In the example, the `MAIN_FOLDER` absolute path is `"D:\\TEMP\\"`.
91
-
- The path into the `setet_folder` variable. The `setet_folder` is something like `"C:\\Users\\user\\.snap\\auxdata\\sen-et-conda-Win64"`.
113
+
- The path into the `senet_folder` variable. The `senet_folder` is something like `"C:\\Users\\user\\.snap\\auxdata\\sen-et-conda-Win64"`.
92
114
- It is also possible to modify all the default computational parameters, as explained in Section 3.3 of the official guide. The *only* parameter that should be modified is the [timezone of the area](input/parameters.json#L12).
93
115
94
-
Finally, copy the absolute path of all the Sentinel Images in the file[`s2_paths.txt`](input/s2_paths.txt) and [`s3_paths.txt`](input/s3_paths.txt). The path should point to the file `MTD_MSIL2A.xml` for S2 and `xfdumanifest.xml` for S3.
116
+
Finally, copy the absolute path of all the Sentinel Images in the files[`s2_paths.txt`](input/s2_paths.txt) and [`s3_paths.txt`](input/s3_paths.txt). The path should point to the folders `.SAFE` for S2 and `.SEN3` for S3.
95
117
96
118
## Run the code
97
-
In a Bash terminal run:
119
+
### Windows
120
+
In conda terminal run:
98
121
```
99
-
sh main.sh
122
+
conda activate senet-auto
123
+
main.sh
100
124
```
101
-
After the computation of the Sentinel 3 images in the graph processing tool, it is necessary to insert the time of acquisition for the Sentinel 3 images. So, it is needed to open in SNAP the Sentinel image cut on the area of interest and report the time in the file `days_ADDTIME_s3.txt` and rename it as `days_time_s3.txt`.
102
-
The structure of the file should be: `YYYY_MM_DD HH:MM`
125
+
This will open a bash Terminal with all the dependencies correctly installed.
103
126
104
-
The script produces a message when the Sentinel 3 images are available for the computation and requests to confirm that the file `days_time_s3.txt` has been created.
127
+
### Unix system (linux/MacOS)
128
+
In a terminal run:
129
+
```
130
+
conda activate senet-auto
131
+
sh main.sh
132
+
```
105
133
106
134
## Correction of errors
107
135
In the [official code repository](https://github.com/DHI-GRAS/sen-et-snap-scripts) the graph presents some errors, due to some changes in the new versions of SNAP. To fix the errors the new version of the graph is present in the folder [graph](graph/).
108
136
109
137
## Authors
110
138
The official code of SNAP is released with [GNU General Public License v3.0](https://github.com/DHI-GRAS/sen-et-snap-scripts/blob/master/LICENSE) by the original authors and as reported in the [plugin code repository](https://github.com/DHI-GRAS/senEtSnapSta).
111
139
112
-
The code for the automatization of the process is also realeased by [Lorenzo Stucchi](https://github.com/LorenzoStucchi) with [GNU General Public License v3.0](LICENSE).
140
+
The code for the automatization of the process is also released by [Lorenzo Stucchi](https://github.com/LorenzoStucchi) with [GNU General Public License v3.0](LICENSE).
0 commit comments