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
# 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!)
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ If asking a question, please tell us who you are, and what your background is.
20
20
And super-important, please report back whether the answer was helpful, and make sure to mark useful responses as ``answered``.
21
21
22
22
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).
24
24
25
25
Contributors should ideally subscribe to these channels and follow them in order to keep up to date on what's happening in FORCE.
26
26
Answering questions is an excellent and visible way to help our community, and also demonstrates your expertise.
@@ -115,5 +115,5 @@ if (a > 0){
115
115
New files must include the appropriate license header boilerplate and the author name(s) and contact email(s).
116
116
117
117
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_);``
Copy file name to clipboardExpand all lines: bash/force-level1-csd.sh
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,9 @@ if [ $# -ne 4 ]; then
223
223
fi
224
224
225
225
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."
0 commit comments