Skip to content

Commit 95983d5

Browse files
committed
updated STM tutorial
1 parent 910b55a commit 95983d5

File tree

1 file changed

+108
-99
lines changed

1 file changed

+108
-99
lines changed

docs/source/howto/stm.rst

Lines changed: 108 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This tutorial explains what Spectral Temporal Metrics are, and how to generate t
1111

1212
.. admonition:: Info
1313

14-
*This tutorial uses FORCE v. 3.5*
14+
*This tutorial uses FORCE v. 3.7.6*
1515

1616

1717
What are Spectral Temporal Metrics?
@@ -24,10 +24,11 @@ This can be the annual mean, standard deviation or median.
2424
Before calculating the statistics, the data is quality filtered, e.g. clouds are removed.
2525

2626
.. figure:: img/tutorial-stm-example.png
27+
:height: 400
2728

2829
*STM concept* |copy| *Stefan Ernst*
2930

30-
It is important to note that STMs are statistical aggregations - and not composites as in *we select the full spectrum for the optimal observation*.
31+
It is important to note that STMs are statistical aggregations - and not composites as in *"we select the full spectrum for the optimal observation"*.
3132

3233
Thus, some care should be taken when dealing with these kinds of metrics: an STM spectrum cannot be interpreted in the classic remote-sensing-textbook sense.
3334

@@ -62,7 +63,9 @@ It is hard to give a suggestion here, as this is a complex decision, which depen
6263

6364
To demonstrate, we are generating annual STMs for entire 2018:
6465

65-
``TIME_RANGE = 2018-01-01 2018-12-31``
66+
.. code-block:: bash
67+
68+
TIME_RANGE = 2018-01-01 2018-12-31
6669
6770
6871
Sensors
@@ -88,7 +91,9 @@ Bands / Indices
8891

8992
We will produce STMs for some spectral bands, as well as some indices:
9093

91-
``INDEX = RED NIR SWIR1 NDVI NDBI MNDWI``
94+
.. code-block:: bash
95+
96+
INDEX = RED NIR SWIR1 NDVI NDBI MNDWI
9297
9398
9499
Outlier detection
@@ -108,9 +113,11 @@ Interpolation
108113
"""""""""""""
109114

110115
Before temporally aggregating the L2 observations, we can interpolate the time series.
111-
Try this out! But for now, let’s go without:
116+
Try this out! But for now, let's go without:
117+
118+
.. code-block:: bash
112119
113-
``INTERPOLATE = NONE``
120+
INTERPOLATE = NONE
114121
115122
116123
STMs
@@ -150,7 +157,7 @@ Currently available are
150157
+-----+------------------------------------------------+
151158

152159

153-
Lets go with these metrics for now:
160+
Let's go with these metrics for now:
154161

155162
.. code-block:: bash
156163
@@ -165,7 +172,9 @@ By default, HLPS will produce multi-band files for each spectral band/index, i.e
165172

166173
If you rather prefer single-band images, i.e. one file for each index and each STM, use
167174

168-
OUTPUT_EXPLODE = TRUE
175+
.. code-block:: bash
176+
177+
OUTPUT_EXPLODE = TRUE
169178
170179
171180
Other parameters
@@ -182,31 +191,31 @@ Processing
182191
Processing is straightforward.
183192
Simply use:
184193

