QualityCheck.Rd 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. \name{QualityCheck}
  2. \alias{QualityCheck}
  3. \title{Remove unreliable data and no fill values from MODIS data}
  4. \description{Designed as an internal function for MODISSummaries, but can also be used independently. MODIS data of a given product band are screened for poor quality pixels, using the reliability data available for that product. The missing data values are also filtered out. The output is the same MODIS data, with screened poor quality and missing data converted to NAs.
  5. }
  6. \usage{
  7. QualityCheck(Data, Product, Band, NoDataFill, QualityBand, QualityScores,
  8. QualityThreshold)
  9. }
  10. \arguments{
  11. \item{Data}{Numeric vector or matrix; the input MODIS data, for QualityCheck to screen for poor quality and missing data.
  12. }
  13. \item{Product}{Character; the product code for Data (e.g. "MOD15A2" if you want to screen the quality of a downloaded data band from the leaf area index product).
  14. }
  15. \item{Band}{Character; the shortname code for the data band that you are quality screening.
  16. }
  17. \item{NoDataFill}{Numeric; the missing data fill value for the data band (Data) that you are screening.
  18. }
  19. \item{QualityBand}{Character; the shortname code for the quality data band that you are using to screen Band for poor quality data.
  20. }
  21. \item{QualityScores}{Numeric integer vector or matrix; the quality control control that matches your Data input. QualityScores should be the same length/dimensions as Data.
  22. }
  23. \item{QualityThreshold}{Numeric integer; set the threshold between acceptable and unacceptable quality. Any pixels of lower quality than the class set by QualityThreshold will be removed, and those equal to or of higher quality will be kept. QualityThreshold should be a number within the range of possible QualityScores for the given Product QA data.
  24. }
  25. }
  26. \details{Although there are several data bands within each MODIS product, only one band type of data should be passed to QualityCheck at a given time, as different bands within a product may have different NoDataFill values, and may even have different data bands that contain their relevant quality information.
  27. }
  28. \value{Data, as it was, but with poor quality data and no data fill values replaced with NAs.
  29. }
  30. \references{
  31. \url{https://daacmodis.ornl.gov/cgi-bin/MODIS/GLBVIZ_1_Glb/modis_subset_order_global_col5.pl}
  32. }
  33. \author{Sean Tuck}
  34. \seealso{\code{\link[MODISTools:MODISSummaries]{MODISSummaries}}}
  35. \examples{
  36. \dontrun{
  37. # dontrun() used because running the example requires internet access.
  38. data(QualityCheckExample)
  39. EVIdata <- QualityCheckExample[1:5, ]
  40. QAdata <- QualityCheckExample[6:10, ]
  41. QualityCheck(Data=EVIdata, Product="MOD13Q1", Band="250m_16_days_EVI",
  42. NoDataFill=-3000, QualityBand="250m_16_days_pixel_reliability",
  43. QualityScores=QAdata, QualityThreshold=0)
  44. }
  45. }