Skip to content

Commit 20f1848

Browse files
committed
Merge branch 'develop' into main
2 parents 3bd8cda + de5e342 commit 20f1848

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4339
-2086
lines changed

.github/workflows/docker-publish-debug.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Docker-debug
22

33
on:
44
push:
5-
branches: [master, develop]
5+
branches: [main, develop]
66
release:
77
types: [published]
88
repository_dispatch:
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
3131
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
32-
[ "$VERSION" == "master" ] && VERSION=latest
32+
[ "$VERSION" == "main" ] && VERSION=latest
3333
[ "$VERSION" == "develop" ] && VERSION=dev
3434
echo VERSION=$VERSION
3535
echo DOCKER=$DOCKER_USER/$IMAGE_NAME:$VERSION-debug

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Docker
22

33
on:
44
push:
5-
branches: [master, develop]
5+
branches: [main, develop]
66
release:
77
types: [published]
88
repository_dispatch:
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
3131
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
32-
[ "$VERSION" == "master" ] && VERSION=latest
32+
[ "$VERSION" == "main" ] && VERSION=latest
3333
[ "$VERSION" == "develop" ] && VERSION=dev
3434
echo VERSION=$VERSION
3535
echo DOCKER=$DOCKER_USER/$IMAGE_NAME:$VERSION

ADD_INDEX.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# How to add a new spectral index to the TSA submodule
2+
3+
This page documents the steps that need to be taken to implement a new spectral index in force-tsa.
4+
Give it a try!
5+
6+
General remarks: please stick to the syntax and indendation etc. of the existing code.
7+
8+
1) create a new branch from develop
9+
10+
2) add a new enum
11+
12+
In src/cross-level/enum-cl.h: add a new enum before(!) _IDX_LENGTH_.
13+
Use a 3-digit ID that has not been used before, e.g. _IDX_XXX_ (replace XXX).
14+
15+
In src/cross-level/enum-cl.c: provide a dictionary item that can translate between the Index in the parameter file and the enum, e.g. { _IDX_XXX_, "MyNewIndex" }
16+
17+
Make sure that the added entries in both files are in the same order.
18+
19+
3) define band dependencies
20+
21+
In src/higher-level/param-hl.c, function check_bandlist():
22+
23+
- Add a new case clause by referencing the enum
24+
- enable the verification vector v[] for required wavelengths - this is needed to pre-check whether the index can be computed with a given set of sensors
25+
- choose a 3-digit ID for the filename - this should be the same ID as used for the enum
26+
27+
4) provide citation
28+
29+
In src/cross-level/cite-cl.h: add a new citation enum before(!) _CITE_LENGTH_.
30+
Use the same 3-digit ID as for the enum (if not already taken)
31+
32+
In src/cross-level/cite-cl.c: provide a dictionary item that holds the citation and the enum, as well as a bool variable that is initialized to false, e.g. { _IDX_XXX_, "Author, A. (2042). Fancy New Index. Remote Sensing of Environment", false }. Stick to the syntax of the other entries. Make sure that the added entries in both files are in the same order.
33+
34+
4) implement index
35+
36+
In src/higher-level/index-hl.c, function tsa_spectral_index():
37+
38+
- Add a new case clause by referencing the enum
39+
- cite the paper by using the cite enum
40+
- use one of the provided function templates if your new index matches one of those (e.g. use index_differenced() for an NDVI-like index). If this is the case, you are done with coding and can skip the next step.
41+
- provide a new function. Try to make it as generic as possible to enable other indices that use the same formulation (but just different bands or factors). Try to understand how the other functions work before doing this.
42+
43+
5) test whether the code compiles
44+
45+
6) make a test run (check that scaling and quantization is OK!)
46+
47+
7) submit a pull request on Github

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If asking a question, please tell us who you are, and what your background is.
2020
And super-important, please report back whether the answer was helpful, and make sure to mark useful responses as ``answered``.
2121