185-
.. code-block:: bash
194+
.. code-block:: none
186195
187196
force-higher-level /data/europe/stm/stm.prm
188197
189-
number of processing units: 280
190-
(active tiles: 28, chunks per tile: 10)
191-
________________________________________
192-
Progress: 100.00%
193-
Time for I/C/O: 087%/008%/004%
194-
ETA: 00y 00m 00d 00h 00m 00s
195-
196-
________________________________________
197-
Real time: 00y 00m 00d 00h 19m 05s
198-
Virtual time: 00y 00m 00d 00h 21m 35s
199-
Saved time: 00y 00m 00d 00h 02m 30s
200-
201-
________________________________________
202-
Virtual I-time: 00y 00m 00d 00h 18m 53s
203-
Virtual C-time: 00y 00m 00d 00h 01m 47s
204-
Virtual O-time: 00y 00m 00d 00h 00m 55s
205-
206-
________________________________________
207-
I-bound time: 00y 00m 00d 00h 17m 10s
208-
C-bound time: 00y 00m 00d 00h 00m 07s
209-
O-bound time: 00y 00m 00d 00h 00m 03s
198+
$ number of processing units: 280
199+
$ (active tiles: 28, chunks per tile: 10)
200+
$ ________________________________________
201+
$ Progress: 100.00%
202+
$ Time for I/C/O: 087%/008%/004%
203+
$ ETA: 00y 00m 00d 00h 00m 00s
204+
$
205+
$ ________________________________________
206+
$ Real time: 00y 00m 00d 00h 19m 05s
207+
$ Virtual time: 00y 00m 00d 00h 21m 35s
208+
$ Saved time: 00y 00m 00d 00h 02m 30s
209+
$
210+
$ ________________________________________
211+
$ Virtual I-time: 00y 00m 00d 00h 18m 53s
212+
$ Virtual C-time: 00y 00m 00d 00h 01m 47s
213+
$ Virtual O-time: 00y 00m 00d 00h 00m 55s
214+
$
215+
$ ________________________________________
216+
$ I-bound time: 00y 00m 00d 00h 17m 10s
217+
$ C-bound time: 00y 00m 00d 00h 00m 07s
218+
$ O-bound time: 00y 00m 00d 00h 00m 03s
210219
211220
212221
After this, we generate a mosaic.
@@ -217,26 +226,26 @@ With ``OUTPUT_EXPLODE = TRUE``, you get one image for each requested index and s
217226
218227
force-mosaic /data/europe/stm
219228
220-
mosaicking 42 products:
221-
1 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_AVG.tif
222-
2 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q10.tif
223-
3 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q25.tif
224-
4 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q50.tif
225-
...
226-
40 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q75.tif
227-
41 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q90.tif
228-
42 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_STD.tif
229-
230-
mosaicking 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_AVG.tif
231-
26 chips found.
232-
233-
mosaicking 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q25.tif
234-
26 chips found.
235-
236-
...
237-
238-
mosaicking 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_AVG.tif
239-
26 chips found.
229+
$ mosaicking 42 products:
230+
$ 1 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_AVG.tif
231+
$ 2 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q10.tif
232+
$ 3 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q25.tif
233+
$ 4 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q50.tif
234+
$ ...
235+
$ 40 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q75.tif
236+
$ 41 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q90.tif
237+
$ 42 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_STD.tif
238+
$
239+
$ mosaicking 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_AVG.tif
240+
$ 26 chips found.
241+
$
242+
$ mosaicking 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q25.tif
243+
$ 26 chips found.
244+
$
245+
$ ...
246+
$
247+
$ mosaicking 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_AVG.tif
248+
$ 26 chips found.
240249
241250
242251
Visualization
@@ -253,55 +262,55 @@ For fast visualization, we are computing pyramids.
253262
cd /data/europe/stm/mosaic
254263
force-stack *RED_STM_Q50.vrt *NIR_STM_Q50.vrt *SW1_STM_Q50.vrt stack-bands-STM_Q50.vrt
255264
force-stack *NDB_STM_Q90.vrt *NDV_STM_Q90.vrt *MNW_STM_Q90.vrt stack-indices-STM_Q90.vrt
256-
ls *.vrt | parallel force-pyramid {}
257-
258-
file 1:
259-
/data/europe/stm/mosaic
260-
2018-2018_001-365_HL_TSA_LNDLG_RED_STM_Q50.vrt
261-
9000 4000 1
262-
file 2:
263-
/data/europe/stm/mosaic
264-
2018-2018_001-365_HL_TSA_LNDLG_NIR_STM_Q50.vrt
265-
9000 4000 1
266-
file 3:
267-
/data/europe/stm/mosaic
268-
2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q50.vrt
269-
9000 4000 1
270-
271-
Same number of bands detected. Stacking by band.
272-
273-
Band 0001: 2018-2018_001-365_HL_TSA_LNDLG_RED_STM_Q50.vrt band 1
274-
Band 0002: 2018-2018_001-365_HL_TSA_LNDLG_NIR_STM_Q50.vrt band 1
275-
Band 0003: 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q50.vrt band 1
276-
277-
file 1:
278-
/data/europe/stm/mosaic
279-
2018-2018_001-365_HL_TSA_LNDLG_NDB_STM_Q90.vrt
280-
9000 4000 1
281-
file 2:
282-
/data/europe/stm/mosaic
283-
2018-2018_001-365_HL_TSA_LNDLG_NDV_STM_Q90.vrt
284-
9000 4000 1
285-
file 3:
286-
/data/europe/stm/mosaic
287-
2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q90.vrt
288-
9000 4000 1
289-
290-
Same number of bands detected. Stacking by band.
291-
292-
Band 0001: 2018-2018_001-365_HL_TSA_LNDLG_NDB_STM_Q90.vrt band 1
293-
Band 0002: 2018-2018_001-365_HL_TSA_LNDLG_NDV_STM_Q90.vrt band 1
294-
Band 0003: 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q90.vrt band 1
295-
296-
computing pyramids for 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q10.vrt
297-
0...10...20...30...40...50...60...70...80...90...100 - done.
298-
computing pyramids for 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q25.vrt
299-
0...10...20...30...40...50...60...70...80...90...100 - done.
300-
...
301-
computing pyramids for stack-bands-STM_Q50.vrt
302-
0...10...20...30...40...50...60...70...80...90...100 - done.
303-
computing pyramids for stack-indices-STM_Q90.vrt
304-
0...10...20...30...40...50...60...70...80...90...100 - done.
265+
force-pyramid *.vrt
266+
267+
$ file 1:
268+
$ /data/europe/stm/mosaic
269+
$ 2018-2018_001-365_HL_TSA_LNDLG_RED_STM_Q50.vrt
270+
$ 9000 4000 1
271+
$ file 2:
272+
$ /data/europe/stm/mosaic
273+
$ 2018-2018_001-365_HL_TSA_LNDLG_NIR_STM_Q50.vrt
274+
$ 9000 4000 1
275+
$ file 3:
276+
$ /data/europe/stm/mosaic
277+
$ 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q50.vrt
278+
$ 9000 4000 1
279+
$
280+
$ Same number of bands detected. Stacking by band.
281+
$
282+
$ Band 0001: 2018-2018_001-365_HL_TSA_LNDLG_RED_STM_Q50.vrt band 1
283+
$ Band 0002: 2018-2018_001-365_HL_TSA_LNDLG_NIR_STM_Q50.vrt band 1
284+
$ Band 0003: 2018-2018_001-365_HL_TSA_LNDLG_SW1_STM_Q50.vrt band 1
285+
$
286+
$ file 1:
287+
$ /data/europe/stm/mosaic
288+
$ 2018-2018_001-365_HL_TSA_LNDLG_NDB_STM_Q90.vrt
289+
$ 9000 4000 1
290+
$ file 2:
291+
$ /data/europe/stm/mosaic
292+
$ 2018-2018_001-365_HL_TSA_LNDLG_NDV_STM_Q90.vrt
293+
$ 9000 4000 1
294+
$ file 3:
295+
$ /data/europe/stm/mosaic
296+
$ 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q90.vrt
297+
$ 9000 4000 1
298+
$
299+
$ Same number of bands detected. Stacking by band.
300+
$
301+
$ Band 0001: 2018-2018_001-365_HL_TSA_LNDLG_NDB_STM_Q90.vrt band 1
302+
$ Band 0002: 2018-2018_001-365_HL_TSA_LNDLG_NDV_STM_Q90.vrt band 1
303+
$ Band 0003: 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q90.vrt band 1
304+
$
305+
$ computing pyramids for 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q10.vrt
306+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
307+
$ computing pyramids for 2018-2018_001-365_HL_TSA_LNDLG_MNW_STM_Q25.vrt
308+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
309+
$ ...
310+
$ computing pyramids for stack-bands-STM_Q50.vrt
311+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
312+
$ computing pyramids for stack-indices-STM_Q90.vrt
313+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
305314
306315
307316
.. figure:: img/tutorial-stm-qgis.jpg

0 commit comments

Comments
 (0)