Skip to content

Commit 910b55a

Browse files
committed
updated TSI tutorial
1 parent a0feba0 commit 910b55a

File tree

1 file changed

+101
-103
lines changed

1 file changed

+101
-103
lines changed

docs/source/howto/tsi.rst

Lines changed: 101 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This tutorial introduces the Time Series Analysis (TSA) submodule of the FORCE H
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
Why interpolation?
@@ -78,24 +78,20 @@ Parameterfile
7878

7979
We start by generating an empty TSA parameterfile, and rename the file.
8080

81-
.. code-block:: bash
81+
.. code-block:: none
8282
8383
mkdir /data/europe/interpolation
84-
force-parameter /data/europe/interpolation TSA 1
85-
cd /data/europe/interpolation
86-
mv TSA-skeleton.prm tsi.prm
84+
force-parameter /data/europe/interpolation/tsi.prm TSA
8785
88-
TSA
89-
An empty parameter file skeleton was written to
90-
/data/europe/interpolation/TSA-skeleton.prm
91-
Note that all parameters need to be given, even though some may not be used
92-
with your specific parameterization.
93-
You should rename the file, e.g. my-first-TSA.prm.
94-
Parameterize according to your needs and run with
95-
force-higher-level /data/europe/interpolation/my-first-TSA.prm
86+
$ An empty parameter file skeleton was written to
87+
$ /data/europe/interpolation/tsi.prm
88+
$ Note that all parameters need to be given, even though some may not be used
89+
$ with your specific parameterization.
90+
$ Parameterize according to your needs and run with
91+
$ force-higher-level /data/europe/interpolation/tsi.prm
9692
9793
98-
If you prefer a more compact parameterfile without all the comments, use ``0`` instead of ``1`` as the last parameter.
94+
If you prefer a more compact parameterfile without all the comments, use the ``-c`` option.
9995
The full set of parameters is also documented here: :ref:`tsa-param`.
10096

10197

@@ -120,16 +116,16 @@ Analysis mask
120116
As we are only interested in the land surface - and there is a lot of water around Crete - we use a processing mask.
121117
Have a look at the :ref:`tut-mask` tutorial for further details.
122118

123-
.. code-block:: bash
119+
.. code-block:: none
124120
125121
mkdir -p /data/europe/masks
126122
cp /data/europe/level2/datacube-definition.prj -t /data/europe/masks
127-
force-cube /data/gis/admin/crete.gpkg /data/europe/masks rasterize 30
123+
force-cube -o /data/europe/mask -s 30 /data/gis/admin/crete.gpkg
128124
129-
0...10...20...30...40...50...60...70...80...90...100 - done.
130-
0...10...20...30...40...50...60...70...80...90...100 - done.
131-
0...10...20...30...40...50...60...70...80...90...100 - done.
132-
...
125+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
126+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
127+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
128+
$ ...
133129
134130
135131
In the parameterfile, use the masks like this:
@@ -167,17 +163,20 @@ There are different ways to obtain these values, e.g. by generating, and filteri
167163
The easiest way, however, is to use ``force-tile-extent`` with a vector geometry.
168164
Example for Crete, Greece:
169165

170-
.. code-block:: bash
166+
.. code-block:: none
171167
172-
force-tile-extent /data/gis/admin/crete.gpkg /data/europe/level2 /data/europe/interpolation/crete.txt
168+
force-tile-extent \
169+
/data/gis/admin/crete.gpkg \
170+
/data/europe/level2 \
171+
/data/europe/interpolation/crete.txt
173172
174-
Suggested Processing extent:
175-
X_TILE_RANGE = 103 111
176-
Y_TILE_RANGE = 101 105
177-
178-
Processing extent is not square.
179-
Suggest to use the tile allow-list:
180-
FILE_TILE = /data/europe/interpolation/crete.txt
173+
$ Suggested Processing extent:
174+
$ X_TILE_RANGE = 103 111
175+
$ Y_TILE_RANGE = 101 105
176+
$
177+
$ Processing extent is not square.
178+
$ Suggest to use the tile allow-list:
179+
$ FILE_TILE = /data/europe/interpolation/crete.txt
181180
182181
183182
Block size
@@ -186,7 +185,7 @@ Block size
186185
.. tip::
187186

188187
The block size is a parameter that you should only adjust if you are running in RAM-shortages.
189-
First, try the default value and dont worry*
188+
First, try the default value and don't worry*
190189

