Modis product have range of value NDVI from -2000 to 10000, but I need this range of value modify on range from -0,2 to 1 This is my code for finding NDVI in region:

var California = ee.Feature(    // California.
    {label: 'California'});
var Utah = ee.Feature(  // Utah.
    {label: 'Utah'});
var Coloredo = ee.Feature(  // Coloredo.
    {label: 'Coloredo'});
var sites = new ee.FeatureCollection([California, Utah, Coloredo]);
var collection = ee.ImageCollection ('MODIS/MOD13Q1')

//function to create mask from SmmaryQA
var maskQA = function(image) {
  return image.updateMask(image.select("SummaryQA").eq(0));

var goodCollection = collection.map(maskQA)

//var nas= googCollection.multiply(0.00001)
//var evi1 = function(evi){
  //return evi.updateMask(goodCollection * 0.0001)
//var areaImageSqKm = goodCollection.multiply(0.00001);
//var fallowedArea = fallowed.multiply(areaImageSqKm);  
//var evi2 = collection.map(evi1)

var NDVITimeSeries = ui.Chart.image.seriesByRegion(
    goodCollection, sites, ee.Reducer.mean(),'NDVI', 5000, 'system:time_start', 'label')
          title: 'Temporal development of MODIS product',
          vAxis: {title: 'NDVI'},
          lineWidth: 1,
          pointSize: 1,


How do I recalculate the value range?

  • Why do you need to recalculate the range? You could just change the labels in your chart to read -0.2 to 1 instead of -2000 to 10000 and the rest of the chart would not change at all. – Kersten Jan 4 '17 at 9:06
  • You could improve this question by removing the commented out lines that are note relevant. – Tyler Erickson Feb 3 '17 at 23:19

You can add a new band with a rescaled NDVI values, by mapping a function over the collection:

// Add a rescaled NDVI band to each image in the collection.
goodCollection = goodCollection.map(
  function(img) {
    var rescaled_NDVI = img.select('NDVI')
    return img.addBands(rescaled_NDVI);

You will then need to update your charting code to use the new band:

var NDVITimeSeries = ui.Chart.image.seriesByRegion({
    imageCollection: goodCollection,
    regions: sites,
    reducer: ee.Reducer.mean(),
    band: 'NDVI_rescaled',
    scale: 5000,
    xProperty: 'system:time_start',
    seriesProperty: 'label'
      title: 'Temporal development of MODIS product',
      vAxis: {title: 'NDVI'},
      lineWidth: 1,
      pointSize: 1,

The scaling factor of 0.0001 was obtained from the USGS MOD13Q1 product page.

  • is it not possible in EE to directly change "in-place" a specific band of a multi-band image? It seems that would be very useful, instead of this create a new one + add it back approach? – Matifou Jul 22 '20 at 18:29

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.