ropensci / MODIStsp

An "R" package for automatic download and preprocessing of MODIS Land Products Time Series
https://docs.ropensci.org/MODIStsp
GNU General Public License v3.0
154 stars 50 forks source link

Quality Indicators #127

Closed dkhramov closed 6 years ago

dkhramov commented 6 years ago

Hi,

I use the MOD09Q1 product to get the NDVI time series and several quality indicators (cloud, land/water, snow). MODIStsp works fine. Thanks! But I have a question: have this QI masks already been applied to the resulting NDVI layers or not? If not, what package would you recommend to do this (may be some code examples or links).

Best regards, Dmitry Khramov

lbusett commented 6 years ago

@dkhramov

Hi. The quality indicator masks are not automatically applied. It is a functionality I plan to introduce, but did not find the time until now.

For the moment, the easiest way would be in my opinion to cycle over dates, then identify both the layer you wish to mask (eg NDVI) and the corresponding quality indicator corresponding to each given date using a regexp on file names. You can then create a 0-1 mask from the quality indicator using raster::reclassify and finally apply the mask using raster::mask, raster::calc or maybe gdalUtils::gdal_calc.

HTH

dkhramov commented 6 years ago

Thank you!