MODIS_QC.R 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. # This file contains part of the information in the QC layers since it is a relatively boring job any contribution is welcome!
  2. # the required information can be found under https://lpdaac.usgs.gov/products/modis_products_table -> Layers
  3. # Status: Experimental!
  4. ########### M.D09
  5. MOD09A1_QC <- data.frame(
  6. LongName=c("MODLAND_QA", "band 1 data quality four bit range", "band 2 data quality four bit range", "band 3 data quality four bit range", "band 4 data quality four bit range", "band 5 data quality four bit range", "band 6 data quality four bit range", "band 7 data quality four bit range", "atmospheric correction performed", "adjacency correction performed"),
  7. bitShift=c(0,2,6,10,14,18,22,26,30,31),
  8. bitMask=c(3,15,15,15,15,15,15,15,1,1)
  9. )
  10. MYD09A1_QC <- data.frame(
  11. LongName=c("MODLAND_QA", "band 1 data quality four bit range", "band 2 data quality four bit range", "band 3 data quality four bit range", "band 4 data quality four bit range", "band 5 data quality four bit range", "band 6 data quality four bit range", "band 7 data quality four bit range", "atmospheric correction performed", "adjacency correction performed"),
  12. bitShift=c(0,2,6,10,14,18,22,26,30,31),
  13. bitMask=c(3,15,15,15,15,15,15,15,1,1)
  14. )
  15. MOD09GQ_QC <- data.frame(
  16. LongName=c("MODLAND_QA", "cloud state", "band 1 data quality four bit range", "band 2 data quality four bit range",
  17. "atmospheric correction performed", "adjacency correction performed", "spare (unused)"),
  18. bitShift=c(0,2,4,8,12,13,14),
  19. bitMask=c(3,3,15,15,1,1,3)
  20. )
  21. MYD09GQ_QC <- data.frame(
  22. LongName=c("MODLAND_QA", "cloud state", "band 1 data quality four bit range", "band 2 data quality four bit range",
  23. "atmospheric correction performed", "adjacency correction performed", "spare (unused)"),
  24. bitShift=c(0,2,4,8,12,13,14),
  25. bitMask=c(3,3,15,15,1,1,3)
  26. )
  27. MOD09GA_QC <- data.frame(
  28. LongName=c("cloud state", "cloud shadow", "land/water flag", "aerosol quantity", "cirrus detected",
  29. "internal cloud algorithm flag", "internal fire algorithm flag", "MOD35 snow/ice flag",
  30. "Pixel is adjacent to cloud", "BRDF correction performed", "internal snow mask"),
  31. bitShift=c(0,2,3,6,8,10,11,12,13,14,15),
  32. bitMask=c(3,1,7,3,3,1,1,1,1,1,1)
  33. )
  34. MYD09GA_QC <- data.frame(
  35. LongName=c("cloud state", "cloud shadow", "land/water flag", "aerosol quantity", "cirrus detected",
  36. "internal cloud algorithm flag", "internal fire algorithm flag", "MOD35 snow/ice flag",
  37. "Pixel is adjacent to cloud", "BRDF correction performed", "internal snow mask"),
  38. bitShift=c(0,2,3,6,8,10,11,12,13,14,15),
  39. bitMask=c(3,1,7,3,3,1,1,1,1,1,1)
  40. )
  41. MOD09Q1_QC <- data.frame(
  42. LongName=c("MODLAND_QA", "cloud state", "band 1 data quality four bit range", "band 2 data quality four bit range",
  43. "atmospheric correction performed", "adjacency correction performed", "different orbit from 500 m", "spare (unused)"),
  44. bitShift=c(0,2,4,8,12,13,14,15),
  45. bitMask=c(3,3,15,15,1,1,1,1)
  46. )
  47. MYD09Q1_QC <- data.frame(
  48. LongName=c("MODLAND_QA", "cloud state", "band 1 data quality four bit range", "band 2 data quality four bit range",
  49. "atmospheric correction performed", "adjacency correction performed", "different orbit from 500 m", "spare (unused)"),
  50. bitShift=c(0,2,4,8,12,13,14,15),
  51. bitMask=c(3,3,15,15,1,1,1,1)
  52. )
  53. ########### M.D11
  54. MOD11A1_QC <- data.frame(
  55. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  56. bitShift=c(0,2,4,6),
  57. bitMask=c(3,3,3,3)
  58. )
  59. MYD11A1_QC <- data.frame(
  60. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  61. bitShift=c(0,2,4,6),
  62. bitMask=c(3,3,3,3)
  63. )
  64. MOD11A2_QC <- data.frame(
  65. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  66. bitShift=c(0,2,4,6),
  67. bitMask=c(3,3,3,3)
  68. )
  69. MYD11A2_QC <- data.frame(
  70. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  71. bitShift=c(0,2,4,6),
  72. bitMask=c(3,3,3,3)
  73. )
  74. MOD11B1_QC <- data.frame(
  75. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  76. bitShift=c(0,2,4,6),
  77. bitMask=c(3,3,3,3)
  78. )
  79. MYD11B1_QC <- data.frame(
  80. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  81. bitShift=c(0,2,4,6),
  82. bitMask=c(3,3,3,3)
  83. )
  84. MOD11C1_QC <- data.frame(
  85. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  86. bitShift=c(0,2,4,6),
  87. bitMask=c(3,3,3,3)
  88. )
  89. MYD11C1_QC <- data.frame(
  90. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  91. bitShift=c(0,2,4,6),
  92. bitMask=c(3,3,3,3)
  93. )
  94. MOD11C2_QC <- data.frame(
  95. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  96. bitShift=c(0,2,4,6),
  97. bitMask=c(3,3,3,3)
  98. )
  99. MYD11C2_QC <- data.frame(
  100. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  101. bitShift=c(0,2,4,6),
  102. bitMask=c(3,3,3,3)
  103. )
  104. MOD11C3_QC <- data.frame(
  105. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  106. bitShift=c(0,2,4,6),
  107. bitMask=c(3,3,3,3)
  108. )
  109. MYD11C3_QC <- data.frame(
  110. LongName=c("Mandatory QA flag", "Data quality flag", "Emissivity error flag", "LST error flag"),
  111. bitShift=c(0,2,4,6),
  112. bitMask=c(3,3,3,3)
  113. )
  114. ############ MCD12
  115. MCD12C1_QC <- data.frame(
  116. LongName=c("Mandatory QA", "Quarters since updated", "Land/Water"),
  117. bitShift=c(0,2,4),
  118. bitMask=c(3,3,15)
  119. )
  120. ############ M.D13
  121. MOD13Q1_QC <- data.frame(
  122. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  123. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Possible snow/ice", "Possible shadow"),
  124. bitShift=c(0,2,6,8,9,10,11,14,15),
  125. bitMask=c(3,15,3,1,1,1,7,1,1)
  126. )
  127. MYD13Q1_QC <- data.frame(
  128. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  129. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Possible snow/ice", "Possible shadow"),
  130. bitShift=c(0,2,6,8,9,10,11,14,15),
  131. bitMask=c(3,15,3,1,1,1,7,1,1)
  132. )
  133. MYD13C1_QC <- data.frame(
  134. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  135. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Geospatial quality"),
  136. bitShift=c(0,2,6,8,9,10,11,14),
  137. bitMask=c(3,15,3,1,1,1,7,3)
  138. )
  139. MOD13C1_QC <- data.frame(
  140. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  141. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Geospatial quality"),
  142. bitShift=c(0,2,6,8,9,10,11,14),
  143. bitMask=c(3,15,3,1,1,1,7,3)
  144. )
  145. MYD13A2_QC <- data.frame(
  146. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  147. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Possible snow/ice", "Possible shadow"),
  148. bitShift=c(0,2,6,8,9,10,11,14,15),
  149. bitMask=c(3,15,3,1,1,1,7,1,1)
  150. )
  151. MOD13A2_QC <- data.frame(
  152. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  153. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Possible snow/ice", "Possible shadow"),
  154. bitShift=c(0,2,6,8,9,10,11,14,15),
  155. bitMask=c(3,15,3,1,1,1,7,1,1)
  156. )
  157. MYD13A3_QC <- data.frame(
  158. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  159. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Possible snow/ice", "Possible shadow"),
  160. bitShift=c(0,2,6,8,9,10,11,14,15),
  161. bitMask=c(3,15,3,1,1,1,7,1,1)
  162. )
  163. MOD13A3_QC <- data.frame(
  164. LongName=c("MODLAND_QA", "VI usefulness", "Aerosol quantity", "Adjacent cloud detected",
  165. "Atmosphere BRDF correction performed", "Mixed Clouds", "Land/Water Flag", "Possible snow/ice", "Possible shadow"),
  166. bitShift=c(0,2,6,8,9,10,11,14,15),
  167. bitMask=c(3,15,3,1,1,1,7,1,1)
  168. )
  169. #### MCD15
  170. MCD15A2_QC <- data.frame(
  171. LongName=c("MODLAND_QC bits", "Sensor", "DeadDetector", "CloudState (inherited from Aggregate_QC bits {0,1} cloud state)",
  172. "SCF_QC (five level confidence score)"),
  173. bitShift=c(0,1,2,3,5),
  174. bitMask=c(1,1,1,3,7)
  175. )
  176. #### M.D17
  177. MOD17A2_QC <- data.frame(
  178. LongName=c("MODLAND_QC bits", "Sensor", "DeadDetector", "CloudState (inherited from Aggregate_QC bits {0,1} cloud state)",
  179. "SCF_QC (five level confidence score)"),
  180. bitShift=c(0,1,2,3,5),
  181. bitMask=c(1,1,1,3,7)
  182. )
  183. MYD17A2_QC <- data.frame(
  184. LongName=c("MODLAND_QC bits", "Sensor", "DeadDetector", "CloudState (inherited from Aggregate_QC bits {0,1} cloud state)",
  185. "SCF_QC (five level confidence score)"),
  186. bitShift=c(0,1,2,3,5),
  187. bitMask=c(1,1,1,3,7)
  188. )