Skip to content

Commit 11cd216

Browse files
committed
Merge branch 'develop'
2 parents ab7ced1 + a69240f commit 11cd216

32 files changed

+778
-57
lines changed

.readthedocs.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# File: .readthedocs.yaml
2+
3+
version: 2
4+
5+
sphinx:
6+
configuration: docs/source/conf.py
7+
8+
python:
9+
version: 3.7
10+
install:
11+
- requirements: docs/requirements.txt

bash/force-level1-csd.sh

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ if [ -f $AOI ]; then
295295
AOI=$(cat $AOI | sed 's/,/./g')
296296
OGR=0
297297
fi
298-
# if aoi is not a file, it's a polygon or tile list as cmd line input
298+
# if aoi is not a file, it's a point, polygon or tile list as cmd line input
299299
else
300300
AOI=$(echo $AOI | sed 's/,/ /g')
301301
OGR=0
@@ -310,15 +310,23 @@ if [ $OGR -eq 0 ]; then
310310
if ! $(echo $COORD | grep -q "/"); then
311311
show_help "$(printf "%s\n " "At least one of the AOI coordinates does not seem to be separated by a forward slash /" "Coordinate: $COORD")"
312312
fi
313-
LAT=$(echo $COORD | cut -d"/" -f1)
314-
LON=$(echo $COORD | cut -d"/" -f2)
313+
LAT=$(echo $COORD | cut -d"/" -f2)
314+
LON=$(echo $COORD | cut -d"/" -f1)
315315

