1

I am writing a short script that will be used to chart thermal anomalies (FIRMS) by year for a given boundary.

The following code will achieve this...

var  now = new Date()

// IMPORT MODIS ACTIVE FIRE TIME SERIES
var FIRMS = ee.ImageCollection('FIRMS')
  .select('T21').filterDate('2019-01-01',now)
  
// ISOLATE AREA OF INTEREST
var Leon = SE_Counties.filterMetadata('NAME','equals','Leon')
print(Leon)

// TIME SERIES CHART
var options = {
    title: 'MODIS Thermal Anomalies for Leon County, FL',
    fontSize: 12,
    hAxis: {},
    vAxis: {title: 'Pixel Count', viewWindow: {min: 0}},
    //legend: {position: 'none'},
};
   
var chart = ui.Chart.image.doySeriesByYear(FIRMS, 'T21', Leon, ee.Reducer.count(), 1000).setOptions(options);
print(chart)

enter image description here However I am also interested in plotting thermal anomalies cumulatively like this.. enter image description here

I checked out this example (Iterating over an ImageCollection) but I couldn't figure out how to customize the code to work with my data.

What would be a solution for this?

1 Answer 1

0

Not sure if this is going to work for large imageCollections but iterating of the dates and creating a new sum for each date might work:

var cummulative = dates.map(function(d){
  
  var selectedImages = FIRMS.filterDate('2018-12-31', d)
  
  var sumPeriod = selectedImages.reduce(ee.Reducer.sum())

  var sumArea = ee.Dictionary(ee.Algorithms.If(sumPeriod.bandNames(), 
              sumPeriod.reduceRegion(ee.Reducer.sum(),Leon, 300), {'T21_sum':0}))
  
  return ee.Feature(null, sumArea).set('date', d)
})
print(cummulative, 'cummulative')

https://code.earthengine.google.com/cddeedb7de9be393d5df78ea2b68729b

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.