191190
However, if the program is *killed* by the system, this can be mitigated by adjusting ``BLOCK_SIZE``.
192191

@@ -210,7 +209,7 @@ By default, FORCE screens for nodata values, various cloud types, cloud shadows,
210209
211210
212211
In addition, recognizing that cloud masks are never perfect, TSA offers an outlier detection routine.
213-
This screens each pixels time series and might be used to remove undetected cloud, cloud shadow, or snow remnants.
212+
This screens each pixel's time series and might be used to remove undetected cloud, cloud shadow, or snow remnants.
214213

215214
The outlier detection is iteratively removing outliers until the time series noise is smaller than the given value.
216215
Note however: this method might also remove some *valid* data points, e.g. mowing events in intensively managed grasslands.
@@ -230,7 +229,7 @@ For our purpose, using this option is fine, thus, let's keep the default values:
230229
Temporal extent, Sensor, Index
231230
""""""""""""""""""""""""""""""
232231

233-
To eventually generate a long term animation, lets use 30 years of Landsat data:
232+
To eventually generate a long term animation, let's use 30 years of Landsat data:
234233

235234
.. code-block:: bash
236235
@@ -263,7 +262,7 @@ In order to generate a nice-looking and information-rich animation, we are using
263262
Interpolation
264263
"""""""""""""
265264

266-
Now, lets define the interpolation parameters.
265+
Now, let's define the interpolation parameters.
267266

268267
We wil be using the RBF interpolation to create a smoothed time series with 16-day interpolation steps.
269268

@@ -317,7 +316,7 @@ The progress bar will tell you how much time is spent for reading, computing, an
317316
This helps you identify if your job is e.g. input-limited.
318317
You might want to adjust the settings accordingly (also note that you may have more or less CPUs than me).
319318

320-
Please also note: fairly often, inexperienced users tend to overdo parallel reads/writes beyond a value that is reasonable - if reading/writing doesnt accelerate when you add more CPUs, this is likely the case (you might even slow down your job by overdoing I/O).
319+
Please also note: fairly often, inexperienced users tend to overdo parallel reads/writes beyond a value that is reasonable - if reading/writing doesn't accelerate when you add more CPUs, this is likely the case (you might even slow down your job by overdoing I/O).
321320

322321
.. code-block:: bash
323322
@@ -331,55 +330,55 @@ Processing
331330

332331
Processing is straightforward:
333332

334-
.. code-block:: bash
333+
.. code-block:: none
335334
336335
force-higher-level /data/europe/interpolation/tsi.prm
337336
338337
339-
number of processing units: 280
340-
(active tiles: 28, chunks per tile: 10)
341-
________________________________________
342-
Progress: 100.00%
343-
Time for I/C/O: 054%/037%/008%
344-
ETA: 00y 00m 00d 00h 00m 00s
345-
346-
________________________________________
347-
Real time: 00y 00m 00d 00h 58m 41s
348-
Virtual time: 00y 00m 00d 01h 32m 54s
349-
Saved time: 00y 00m 00d 00h 34m 13s
350-
351-
________________________________________
352-
Virtual I-time: 00y 00m 00d 00h 50m 30s
353-
Virtual C-time: 00y 00m 00d 00h 34m 31s
354-
Virtual O-time: 00y 00m 00d 00h 07m 53s
355-
356-
________________________________________
357-
I-bound time: 00y 00m 00d 00h 23m 42s
358-
C-bound time: 00y 00m 00d 00h 07m 10s
359-
O-bound time: 00y 00m 00d 00h 00m 26s
338+
$ number of processing units: 280
339+
$ (active tiles: 28, chunks per tile: 10)
340+
$ ________________________________________
341+
$ Progress: 100.00%
342+
$ Time for I/C/O: 054%/037%/008%
343+
$ ETA: 00y 00m 00d 00h 00m 00s
344+
$
345+
$ ________________________________________
346+
$ Real time: 00y 00m 00d 00h 58m 41s
347+
$ Virtual time: 00y 00m 00d 01h 32m 54s
348+
$ Saved time: 00y 00m 00d 00h 34m 13s
349+
$
350+
$ ________________________________________
351+
$ Virtual I-time: 00y 00m 00d 00h 50m 30s
352+
$ Virtual C-time: 00y 00m 00d 00h 34m 31s
353+
$ Virtual O-time: 00y 00m 00d 00h 07m 53s
354+
$
355+
$ ________________________________________
356+
$ I-bound time: 00y 00m 00d 00h 23m 42s
357+
$ C-bound time: 00y 00m 00d 00h 07m 10s
358+
$ O-bound time: 00y 00m 00d 00h 00m 26s
360359
361360
362361
After this, we do some postprocessing for simplified data handling, and to prepare the data for ingestion into the QGIS plugins.
363362

