Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Applying" quality filters #156

Closed
lbusett opened this issue Dec 10, 2018 · 3 comments
Closed

"Applying" quality filters #156

lbusett opened this issue Dec 10, 2018 · 3 comments

Comments

@lbusett
Copy link
Contributor

lbusett commented Dec 10, 2018

From: ropensci/software-review#184 (comment)

Great package! I have just 1 question, while running the package I saw written that QA's were computed. In my PC several folders were created. In which folder the 'corrected' images of MODIS are? Or should I make something else (e.g. use another package) in order to take the good quality images?

@lbusett
Copy link
Contributor Author

lbusett commented Dec 12, 2018

@vanto1994

Hi. The quality indicators are saved as independent rasters for further use. Having those automatically "applied" would be impractical, because it would require to allow the user to specify his "filtering approach" somwhow beforehand. Since the MODIS quality indicators scheme varies by product / layer, it is unfeasible.

The easiest way to use the indicators to "filter" the data would be in my opinion to cycle over dates in the rasterStacks created by MODIStsp, 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 for example raster::mask, raster::calc or gdalUtils::gdal_calc.

I plan to somehow facilitate this approach in the future by providing specific MODIStsp functions, but I do not know when I will have the time to do that.

HTH

@nikosGeography
Copy link

Hello lbusett and vanto. Great pckg by the way.
So if I understand it correctly, you are saying that in order to filter the data (in my case LST 8day) I have to make a for loop so every lst img to be matched with the qc img of the same day?

@lbusett
Copy link
Contributor Author

lbusett commented Dec 12, 2018

Yes, that's the gist of it, though if you save the time series as a MODIStsp rasterstack (see option in the GUI) you can also more easily just cycle over the bands of the stacks, which are automatically aligned in terms of dates. I am preparing a small example of this to be added to the website. Will keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants