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

9.6.2 Preparing the individual scenes II

Using confidence flags to refine data selection     Combining flags and data

TUTORIAL

9. Gridded data

back to bottom of page next
 

Useful information:
(Resizable pop-ups)

MERIS level 2 flags

Bitwise operators and Envisat flags

MERIS level 2 water products

The MERIS product grid

Image data: A grid of pixels

Geocorrection of remote sensing data

Geographical coordinate systems

Equidistant cylindrical (Lat/Lon) grids

The Universal Transverse Mercator (UTM) grid

 

Image descriptions:
(Resizable pop-ups)

S1998033~.HDF

MER_RR_2C~ 200402~.N1

usgs_10s8e 40s30e.dat

In this subsection you will be modifying the bitmask formula to exclude water pixels that do not contain valid geophysical data. Start by examining some of the pixels that clearly should be masked.

Question 1.

a)

Use the 'Go-to' dialogue ( [CTRL+G] ) to find the pixel [x,y] = [360,801] (You will need to uncheck the coords box first.) With the cursor on this pixel tab through the stack to the l2_flags data set. What is the flag code for this pixel? What is the algal_1 data value? What are the flag codes and data values for pixel [962,1015] ?
 

b)

The binary version of the flag values given to the two pixels are shown below. Use the table of MERIS level 2 flags to see what flags these pixel have been given. Which of these are relevant to the current data set?
 

Bit

23

22

21

20

19

18

17

16

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

3655700

0

0

1

1

0

1

1

1

1

1

0

0

1

0

0

0

0

0

0

1

0

1

0

0

Using confidence flags to refine data selection

A MERIS Confidence flag relates to the quality of the geophysical data in the pixel that contains the flag. Unlike class flags, which are mutually exclusive, confidence and science flags may be used in combination with each other and with the class flags. Often the conditions that give rise to one flag are also likely to trigger others. During processing from Level 1 (top of atmosphere radiances) to Level 2 (geophysical data) confidence flags are raised when

  • there is a failure of the algorithm used to derive a geophysical parameter
  • the algorithm runs, but conditions indicate that the result may not be valid

You can use confidence flags to modify the bitmask formula used to select valid pixels from the algal_1 data set. For instance, in Question 1 you found that some of the problematic pixels had been given confidence flag PCD_15. Including this flag in the formula may improve the selection.

Question 2.

a)

How would you write a condition (an if statement) to check pixels for the presence of flag PCD_15? Explain when the condition would be true, and what instructions should be carried out by the program in this case.

b)

How would you add this condition to the existing formula?

Copy and paste the new formula to the stack and watch what happens to the image. Once you are sure the formula has worked, save it as mer2water_a1a.frm, and save a copy of the masked image created by the formula as mer20040201_a1a.dat.

Question 3.

a)

Compare the image you saved at the end of the last section to the new version of the masked image in the stack. Would you say the latest version of the bitmask formula is a good solution?

b)

Read about the PCD_15 flags in MERIS level 2 flags, Looking at the first image you saved, can you think of a possible reason why the use of the confidence flag removed so many pixels close to land?

c)

On the basis of your observations and your reading about the relationship between different MERIS flags, could you indicate a possible solution that will remove fewer water pixels from the masked image?

Combining flags and data values

Confidence flags are set when a geophysical value is likely to be invalid. This can be due either to complete algorithm failure, or (less severely) to conditions that are likely to give an unreliable results. Hence there are three possible combinations of a flag value and the corresponding geophysical data value:

Table 1.

Processing performance

Flag value

Data value

1. Algorithm failure

  1

  0

2 Algorithm output of doubtful quality

  1

>0

3. Everything OK, result valid

  0

>0

Question 4.
Bearing in mind the sensitivity of the PCD_15 flag to atmospheric effects and high turbidity, it may be better to use this flag only when it marks algorithm failure. Can you think of a way to modify the formula to achieve this?

Use the formula you saved as mer2water_a1a.frm to carry out the modifications suggested in your answer to Question 4, but save it as mer2water_a1b.frm before you start. When you have finished, copy and past it onto the stack and watch what happens to the masked image.

Before moving on, save the revised formula, make a copy of the masked image and save it as mer20040201_a1b.dat. You may also like to save the set of images you have been working with so you can access it quickly later:
 

Answers:
(Resizable pop-ups)

Answer 1

Answer 2

Answer 3

Answer 4

Back up to:
Q1   Q2   Q3   Q4  

  1. Tab to the first image in the stack (the algal_1 data)
  2. From the 'File' menu select Save As.
  3. In the 'Save As' dialogue select the directory where you want to store the set
  4. Change the 'File name' to mer20040201_algal_1.dat.
  5. Make sure the 'File Type' is set to 'Bilko.dat' or you will loose the geo-referencing
  6. Tab to the next image in the stack (the l2_flags data), and repeat 2-5 above, choosing mer20040201_l2flags.dat as the file name
  7. Tab to the last image plane, which contains the masked image, and repeat 2-5 above, choosing ' mer20040201_masked.dat as the file name
  8. From the 'File' menu chose Save Set
  9. Change the name of the set from 'stack.set' to mer20040201masks.set.
  10. Check that the File type is set to SETS (*.set)
  11. Click 'Save' to save the set.

The set should now be safely stored and will open with all its component images next time you want it.

Note: If you rename any of the component files or move them to a different directory using file manager, the 'Set' file will not be able to find them next time you open the set. This is also the case if you move the set file, without at the same time moving its component images.
 

back to top of page next

Next: Preparing the individual scenes III