- Subject Matter Expert
- Posts: 266
- Joined: Mon Apr 07, 2008 4:40 pm America/New_York
Using NASA OBPG files, a way to transfer the cloud mask from a L2 file into a L1B scene (of the same scene, same instrument, and same resolution) would be to open both the L2 file and the L1B file simultaneously in SeaDAS and then create a mask using the Band Math tool followed by the Mask Manager tool. Note that both the L1B and L2 files need to be an identical raster grid size, with matching geolocation, so if the L1B is HKM (500m) then the L2 would also need to be HKM (500m).
Here are the steps (again specific to NASA OBPG files)
1. Load a L1B file into SeaDAS
2. Load a L2 file into SeaDAS
3. Select the L1B file and select "Menu > Raster > Math Band".
4. Click "Edit Expression"
5. Still within the L1B file, in the Expression Editor for "Product" select the L2 file, then check "Show single flags", then pick the CLDICE mask. So your expression should look something like this "$2.l2_flags.CLDICE" (where $2 denotes the index of the file loaded into the File Manager so that may differ depending on the order in which you loaded the files into SeaDAS.)
6. Click "OK" in both GUIs and a new band (call it "cloud_band") will be created in the L1B scene.
7. In the L1B file, open "cloud_band" and select "Pixel Info" and observe that as you hover over the pixels, the cloud pixels have a value of "1" and the non-cloud pixels have a value of "0".
8. In "Mask Manager" click on "f(x)" and add the expression "cloud_band == 1".
9. This will create a mask in the L1B file which is essentially a copy of the L2 file's mask.
The problem I'm running into here is that the MODIS product MOD35_L2 isn't an easy binary mask, the actual cloud mask is a 48-bit band that is kind of tricky to work with, so it doesn't even show up in the "Bands" section of its product. Show single flags isn't an option for this product either because of this.
To get around this I've generated a binary mask just as a csv file (without geolocation data), is there anyway I can load this into SeaDAS and apply it to the L1B product? I will also need to be able to reproject the L1B product after it is mask.
Maybe you can use a (complicated) band-maths expression to generate a flag band directly from the 48-bit band.grossg99 wrote: ↑Thu Jul 07, 2022 12:21 pm America/New_York The problem I'm running into here is that the MODIS product MOD35_L2 isn't an easy binary mask, the actual cloud mask is a 48-bit band that is kind of tricky to work with, so it doesn't even show up in the "Bands" section of its product. Show single flags isn't an option for this product either because of this.