Link to the UNESCO-IOC website
Link to the Bilko website
Earth from space
Annual sea surface temperature

3.3 Masking cloud and land pixels

Creating cloud and land masks     Applying the flags     Assessing the results

LESSON 3

Overview

back to bottom of page next

References:
List of journal references

Downloads:

Images and tools

Lesson
(HTML pages)

Images:

ATS_TOA_1~ 20020727_~.N1 Description

cdwe020727wind*
Description

 
Useful information:

About AATSR

SST retrieval

Alongtrack scanning

Calibration

The SSTskin algorithm

Envisat orbit

Envisat filenames

AATSR flags

Cloud tests

Mediterranean currents

The AATSR 11µm Tb image data set we are currently using is rich in detail and is relatively cloud free. However there are several interesting areas of cloud that could be identified. We can use the AATSR cloud_flag_{view} bitfield provided with the GBTR data set to check and mask out clouds flagged by the AATSR data processor cloud flagging tests

Creating land and cloud masks

Activity: Click once on the cloud_flags_nadir data set in the right frame of the AATSR file-structure window, and right-click to obtain a pop-up menu. Select Open Properties to display the properties of this flag data.

The properties (or metadata attributes) provide a legend for the cloud flags that have been set for each pixel in the 11µm Tb image. Briefly each bit corresponds to a particular cloud test or other feature associated with a given pixel. For example,

  • if bit 0 is set (has the value 1) then the pixel value contains a cosmetic value rather than a measured value;
  • if bit 6 is set then the measured signal was out of range (the measured value was too great for the AATSR detectors to measure, in other words the signal saturated the detector range);
  • if bit 2 is set then the pixel in question has failed the AATSR cloud tests.

Note: Bit-field flags and how to handle these in Bilko are explained in 'Bitwise operators and Meris flags'. If you are not familiar with handling bit-field data, you might like to read this before tackling the acticity below.

Activity: Open the cloud_flags_nadir band for the Gulf of Lions image (ATS_TOA_1COLRA20020727_211258_~.N1). Briefly inspect the image-it probably doesn't make much sense!!

The image you have just displayed includes all the information stored in the 16-bit bitfield of the ; for many pixels this includes several flags added together in a string of sixteen 0s or 1s for each pixel in the cloud_flags_nadir data set. Pixels often have several flags set, so there may be several 1s in this string of binary data.

When the image is opened in Bilko, the integer value you can see on the Bilko status bar is the decimal number that corresponds to this 16-bit binary string. To extract individual flags from this mixture, we must use a Bilko FORMULA document that employs bitwise operators (Bilko help explains these). Here we are going to extract two of the bitfields as two binary masks:

  • bit-1, which marks pixels over land and
  • bit-2 marks the pixels that are cloud contaminated.

Activity:

  1. Open the Bilko FORMULA document cloud_flags_nadir_extraction.frm and familiarise yourself with the content. Refer back to the properties text for the cloud_flags_nadir data set.

  2. Right-click on the nadir_cloud_flags image, select Connect from the pop-up, add 2 blanks, check the Stack check box, and click OK to create a set of three images.

  3. Check the Selector to ensure that the image planes have been assigned as described in the FORMULA document.

  4. Set the output image type to 8-bit integer by
    either   opening the Image menu and selecting Options from the drop down, then change the Output Image Type
    or   activate the FORMULA document, and select Options! on the menu bar, then change the Output Image Type that way.
  5. Copy and paste the formula document onto the connected set.

Two new image data sets will have been created after applying this formula; one containing a binary cloud mask and the other containing a binary land mask. Zoom to preserve shape, so that you can see these masks without scrolling, and save them for later use:

  • Select image plane 2 (@2) using the selector or [TAB] key and save it as ats1_land_mask.dat, making sure you set the File type to Bilko.dat,
  • select image plane 3 (@3) and save this as ats1_cloud_mask.dat.

If you have time, you can experiment with this formula document to investigate which of the cloud tests failed by creating masks for the other bitfields. To do this, modify the formula document to extract the appropriate bit masks using the the cloud_flags_nadir bitfield values which have already been defined for you in the formula document.

Finally close the cloud_flags_nadir image and properties text box, as you will not need these any more.

Applying the masks

Now that we have a cloud and land mask, we want to apply the masks to the image data itself. As the mask files contain only the numbers 0 and 1, if we multiply an image data with the corresponding mask image we should generate a data set that contains the original data in all regions where the mask file has a value of 1 and a value of 0 in all areas where the mask data has a value of 0. We will create a new nadir_1100 image that has the land and cloud set to 0 by applying the masks we have just created.

Activity:

  1. Open the FORMULA document mask_AATSR_data.frm and familiarise yourself with the contents.

  2. Activate the btemp_nadir_1100 image, then open the Image menu, choose Connect, select the two masks you just created, add 1 blank to take the formula output, check the Stacked checkbox, and press OK.

  3. Open the Options! dialog (as above) and set the output to 16-bit unsigned integer.

  4. Apply the formula by copying it and pasting it onto the stack.

  5. Finally [TAB] to the new image, and save it as ats1_btemp_nadir_1100_masked.dat, remembering to choose Bilko.dat as the file type.

  6. Tidy up by closing all the connected sets and re-opening the ats1_btemp_nadir_1100_masked.dat you just saved, setting the Null value = 0 (the value for land and cloud) and giving it the same linear stretch as the unmasked image (min=28615, and max=30000).

Assessing the result

To compare the masked and unmasked images, minimize all other windows, open the Windows menu and select Tile Vertical; this puts the two images side by side in the Bilko application window. You may also want to "Zoom to Preserve Shape', thus allowing you to see both images fully.

It is interesting to see that the cloud mask you have extracted from the GBTR N1 data file contains far more pixels flagged as cloudy than you might expect from the simple visual inspection of the 11µm brightness temperature data sets! How well did you do in spotting the clouds? How well did the AATSR processor do in spotting all of the clouds?

Most of the clouds have been correctly identified but there are some areas that have probably been incorrectly flagged by the AATSR cloud flagging algorithm. If the image data sets had been obtained during the day time, we could have made use of the 1.6µm visible channel data to help investigate the clouds. The 1.6µm channel data are much better at discriminating clouds.
 

Answers:
(Resizable pop-ups)

Answer 1

Question 1
 

a)

Which areas have been flagged as cloud in the masked Tb 11µm image? Do you think any of these are incorrectly flagged?
 

b)

Can you suggest why this might be given your knowledge of the cloud tests used by the AATSR processor?

back to top of page next

 
Next: Look-angle differences in brightness temperature

  Link to ESA's Envisat website Link to NOC's website