316316
if ! [ $(is_in_range $LAT -90 90) -eq 1 ]; then
317317
show_help "$(printf "%s\n " "Latitude out of range" "Coordinate: $COORD - $LAT is not in range -90 to 90" "This error may also mean that you tried to use a vector file as AOI but provided an incorrect path")"
318318
elif ! [ $(is_in_range $LON -180 180) -eq 1 ]; then
319319
show_help "$(printf "%s\n " "Longitute out of range" "Coordinate: $COORD - $LON is not in range -180 to 180")"
320320
fi
321321
done
322+
# were the right number of coordinate pairs provided?
323+
if [ $(echo $AOI | grep -o "/" | wc -l) -eq 1 ]; then
324+
GEOMETRY="POINT"
325+
elif [ $(echo $AOI | grep -o "/" | wc -l) -gt 1 ] && [ $(echo $AOI | grep -o "/" | wc -l) -lt 4 ]; then
326+
show_help "$(printf "%s\n " "Wrong number of AOI coordinate pairs provided" "When defining a point use one coordinate pair only." "Use at least four coordinate pairs to define a polygon (last pair must be the same as the first pair).")"
327+
else
328+
GEOMETRY="POLYGON"
329+
fi
322330
# else, AOI input must be tile list - check if tiles are valid Path/Row or S2 tiles
323331
else
324332
AOITYPE=3
@@ -374,6 +382,7 @@ get_data() {
374382
printf "%s\n" "" "WARNING: The selected time window exceeds the last update of the $PRINTNAME metadata catalogue." "Results may be incomplete, please consider updating the metadata catalogue using the -u option."
375383
fi
376384

385+
# AOI is shapefile, get tiles/footprints from WFS server
377386
if [ "$AOITYPE" -eq 1 ]; then
378387
printf "%s\n" "" "Searching for footprints / tiles intersecting with geometries of AOI shapefile..."
379388
OGRTEMP="$POOL"/l1csd-temp_$(date +%FT%H-%M-%S-%N)
@@ -392,13 +401,19 @@ get_data() {
392401
TILES="_"$(echo $TILERAW | sed 's/ /_|_/g')"_"
393402
rm -rf "$OGRTEMP"
394403

404+
# AOI is coordinate pairs, get tiles/footprints from WFS server
395405
elif [ "$AOITYPE" -eq 2 ]; then
396-
printf "%s\n" "" "Searching for footprints / tiles intersecting with input geometry..."
406+
printf "%s\n" "" "Searching for footprints / tiles intersecting with input geometry..." "Geometry type: "$GEOMETRY
397407
WKT=$(echo $AOI | sed 's/ /%20/g; s/\//,/g')
398-
WFSURL="http://ows.geo.hu-berlin.de/cgi-bin/qgis_mapserv.fcgi?MAP=/owsprojects/grids.qgs&SERVICE=WFS&REQUEST=GetFeature&typename="$SATELLITE"&Filter=%3Cogc:Filter%3E%3Cogc:Intersects%3E%3Cogc:PropertyName%3Eshape%3C/ogc:PropertyName%3E%3Cgml:Polygon%20srsName=%22EPSG:4326%22%3E%3Cgml:outerBoundaryIs%3E%3Cgml:LinearRing%3E%3Cgml:coordinates%3E"$WKT"%3C/gml:coordinates%3E%3C/gml:LinearRing%3E%3C/gml:outerBoundaryIs%3E%3C/gml:Polygon%3E%3C/ogc:Intersects%3E%3C/ogc:Filter%3E"
399-
TILERAW=$(ogr2ogr -f CSV /vsistdout/ -select "PRFID" WFS:"$WFSURL")
408+
if [ "$GEOMETRY" = "POINT" ]; then
409+
WFSURL="http://ows.geo.hu-berlin.de/cgi-bin/qgis_mapserv.fcgi?MAP=/owsprojects/grids.qgs&SERVICE=WFS&REQUEST=GetFeature&typename="$SATELLITE"&Filter=%3Cogc:Filter%3E%3Cogc:Intersects%3E%3Cogc:PropertyName%3Eshape%3C/ogc:PropertyName%3E%3CLiteral%3E%3Cgml:Point%20srsName=%22EPSG:4326%22%3E%3Cgml:coordinates%3E"$WKT"%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Literal%3E%3C/ogc:Intersects%3E%3C/ogc:Filter%3E"
410+
elif [ "$GEOMETRY" = "POLYGON" ]; then
411+
WFSURL="http://ows.geo.hu-berlin.de/cgi-bin/qgis_mapserv.fcgi?MAP=/owsprojects/grids.qgs&SERVICE=WFS&REQUEST=GetFeature&typename="$SATELLITE"&Filter=%3Cogc:Filter%3E%3Cogc:Intersects%3E%3Cogc:PropertyName%3Eshape%3C/ogc:PropertyName%3E%3Cgml:Polygon%20srsName=%22EPSG:4326%22%3E%3Cgml:outerBoundaryIs%3E%3Cgml:LinearRing%3E%3Cgml:coordinates%3E"$WKT"%3C/gml:coordinates%3E%3C/gml:LinearRing%3E%3C/gml:outerBoundaryIs%3E%3C/gml:Polygon%3E%3C/ogc:Intersects%3E%3C/ogc:Filter%3E"
412+
fi
413+
TILERAW=$(ogr2ogr -f CSV /vsistdout/ -select "PRFID" WFS:"$WFSURL" | sed 's/"//g')
400414
TILES="_"$(echo $TILERAW | sed 's/PRFID, //; s/ /_|_/g')"_"
401415

416+
# AOI is tile list
402417
elif [ "$AOITYPE" -eq 3 ]; then
403418
sensor_tile_mismatch() {
404419
printf "%s\n" "" "Error: $PRINTNAME sensor(s) specified, but no $PRINTNAME tiles identified." "Check if sensors and footprints match or use the -s option to specify sensors to query." ""

bash/force-tile-extent.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cp $DIR/datacube-definition.prj $TMP/datacube-definition.prj
6363

6464
# generate masks, use force-cube version relative to this program
6565
BINDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
66-
$BINDIR"/"force-cube $INP $TMP rasterize 10 &> /dev/null
66+
$BINDIR"/"force-cube -s 10 -o $TMP -b force-extent $INP &> /dev/null
6767

6868

6969
WD=$PWD

docs/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx==4.2.0
2+
sphinx_rtd_theme==0.5.1

docs/source/components/auxilliary/extent.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
force-extent
5-
==========
5+
============
66

77
...
88

docs/source/components/auxilliary/index.rst

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@ Auxiliary
55

66
**Table 1.** Components.
77

8-
+--------+------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
9-
| Module | Program | Level | Short description |
10-
+========+========================+=======+=============================================================================================================================================================================================================================+
11-
| AUX | force | / | Print version, short disclaimer, available modules etc. |
12-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
13-
| | force-parameter | / | Generation of parameter files |
14-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
15-
| | force-train | / | Training (and validation) of Machine Learning models |
16-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
17-
| | force-qai-inflate | / | Inflate QAI bit layers |
18-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
19-
| | force-tile-finder | / | Find the tile, pixel, and chunk of a given coordinate |
20-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
21-
| | force-tabulate-grid | / | Extract the processing grid as shapefile |
22-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
23-
| | force-cube | / | Ingestion of auxiliary data into datacube format |
24-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
25-
| | force-pyramid | / | Generation of image pyramids |
26-
+ +------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
27-
| | force-mosaic | / | Mosaicking of image chips |
28-
+--------+------------------------+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
29-
8+
+--------+------------------------+-------+---------------------------------------------------------+
9+
| Module | Program | Level | Short description |
10+
+========+========================+=======+=========================================================+
11+
| AUX | force | / | Print version, short disclaimer, available modules etc. |
12+
+ +------------------------+-------+---------------------------------------------------------+
13+
| | force-parameter | / | Generation of parameter files |
14+
+ +------------------------+-------+---------------------------------------------------------+
15+
| | force-train | / | Training (and validation) of Machine Learning models |
16+
+ +------------------------+-------+---------------------------------------------------------+
17+
| | force-qai-inflate | / | Inflate QAI bit layers |
18+
+ +------------------------+-------+---------------------------------------------------------+
19+
| | force-tile-finder | / | Find the tile, pixel, and chunk of a given coordinate |
20+
+ +------------------------+-------+---------------------------------------------------------+
21+
| | force-tabulate-grid | / | Extract the processing grid as shapefile |
22+
+ +------------------------+-------+---------------------------------------------------------+
23+
| | force-cube | / | Ingestion of auxiliary data into datacube format |
24+
+ +------------------------+-------+---------------------------------------------------------+
25+
| | force-pyramid | / | Generation of image pyramids |
26+
+ +------------------------+-------+---------------------------------------------------------+
27+
| | force-mosaic | / | Mosaicking of image chips |
28+
+--------+------------------------+-------+---------------------------------------------------------+
3029

3130

3231

docs/source/components/auxilliary/mosaic.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
.. _aux-mosaic:
22

33
force-mosaic
4-
==========
4+
============
55

66
force-mosaic creates a `GDAL virtual format <https://gdal.org/drivers/raster/vrt.html>`_-file for each FORCE product found in ``datacube-dir``. This function is agnostic to the processing level of the data found and identifies corresponding bands in different tiles by their base names.
77

8-
Using VRTs eases the visualization of large study areas by virtually linking the respective files in multiple tiles (i. e. directories) together. Additionally, the output can be :ref:`stacked <>` and :ref:`overviews generated <aux-pyramid>`.
8+
Using VRTs eases the visualization of large study areas by virtually linking the respective files in multiple tiles (i. e. directories) together.
9+
Additionally, the output can be stacked (site missing) and :ref:`overviews generated <aux-pyramid>`.
910

1011
Usage
1112
^^^^^
1213

1314
.. note::
1415
In FORCE <= 3.6.5 only the ``datacube-dir`` could be specified as parameter.
1516

16-
.. code:: bash
17+
.. code-block:: none
1718
1819
force-mosaic [-h] [-v] [-i] [-j] [-m] datacube-dir
1920

docs/source/components/auxilliary/parameter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _aux-parameter:
22

33
force-parameter
4-
==========
4+
===============
55

66
force-parameter generates parameter file skeletons for each FORCE module. The skeletons also contain more in depth
77
descriptions for each parameter, and supported parameter values/ranges. The descriptions can be turned off to generate
@@ -15,7 +15,7 @@ Usage
1515
force-parameter [-h] [-v] [-i] [-m] [-c] parameter-file module
1616
1717
optional arguments
18-
"""""""""""""""""""
18+
""""""""""""""""""
1919

2020
* ``-h`` show help page
2121

docs/source/components/auxilliary/pyramid.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
force-pyramid
5-
==========
5+
=============
66

77
Usage
88
^^^^^

docs/source/components/higher-level/cfi/format.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ Following 21-digit naming convention is applied to all output files:
7676

7777
Digits 1–4 Year
7878
Digits 6–13 Processing Type
79-
IMPROPHE
79+
IMPROPHE
8080
Digits 15–17 Product Tag
8181
XXX These custom3-digit tags are specified in the parameter file
8282
Digits 19–21 File extension
83-
tif image data in compressed GeoTiff format
84-
dat image data in flat binary ENVI format
85-
hdr metadata
83+
tif image data in compressed GeoTiff format
84+
dat image data in flat binary ENVI format
85+
hdr metadata
8686

8787
File format
8888
The data are provided in compressed GeoTiff or flat binary ENVI Standard format. Each dataset consists of an image dataset (.tif/.dat) and metadata (.hdr). The image data have signed 16bit datatype. Each predicted image is stored as separate file.

0 commit comments

Comments
 (0)