2222
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
23-
For more information, see our [code of conduct](https://github.com/davidfrantz/force/blob/master/CODE_OF_CONDUCT.md).
23+
For more information, see our [code of conduct](https://github.com/davidfrantz/force/blob/main/CODE_OF_CONDUCT.md).
2424

2525
Contributors should ideally subscribe to these channels and follow them in order to keep up to date on what's happening in FORCE.
2626
Answering questions is an excellent and visible way to help our community, and also demonstrates your expertise.
@@ -115,5 +115,5 @@ if (a > 0){
115115
New files must include the appropriate license header boilerplate and the author name(s) and contact email(s).
116116

117117
Please pay special attention to citing research and properly acknowledging code that you may adapt for inclusion in FORCE.
118-
See this [example](https://github.com/davidfrantz/force/blob/master/src/lower-level/equi7-ll.c).
119-
If applicable, make use of the [citeme](https://github.com/davidfrantz/force/blob/master/src/cross-level/cite-cl.c) functionality, e.g. ``cite_me(_CITE_EQUI7_);``
118+
See this [example](https://github.com/davidfrantz/force/blob/main/src/lower-level/equi7-ll.c).
119+
If applicable, make use of the [citeme](https://github.com/davidfrantz/force/blob/main/src/cross-level/cite-cl.c) functionality, e.g. ``cite_me(_CITE_EQUI7_);``

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ TA=temp-aux
108108
### TARGETS
109109

110110
all: temp cross lower higher aux exe
111-
cross: string_cl enum_cl cite_cl utils_cl alloc_cl brick_cl imagefuns_cl param_cl date_cl datesys_cl lock_cl cube_cl dir_cl stats_cl pca_cl tile_cl queue_cl warp_cl sun_cl quality_cl sys_cl konami_cl download_cl read_cl
111+
cross: string_cl enum_cl cite_cl utils_cl alloc_cl brick_cl imagefuns_cl param_cl date_cl datesys_cl lock_cl cube_cl dir_cl stats_cl pca_cl tile_cl queue_cl warp_cl sun_cl quality_cl sys_cl konami_cl download_cl read_cl gdalopt_cl
112112
lower: table_ll param_ll meta_ll cube_ll equi7_ll glance7_ll atc_ll sunview_ll read_ll radtran_ll topo_ll cloud_ll gas_ll brdf_ll atmo_ll aod_ll resmerge_ll coreg_ll coregfuns_ll acix_ll modwvp_ll
113113
higher: param_hl progress_hl tasks_hl read-aux_hl read-ard_hl quality_hl bap_hl level3_hl cso_hl tsa_hl index_hl interpolate_hl stm_hl fold_hl standardize_hl pheno_hl polar_hl trend_hl ml_hl texture_hl lsm_hl lib_hl sample_hl imp_hl cfimp_hl l2imp_hl spec-adjust_hl pyp_hl udf_hl
114114
aux: param_aux param_train_aux train_aux
@@ -195,6 +195,9 @@ download_cl: temp $(DC)/download-cl.c
195195
read_cl: temp $(DC)/read-cl.c
196196
$(GCC) $(CFLAGS) -c $(DC)/read-cl.c -o $(TC)/read_cl.o
197197

198+
gdalopt_cl: temp $(DC)/gdalopt-cl.c
199+
$(GCC) $(CFLAGS) -c $(DC)/gdalopt-cl.c -o $(TC)/gdalopt_cl.o
200+
198201

199202
### LOWER LEVEL COMPILE UNITS
200203

README.md

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

33
**Framework for Operational Radiometric Correction for Environmental monitoring**
44

5-
**Version 3.7.7**
5+
**Version 3.7.8**
66

77
![FORCE Logo](/images/force.png)
88

bash/force-cube.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Usage: $PROG [-hvirsantobj] input-file(s)
6464
-v = show version
6565
-i = show program's purpose
6666
-r = resampling method
67-
any GDAL resampling method for raster data, e.g. cubic (default)
67+
any GDAL resampling method for raster data, e.g. near (default)
6868
is ignored for vector data
6969
-s = pixel resolution of cubed data, defaults to 10
7070
-a = optional attribute name for vector data. $PROG will burn these values
@@ -148,12 +148,15 @@ function cubethis(){
148148
echoerr "rasterizing failed."; exit 1
149149
fi
150150

151-
MAX=$($RASTER_INFO_EXE -stats "$FOUT" | grep Maximum | head -n 1 | sed 's/[=,]/ /g' | tr -s ' ' | cut -d ' ' -f 5 | sed 's/\..*//' )
151+
VALID=$($RASTER_INFO_EXE -stats "$FOUT" 2>/dev/null | grep STATISTICS_VALID_PERCENT | sed 's/ //g; s/[=,]/ /g' | cut -d ' ' -f2 | awk '{sum +=$1} END {print sum != 0}' )
152152
rm "$FOUT.aux.xml"
153-
debug "max: $MAX"
153+
debug "valid: $VALID"
154154

155-
if [ $MAX -lt 1 ]; then
155+
if [ $VALID -eq 0 ]; then
156156
rm "$FOUT"
157+
if [ -z "$(ls -A "$DOUT/$TILE")" ]; then
158+
rmdir "$DOUT/$TILE"
159+
fi
157160
exit 1
158161
fi
159162

@@ -175,6 +178,19 @@ function cubethis(){
175178
echoerr "warping failed."; exit 1
176179
fi
177180

181+
VALID=$($RASTER_INFO_EXE -stats "$FOUT" 2>/dev/null | grep STATISTICS_VALID_PERCENT | sed 's/ //g; s/[=,]/ /g' | cut -d ' ' -f2 | awk '{sum +=$1} END {print sum != 0}' )
182+
rm "$FOUT.aux.xml"
183+
debug "valid: $VALID"
184+
185+
if [ $VALID -eq 0 ]; then
186+
rm "$FOUT"
187+
if [ -z "$(ls -A "$DOUT/$TILE")" ]; then
188+
rmdir "$DOUT/$TILE"
189+
fi
190+
exit 1
191+
fi
192+
193+
178194
if [ "$EXIST" == "true" ]; then
179195
debug "building mosaic"
180196
mv "$DOUT/$TILE/$COUT.tif" "$DOUT/$TILE/$COUT'_TEMP1.tif'"
@@ -200,7 +216,7 @@ ARGS=`getopt -o hvir:s:o:b:j:a:n:t:l: --long help,version,info,resample:,resolut
200216
if [ $? != 0 ] ; then help; fi
201217
eval set -- "$ARGS"
202218

203-
RESAMPLE="cubic"
219+
RESAMPLE="near"
204220
RES=10
205221
DOUT=$PWD
206222
BASE="DEFAULT"

bash/force-level1-csd.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ if [ $# -ne 4 ]; then
223223
fi
224224

225225
which_satellite
226+
if [ $LANDSAT -eq 1 ]; then
227+
printf "%s\n" "" "Warning: Google Cloud Storage only hosts Landsat Collection 1 data." "It is strongly recommended to use Collection 2 data: https://www.usgs.gov/landsat-missions/landsat-collection-2" "Collection 2 data is provided by the USGS, you may use https://github.com/ernstste/landsatlinks to query the catalogue and create download links."
228+
fi
226229

227230
# ============================================================
228231
# Check user input and set up variables
@@ -350,7 +353,7 @@ if [ -z $AOITYPE ]; then
350353
if $(echo $ENTRY | grep -q -E "[0-2][0-9]{2}[0-2][0-9]{2}"); then
351354
LSPATH="${ENTRY:0:3}"
352355
LSROW="${ENTRY:3:6}"
353-
if [ $(is_in_range $LSPATH 1 233) -eq 0 ] || [ $(is_in_range $LSPATH 1 248) -eq 0 ]; then
356+
if [ $(is_in_range $LSPATH 1 233) -eq 0 ] || [ $(is_in_range $LSROW 1 248) -eq 0 ]; then
354357
show_help "$(printf "%s\n " "Landsat PATH / ROW out of range. PATH not in range 1 to 233 or ROW not in range 1 to 248." "PATH / ROW received: $ENTRY")"
355358
fi
356359
continue

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sphinx==4.2.0
22
sphinx_rtd_theme==0.5.1
3+
docutils==0.16

docs/source/components/auxilliary/index.rst

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,36 @@ 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-
+--------+------------------------+-------+---------------------------------------------------------+
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-procmask | / | Generate a processing mask from continuous data |
26+
+--------+---------------------+-------+---------------------------------------------------------+
27+
| | force-pyramid | / | Generation of image pyramids |
28+
+--------+---------------------+-------+---------------------------------------------------------+
29+
| | force-mosaic | / | Mosaicking of image chips |
30+
+--------+---------------------+-------+---------------------------------------------------------+
31+
| | force-synthmix | / | Synthetic mixing of training data |
32+
+--------+---------------------+-------+---------------------------------------------------------+
33+
| | force-stack | | Stack images, works with 4D data model |
34+
+--------+---------------------+-------+---------------------------------------------------------+
35+
| | force-mdcp | | Copy FORCE metadata from one file to another |
36+
+--------+---------------------+-------+---------------------------------------------------------+
37+
2938

3039

3140

0 commit comments

Comments
 (0)