Skip to content

Commit

Permalink
updated LandTrendr.js
Browse files Browse the repository at this point in the history
  • Loading branch information
clarype committed Sep 14, 2021
1 parent 6142c13 commit 5dd400b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LandTrendr.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ exports.version = '0.1.6';
var harmonizationRoy = function(oli) {
var slopes = ee.Image.constant([0.9785, 0.9542, 0.9825, 1.0073, 1.0171, 0.9949]); // RMA - create an image of slopes per band for L8 TO L7 regression line - David Roy
var itcp = ee.Image.constant([-0.0095, -0.0016, -0.0022, -0.0021, -0.0030, 0.0029]); // RMA - create an image of y-intercepts per band for L8 TO L7 regression line - David Roy
//var slopes = ee.Image.constant([0.885, 0.9317, 0.9372, 0.8339, 0.8639, 0.9165]); // least squares OLI to ETM+
//var itcp = ee.Image.constant([0.0183, 0.0123, 0.0123, 0.0448, 0.0306, 0.0116]); // least squares OLI to ETM+
//var slopes = ee.Image.constant([0.885, 0.9317, 0.9372, 0.8339, 0.8639, 0.9165]); // least squares OLI to ETM+
//var itcp = ee.Image.constant([0.0183, 0.0123, 0.0123, 0.0448, 0.0306, 0.0116]); // least squares OLI to ETM+
var y = oli.select(['B2','B3','B4','B5','B6','B7'],['B1', 'B2', 'B3', 'B4', 'B5', 'B7']) // select OLI bands 2-7 and rename them to match L7 band names
.resample('bicubic') // ...resample the L8 bands using bicubic
.subtract(itcp.multiply(10000)).divide(slopes) // ...multiply the y-intercept bands by 10000 to match the scale of the L7 bands then apply the line equation - subtract the intercept and divide by the slope
Expand Down

0 comments on commit 5dd400b

Please sign in to comment.