0

Old code:

var L5_EVI2= function(image) { 
var evi2 = image.expression( '2.5 * ((NIR - RED) / (NIR + 2.4 * RED + 1))', 
{ 
'NIR': image.select('B4'), 'RED': image.select('B3') 
} 
).rename('EVI2');
var L5_SR1 = ee.ImageCollection("LANDSAT/LT05/C01/T1_SR")
    .filterDate('1986-01-01', '1999-12-31') 
    .filter(ee.Filter.lt('CLOUD_COVER',30))
    .select(['B3','B4','pixel_qa'])
    .filterBounds(shpMask); 

New code

var L5_EVI2= function(image) { 
var evi2 = image.expression( '2.5 * ((NIR - RED) / (NIR + 2.4 * RED + 1))', 
{ 
'NIR': image.select('SR_B4'), 'RED': image.select('SR_B3') 
} 
).rename('EVI2');
var L5_SR1 = ee.ImageCollection("LANDSAT/LT05/C02/T1_L2")
    .filterDate('1986-01-01', '1999-12-31') 
    .filter(ee.Filter.lt('CLOUD_COVER',30))
    .select(['SR_B3','SR_B4','QA_PIXEL'])
    .filterBounds(shpMask); 

Why do I have different EVI2 results calculated for the same region after going from collection 1 to collection 2? I only changed the corresponding band name and dataset name. The other code was not changed.

3
  • Your code is incomplete
    – Vince
    Commented Jun 20 at 19:29
  • Please Edit the Question to contain an accurate code block. Comments are illegible for this purpose.
    – Vince
    Commented Jun 21 at 14:07
  • I re-edited the question and the code all works fine, the problem is that the results are different, I was just referring to the instructions for migrating from Landsat Acquisition 1 to Acquisition 2.
    – y hh
    Commented Jun 22 at 7:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.