0

From the following NDVI collection, I want to keep only the observations with Good Quality (equal to zero). I try to do this with the SummaryQA but I get "Pattern 'SummaryQA' did not match any bands". My attempt:

var geometry = /* color: #0b4a8b */ee.Geometry.Polygon(
  [[[110.49279650854476, 39.617434795765476],
    [111.02014025854476, 36.57484614339866],
    [117.48010119604476, 36.92695433193529],
    [117.43615588354476, 40.35816406661026]]]),modis =ee.ImageCollection("MODIS/006/MOD13Q1")
    .filterBounds(geometry)
    .map(function(image){return image.clip(geometry)}) 
    .filter(ee.Filter.calendarRange(4,7,'month'));
    var modisNDVI = modis.select("NDVI");

    var maskQA = function(image) {
      return image.updateMask(image.select("SummaryQA").eq(0));
    };
    var best = modisNDVI.map(maskQA)
    print(best)

1 Answer 1

1

When you select NDVI band, you are only keeping that band, so you cannot use other band.

Replace

var modisNDVI = modis.select("NDVI");

with

var modisNDVI = modis.select(["NDVI", "SummaryQA"]);
4
  • Thank you @Rodrigo. In this case though, when I try to perform a batch download of the best collection, I get "Failed to decode JSON. Error: Type must be one of: [compoundvalue, date, bytes, point, dictionary, function, invocation, multipoint, linestring, linearring, multilinestring, polygon, multipolygon, geometrycollection, argumentref, valueref]. Object: "FeatureCollection"."
    – foo
    Commented Jan 21, 2019 at 13:39
  • how are you trying to batch download? Commented Jan 21, 2019 at 14:07
  • var batch = require('users/fitoprincipe/geetools:batch') batch.Download.ImageCollection.toDrive(best, "m_ar", {scale:250,region: geometry.getInfo()});
    – foo
    Commented Jan 21, 2019 at 14:08
  • try with geometry instead of geometry.getInfo() Commented Jan 21, 2019 at 15:31

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.