Page 1 of 1

MODIS MOD09A1 v6.1 invalid QC codes?

Posted: Mon Feb 26, 2024 10:10 pm America/New_York
by hbeyer
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.

Re: MODIS MOD09A1 v6.1 invalid QC codes?

Posted: Tue Feb 27, 2024 11:35 am America/New_York
by LP DAAC - dgolon
Hello @hbeyer We are looking into your question and will write back when we have additional information. Thanks -- Danielle

Re: MODIS MOD09A1 v6.1 invalid QC codes?

Posted: Wed Feb 28, 2024 10:18 am America/New_York
by LP DAAC - lien
Hello,
Thanks for bringing this to our attention, do you have a specific Granule ID, we would like to show this to the MODIS Science Team and make them aware of this. Our first thought is maybe the bits got inverted, but either way something is amiss.
Thanks,
Brett

Re: MODIS MOD09A1 v6.1 invalid QC codes?

Posted: Wed Feb 28, 2024 10:18 pm America/New_York
by hbeyer
Hi Brett and Danielle,

Thanks for following up on this and for replying to my query. I was looking most intensively at tile h13v09. I just checked 800 granules in the time series for that tile and 100% of them had a QC code with the 0001 bit sequence for band 5, so this is a common issue in this tile at least.

Here is one specific, recent example:
MOD09A1.A2024041.h13v09.061.2024051154917.hdf

contains these QC integers:
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
1075838977 -> 1 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
1075839029 -> 1 0 1 0 1 1 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
1075839809 -> 1 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
1075839861 -> 1 0 1 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0
1076051969 -> 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0
1076052021 -> 1 0 1 0 1 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0
1076052853 -> 1 0 1 0 1 1 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0
1948254209 -> 1 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 1 0 1 1 1 0
1948468085 -> 1 0 1 0 1 1 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 1 0 1 1 1 0
2015363075 -> 1 1 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 1 1 1 1 0

The first integer in that list is the most important because the first two bits are 00, indicating high quality, all bands.

Thanks,
Hawthorne

Re: MODIS MOD09A1 v6.1 invalid QC codes?

Posted: Fri Mar 01, 2024 9:37 am America/New_York
by LP DAAC - lien
Thanks for the tile info Hawthorne. I have found those values in many random files since you brought that to our attention. We have contacted the folks at LDOPE who help develop the products and also specialize in the QC. As soon as we hear back from them I will let you know. Thanks for your patience.
Brett

Re: MODIS MOD09A1 v6.1 invalid QC codes?

Posted: Thu Mar 14, 2024 11:07 am America/New_York
by LP DAAC - lien
Hello Hawthorne,
Sorry for the delay, we contacted the PI/developer of this product for his take and he confirmed that we were reading the bits in reverse. OK, then the issue was why did the Mandatory Modland QA bits show "00" Good Data. He always thought the individual band quality QAs were not reflected well in the Mandatory Modland QA bits and he suggests for band quality to check the individual band quality bits which truly reflects band quality.Please let me know if you have any questions.
Thanks,
Brett

Re: MODIS MOD09A1 v6.1 invalid QC codes?

Posted: Mon May 06, 2024 6:40 am America/New_York
by hbeyer
Thanks for following up on this Brett and for the clarification from the PI.

I did consider that the interpretation of the bit order should be reversed but that leads to other difficulties in interpretation of the codes. Arguably, this is the most important code as it represents the best quality:

(the bit order must be reversed when interpreting this code)
1073741824 -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0

Despite all 7 band-level bit codes being "0000", indicating "highest quality" and with no atmospheric or adjacency correction, the first two bits are still "01", indicating "corrected product produced at less than ideal quality -- some or all bands". That struck me as contradictory, so I concluded interpreting the bits in the other direction was more likely (I was wrong). I don't understand why the first two bits are not "00" (representing "corrected product produced at ideal quality -- all bands") for that value. Perhaps this is one of the issues the PI was referring to with the comment that the "QAs were not reflected well in the Mandatory Modland QA bits".

Furthermore, I cannot find a single QA code in which the first two bits are anything other than "01" (so far I have found 634 unique QA codes but there are probably more). So it would appear that there is little or no information contained in the first two bits, and the advice that band-specific codes should always be used in preference to the higher level codes is valuable information to users.

MANY THANKS for helping me reach this understanding. I consider this issue fully resolved.