venerdì 6 marzo 2026

NRDE

 

 

 

 

Questa e' una estensione di questo post usando come parametro indice NRDE al posto di NDVI. Questo indice puo'essere calcolato per Sentinel 2 ma non per Landsat e per questo motivo la serie storica e' ridotta ad un decennio 

 

NRDE = (NIR-RedEdge)/(Nir+RedEdge) 

// 1. Coordinate e Geometria
var lon = 10.926468160041452;
var lat = 43.01919548868449;
var poi = ee.Geometry.Point([lon, lat]);

// 2. Funzione di pre-elaborazione per Sentinel-2
function preprocessSentinel2(image) {
  var qa = image.select('QA60');

  // Maschera per nuvole e cirri
  var cloudBitMask = 1 << 10;
  var cirrusBitMask = 1 << 11;
  var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
      .and(qa.bitwiseAnd(cirrusBitMask).eq(0));

  // Scaling (Sentinel-2 Surface Reflectance)
  var opticalBands = image.divide(10000);
  
  // Calcolo NDRE 
  // NIR = B8, Red Edge = B5 (prima banda red-edge di Sentinel-2)
  var ndre = opticalBands.normalizedDifference(['B8', 'B5']).rename('NDRE');
  
  return image.addBands(ndre).updateMask(mask);
}

// 3. Caricamento Collezione Sentinel-2 (Disponibile dal 2015/2017)
var s2Col = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
  .filterBounds(poi)
  .filterDate('2017-01-01', '2026-01-01') // Sentinel-2 SR data standard
  .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
  .map(preprocessSentinel2);

// 4. Creazione del Grafico Temporale
var chart = ui.Chart.image.series({
  imageCollection: s2Col.select('NDRE'),
  region: poi,
  reducer: ee.Reducer.mean(),
  scale: 20, // Sentinel-2 Red Edge è a 20m
  xProperty: 'system:time_start'
})
.setOptions({
  title: 'Serie Storica NDRE: Sentinel-2 (2017-2026)',
  vAxis: {title: 'NDRE', viewWindow: {min: -0.1, max: 1}},
  hAxis: {title: 'Anno', format: 'YYYY'},
  lineWidth: 1,
  pointSize: 2,
  trendlines: {0: {color: 'blue', lineWidth: 1, opacity: 0.7}},
  series: {
    0: {color: '006400'} // Verde scuro
  }
});

// 5. Visualizzazione
print(chart);
Map.centerObject(poi, 13);
Map.addLayer(poi, {color: 'red'}, 'Sito di analisi'); 

Nessun commento:

Posta un commento

NRDE

        Questa e' una estensione di questo post usando come parametro indice NRDE al posto di NDVI. Questo indice puo'essere calcola...