MODIS Cloud Mask byte values are negative
Posted: Mon Mar 03, 2025 10:55 pm America/New_York
I'm looking to use the MODIS Cloud Mask 35_L2 product in the Arctic. Using the filespec as a reference (https://atmosphere-imager.gsfc.nasa.gov/sites/default/files/ModAtmo/MYD35_L2.C6.CDL.fs), I built a reader for my application that simply extracts the data in Python. However, upon a closer look, it looks like sometimes the field `Cloud_Mask`, which is in byte format, has negative values. It is generally of the shape (6, 2030, 1354) where the 2030 x 1354 are spatial, and the 6 is referring to 6 bytes. For instance, looking at the May 31 2024, 12:15Z granule from Aqua/MODIS (https://ladsweb.modaps.eosdis.nasa.gov/archive/allData/61/MYD35_L2/2024/152/MYD35_L2.A2024152.1215.061.2024153151907.hdf ), the `Cloud_Mask` byte 1 varies from -103 to 127 (which need to be converted to 8-bit binary to decode the meanings and flags), while byte 2 varies from -128 to -65. Looking at the User Guide and filespec, I didn't come across any references to how bytes can be negative when the individual bits can only be 0 or 1 (as seen in the filespec). However, this particular variable says the
I dug a little deeper with that granule and it appears that byte 1 is only negative when over land ice (Greenland and the Canadian archipelago). I'm not sure if that is related or not since the cloud mask typically has lesser accuracy over snow and sea ice. I've also seen negative values in MODIS/Terra cloud mask products if that helps.
I dug a little deeper with that granule and it appears that byte 1 is only negative when over land ice (Greenland and the Canadian archipelago). I'm not sure if that is related or not since the cloud mask typically has lesser accuracy over snow and sea ice. I've also seen negative values in MODIS/Terra cloud mask products if that helps.