MODIS MOD09A1 v6.1 invalid QC codes?
Posted: Mon Feb 26, 2024 10:10 pm America/New_York
Greetings, and thanks in advance for any help with this issue.
The 8th band (sur_refl_qc_500m) of the MODIS MOD09A1 v6.1 land product are the quality control codes stored as bit-packed 32 bit integers. Unpacking those bits results in a binary sequence that can be interpreted using Table 10 of the MOD09 v6.1 user guide (p22):
https://lpdaac.usgs.gov/documents/925/MOD09_User_Guide_V61.pdf
The first issue is that some of the Int32 values resolve to a band-level binary sequence (0001) that is not listed in Table 10:
1075838976 -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
R code to replicate this: as.integer(intToBits(1075838976))
Note that bit numbers 18-21 (0-indexed numbering corresponding to band 5 data quality four bit range) are 0001, which is a sequence that is not listed as a possible value in Table 10. How should 0001 be interpreted in the context of band quality?
There are 26 integers in the QC data that include this 0001 sequence for Band 5:
1075838976 1075838977 1075839029 1075839809 1075839861 1075852289
1075852341 1075853121 1075853173 1076051969 1076052021 1076052853
1076065281 1076065333 1076066113 1076066165 1130378241 1814036483
1948254209 1948267521 1948268353 1948468085 2015363075 2015376387
2015589431 2015590263
But 0001 does not occur for any other band in any integer, so it seems to be a Band 5 issue alone.
Perhaps the most obvious explanation for this is that 0001 has been unintentionally omitted from the descriptions in Table 10 in the User Guide?
The second issue is that I don't understand how there can be a flag associated with degraded data for one of the bands but the overall product quality represents "corrected product produced at ideal quality -- all bands" (00 for the first two bits). Consider this example:
1103101952 -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0
Bit positions 22-25 (0-indexed numbering) are 1110, which mean "L1B data faulty" for band 6. If the L1B data is faulty, how can the first two bits be 00, indicating ideal quality over all bands? Perhaps the explanations for the 4-digit sequences would benefit from a little more detail, to help users resolve what appears to be a discrepancy?
Thanks for any advice on how to correctly interpret these QC codes. Kudos and thanks to the MODIS team for producing such an amazing product.
The 8th band (sur_refl_qc_500m) of the MODIS MOD09A1 v6.1 land product are the quality control codes stored as bit-packed 32 bit integers. Unpacking those bits results in a binary sequence that can be interpreted using Table 10 of the MOD09 v6.1 user guide (p22):
https://lpdaac.usgs.gov/documents/925/MOD09_User_Guide_V61.pdf
The first issue is that some of the Int32 values resolve to a band-level binary sequence (0001) that is not listed in Table 10:
1075838976 -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
R code to replicate this: as.integer(intToBits(1075838976))
Note that bit numbers 18-21 (0-indexed numbering corresponding to band 5 data quality four bit range) are 0001, which is a sequence that is not listed as a possible value in Table 10. How should 0001 be interpreted in the context of band quality?
There are 26 integers in the QC data that include this 0001 sequence for Band 5:
1075838976 1075838977 1075839029 1075839809 1075839861 1075852289
1075852341 1075853121 1075853173 1076051969 1076052021 1076052853
1076065281 1076065333 1076066113 1076066165 1130378241 1814036483
1948254209 1948267521 1948268353 1948468085 2015363075 2015376387
2015589431 2015590263
But 0001 does not occur for any other band in any integer, so it seems to be a Band 5 issue alone.
Perhaps the most obvious explanation for this is that 0001 has been unintentionally omitted from the descriptions in Table 10 in the User Guide?
The second issue is that I don't understand how there can be a flag associated with degraded data for one of the bands but the overall product quality represents "corrected product produced at ideal quality -- all bands" (00 for the first two bits). Consider this example:
1103101952 -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0
Bit positions 22-25 (0-indexed numbering) are 1110, which mean "L1B data faulty" for band 6. If the L1B data is faulty, how can the first two bits be 00, indicating ideal quality over all bands? Perhaps the explanations for the 4-digit sequences would benefit from a little more detail, to help users resolve what appears to be a discrepancy?
Thanks for any advice on how to correctly interpret these QC codes. Kudos and thanks to the MODIS team for producing such an amazing product.