1

I'm new to GEE. I'm currently working on NDVI data analysis. So this is my code for MODIS Ndvi. I want to know how to divide all the images there inside ImageCollection by 10000 to get real NDVI values.

How do I get this work done?

{
var ndvi = ee.ImageCollection('MODIS/006/MOD13Q1');
var modisNDVI = ndvi.select('NDVI');
var collection = ee.ImageCollection(modisNDVI.filterDate('2017-07-01', '2018-12-31'));
var clipped = collection.mean().clip(fc)
}
1

You should create a custom function and map() over the collection:

var NDVI = function(image) {
  return image.expression('float(b("NDVI")/10000)')
};

var collection = ee.ImageCollection('MODIS/006/MOD13Q1');
var col = ee.ImageCollection(collection.filterDate('2017-07-01', '2018-12-31'));
var modisNDVI = col.map(NDVI);
var clipped = modisNDVI.mean().clip(fc)

Also, I changed the steps order (is better to filter a date range before to apply map())

  • Thanks @aldo_tapia. It worked but i try to create a time series chart. its not executing. Error generating chart: No features contain non-null values of "system:time_start". Code { print(ui.Chart.image.series(clipped, Phenology, ee.Reducer.mean(), 30)); } – Aravind S Nov 8 '18 at 6:20
  • @AravindS please, ask one question per post. You can open another thread to ask this – aldo_tapia Nov 8 '18 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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