-
Notifications
You must be signed in to change notification settings - Fork 9
/
run_llr_template.js
89 lines (80 loc) · 2.79 KB
/
run_llr_template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// #############################################################################
// #############################################################################
// #############################################################################
/**
* 1. View WRS-1 granules - figure out what WRS-1 granule to process
* -- Make a processing dir: https://gist.github.com/jdbcode/36f5a04329d5d85c43c0408176c51e6d
* 2. Create MSS WRS-1 reference image - for MSS WRS1 to MSS WRS2 harmonization
* 3. View WRS-1 collection - identify bad MSS images
* 4. Prepare MSS WRS-1 images
* 5. Get TM-to-MSS correction coefficients
* 6. Export MSS-to-TM corrected images
* 7. Inspect the full time series collection - explore time series via animation and inspector tool to check for noise
* 8. Run LandTrendr and display the fitted collection on the map
* 9. Display the year and magnitude of the greatest disturbance during the time series
*/
var LLR_STEP = 1;
// #############################################################################
var PROJ_PATH = 'users/braaten/LandTrendr'; // Must be the same path used to create the asset folder - cannot contain / at end - check for this in the code.
var WRS_1_GRANULE = '049030';
var CRS = 'EPSG:3857';
var DOY_RANGE = [160, 254];
var MAX_CLOUD = 50;
var MAX_GEOM_RMSE = 0.5;
var EXCLUDE_IDS = [
'LM10490301972210AAA05',
'LM20490301975167AAA02',
'LM20490301975185AAA02',
'LM20490301976216GDS01',
'LM20490301976252GDS01',
'LM30490301978196GDS03',
'LM20490301978241AAA02',
'LM20490301979200AAA05',
'LM20490301981171AAA03'
];
// #############################################################################
// #############################################################################
// #############################################################################
var params = {
maxRmseVerify: MAX_GEOM_RMSE,
maxCloudCover: MAX_CLOUD,
doyRange: DOY_RANGE,
wrs1: WRS_1_GRANULE,
crs: CRS,
excludeIds: EXCLUDE_IDS,
baseDir: PROJ_PATH + '/' + WRS_1_GRANULE
};
var llr = require('users/jstnbraaten/modules:landsatlinkr/landsatlinkr.js');
switch (LLR_STEP) {
case 1:
llr.wrs1GranuleSelector();
break;
case 2:
llr.exportMssRefImg(params);
break;
case 3:
llr.viewWrs1Col(params);
break;
case 4:
llr.processMssWrs1Imgs(params);
break;
case 5:
llr.exportMss2TmCoefCol(params);
break;
case 6:
llr.exportFinalCorrectedMssCol(params);
break;
case 7:
var col = llr.getColForLandTrendrFromAsset(params);
llr.displayCollection(col);
llr.animateCollection(col);
break;
case 8:
var lt = llr.runLandTrendrMss2Tm(params);
//llr.displayFittedCollection() not built yet
break;
case 9:
var lt = llr.runLandTrendrMss2Tm(params);
llr.displayGreatestDisturbance(lt, params);
break;
}