Skip to content

Commit

Permalink
Edited and tested band naming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
clarype committed Sep 14, 2021
1 parent 5dd400b commit 8e38e0f
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 @@ -1185,7 +1185,7 @@ exports.getSegmentData = getSegmentData;
// GET A SERIES OF BANDS NAMES AS YEARS
var getYearBandNames = function(startYear, endYear){
var years = []; // make an empty array to hold year band names
for (var i = startYear; i <= endYear; ++i) years.push("yr_"i.toString()); // fill the array with years from the startYear to the endYear and convert them to string
for (var i = startYear; i <= endYear; ++i) years.push("yr_"+i.toString()); // fill the array with years from the startYear to the endYear and convert them to string
return years;
};
exports.getYearBandNames = getYearBandNames;
Expand Down Expand Up @@ -1250,7 +1250,7 @@ var getFittedRGBcol = function(lt, startYear, endYear, bands, visParams){
var r = getFittedData(lt, startYear, endYear, bands[0]);
var g = getFittedData(lt, startYear, endYear, bands[1]);
var b = getFittedData(lt, startYear, endYear, bands[2]);
var yearsStr = ee.List(ltgee.getYearBandNames(startYear, endYear))
var yearsStr = ee.List(getYearBandNames(startYear, endYear))
var rgbList = yearsStr.map(function(year){
return r.select([year]).addBands(g.select([year])).addBands(b.select([year])).rename(['R', 'G', 'B']);
});
Expand Down

0 comments on commit 8e38e0f

Please sign in to comment.