364363
First, we generate a mosaic:
365364

366-
.. code-block:: bash
365+
.. code-block:: none
367366
368367
force-mosaic /data/europe/interpolation
369368
370-
mosaicking 3 products:
371-
1 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.tif
372-
2 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.tif
373-
3 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.tif
374-
375-
mosaicking 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.tif
376-
27 chips found.
377-
378-
mosaicking 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.tif
379-
27 chips found.
380-
381-
mosaicking 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.tif
382-
27 chips found.
369+
$ mosaicking 3 products:
370+
$ 1 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.tif
371+
$ 2 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.tif
372+
$ 3 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.tif
373+
$
374+
$ mosaicking 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.tif
375+
$ 27 chips found.
376+
$
377+
$ mosaicking 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.tif
378+
$ 27 chips found.
379+
$
380+
$ mosaicking 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.tif
381+
$ 27 chips found.
383382
384383
385384
Then, we build a four-dimensional stack from the three tasseled cap components.
@@ -391,50 +390,49 @@ This data model is a prerequisite to the usage of the following QGIS plugins.
391390
For very long time series, ``force-stack`` still seems a bit slow - but at least it works...
392391

393392

394-
.. code-block:: bash
393+
.. code-block:: none
395394
396395
cd mosaic
397396
force-stack *TCB*TSI.vrt *TCG*TSI.vrt *TCW*TSI.vrt 4D-Tasseled-Cap-TSI.vrt
398397
399-
file 1:
400-
/data/europe/interpolation/mosaic
401-
1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt
402-
9000 4000 684
403-
file 2:
404-
/data/europe/interpolation/mosaic
405-
1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt
406-
9000 4000 684
407-
file 3:
408-
/data/europe/interpolation/mosaic
409-
1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt
410-
9000 4000 684
411-
412-
Same number of bands detected. Stacking by band.
413-
414-
Band 0001: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 1
415-
Band 0002: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 1
416-
Band 0003: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 1
417-
Band 0004: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 2
418-
Band 0005: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 2
419-
Band 0006: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 2
420-
Band 0007: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 3
421-
Band 0008: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 3
422-
Band 0009: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 3
423-
...
424-
Band 2050: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 684
425-
Band 2051: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 684
426-
Band 2052: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 684
398+
$ file 1:
399+
$ /data/europe/interpolation/mosaic
400+
$ 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt
401+
$ 9000 4000 684
402+
$ file 2:
403+
$ /data/europe/interpolation/mosaic
404+
$ 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt
405+
$ 9000 4000 684
406+
$ file 3:
407+
$ /data/europe/interpolation/mosaic
408+
$ 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt
409+
$ 9000 4000 684
410+
$
411+
$ Same number of bands detected. Stacking by band.
412+
$
413+
$ Band 0001: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 1
414+
$ Band 0002: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 1
415+
$ Band 0003: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 1
416+
$ Band 0004: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 2
417+
$ Band 0005: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 2
418+
$ Band 0006: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 2
419+
$ Band 0007: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 3
420+
$ Band 0008: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 3
421+
$ Band 0009: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 3
422+
$ ...
423+
$ Band 2050: 1990-2019_001-365_HL_TSA_LNDLG_TCB_TSI.vrt band 684
424+
$ Band 2051: 1990-2019_001-365_HL_TSA_LNDLG_TCG_TSI.vrt band 684
425+
$ Band 2052: 1990-2019_001-365_HL_TSA_LNDLG_TCW_TSI.vrt band 684
427426
428427
429428
For rapid display, we compute pyramids:
430429

431-
.. code-block:: bash
430+
.. code-block:: none
432431
433432
force-pyramid 4D-Tasseled-Cap-TSI.vrt
434433
435-
/data/europe/interpolation/mosaic/4D-Tasseled-Cap-TSI.vrt
436-
computing pyramids for 4D-Tasseled-Cap-TSI.vrt
437-
0...10...20...30...40...50...60...70...80...90...100 - done.
434+
$ computing pyramids for 4D-Tasseled-Cap-TSI.vrt
435+
$ 0...10...20...30...40...50...60...70...80...90...100 - done.
438436
439437
440438
Visualization

0 commit comments

Comments
 (0)