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

9.6.3 Preparing the individual scenes III

Using histograms to find mask thresholds     Confidence flags with thresholds Putting it all together

TUTORIAL

9. Gridded data

back to bottom of page next
 

Useful information:
(Resizable pop-ups)

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 refining the bitmask formula you worked on in the last sub-section. Start by examining the three versions of the masked image, which you created and saved earlier.


Note: At the start of this subsection you should have a number of files open, which you will need in order to answer question 1 below:
  • a set of connected images, saved as mer20040201masks.set in the previous section T9.6.2,
  • a formula which you have modified and saved as mer2water_a1b.frm , and
  • three images you have created using various versions of the formula, which you have saved as mer20040201_w.dat, mer20040201_a1a.dat and mer20040201_a1b.dat.


  • Question 1.

    a)

    How does the latest version of the image compare with the previous attempts to create a masked image containing valid data?

    b)

    Can you find any pixels / areas that may still cause problems if included in the calculation of averages for a gridded composite? (You may need to zoom in and scroll around to look at the image in greater detail to do this).

    c)

    In the masked image, place your cursor on some of the problem pixels and read the data values. Can you suggest ways of removing these problematic pixels from the selection?

    Using histograms to find mask thresholds

    Visual examination of problem areas will help you identify anomalously dark pixels. Using the cursor, you may then read the data values and work out a suitable threshold this way. However, it is a cumbersome procedure, and you may end up with a threshold that inadvertently loses data in other areas of the image. Using histograms of the masked images you already have created will be quicker and less subjective. To help you decide the threshold you will now carry out a comparison of the histograms from three of the images you have created: .

    1. Right-click on mer20040201_w.dat, select 'Redisplay', and set null to 255. (You have to set the null value first, and then click the check box.) Repeat for mer20040201_a1a.dat and mer20040201_a1b.dat.
    2. Connect the three images into a stack.
    3. Select the whole stack ( [CTRL+A] ).
    4. Open the 'New' dialogue ( [CTRL+N]) and select Histogram as the file type.
    5. Make sure the 'Apply stretches' box is unchecked.
    6. Press OK to open a stack of three histograms, each representing one of the images. Use [TAB] to move between them.
    7. Tab to the histogram that represents mer20040201_w.dat. Right-click on the histogram, select scale, and check the ignore zero box.

    Question 2.

    a)

    In the histogram representing mer20040201_w.dat place the cursor on the main peak and read the data value from the status bar. What is it? Leave the cursor where it is and use the tab key to move to the other two images in turn. How do the main peaks of the three images compare? Can you explain this?

    b)

    There is a narrow peak at very low values, which is only present in the histograms of mer20040201_w.dat and mer20040201_a1b.dat . What pixels does this peak represent?

    c)

    Can you suggest a bit-mask formula that would remove this peak?

    1. Modify the formula as suggested by the answer to Question 2 and apply it to the stacked images. Note how some, but not all, of the dark pixels disappear.
    2. Save the new formula as mer2water_a1c.frm and a copy of the masked image as mer20040201_a1c.dat.

    You may have noticed that there are still dark pixels in the region of scattered cloud about 2/3 of the way down in the left third of the image. If you zoom in on this area (with the masked image on top of the stack), you will notice a large number of dark pixels, often adjacent to some that have already been masked.

    Question 3.

    a)

    By placing your cursor on the darkest of these you can read their values from the Bilko status bar, and confirm that several are below the threshold of 30 used in the formula. Can you explain why these pixels have not been masked?

    b)

    Use the 'Go-to' dialogue to move to the following pixels in turn (remember to set View coords to [x,y] first): [65,803] , [493,830], [454,986], and [589,987]. For each, make a note of the data value in the masked image, and tab to the flags image to read the flag value.

    c)

    The binary value of these pixels are
     

    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

    3360769

    0

    0

    1

    1

    0

    0

    1

    1

    0

    1

    0

    0

    1

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    1

    3344401

    0

    0

    1

    1

    0

    0

    1

    1

    0

    0

    0

    0

    1

    0

    0

    0

    0

    0

    0

    1

    0

    0

    0

    1

    3344385

    0

    0

    1

    1

    0

    0

    1

    1

    0

    0

    0

    0

    1

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    1

    3344400

    0

    0

    1

    1

    0

    0

    1

    1

    0

    0

    0

    0

    1

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0

    0


    What flags do these pixels have in common? Using the table of MERIS level 2 flags, can you suggest one that may help remove the remaining low values?

    Confidence flags with thresholds

    If the masked image is not on top of the stack, tab until it is.

    1. Open the formula mer2water_a1d.frm. As you can see it is a modification of the previous formula that also used a threshold (mer20040201_a1c.frm).
    2. Copy the formula and watch the masked image carefully as you paste the formula onto the stack.
    3. Save the new image as mer20040201_a1d.dat.

    You may well find that you are still unhappy with the low values of some pixels. Experiment with increasing the threshold of the formula. (All you need to do is to change the value of the constant threshold in the constant declarations.) Stop when you feel you have found an acceptable threshold, that still is likely to give reliable data when averaged with other images in a composite.

    1. Save your modified formula as mer2water_a1e.frm; you will need it for the processing of other images later.
    2. Save the last version of the image containing the masked data as mer20040201_a1e.dat.
    3. From the Window menu choose Close All Except and notice how a list of open files appear, with only the active image ticked. Tick the formula you last used as well, and click OK to close the rest. You may find that the original N1 data does not close, so you may have to do this separately.

    Answers:
    (Resizable
    pop-ups)

    Answer 1

    Answer 2

    Answer 3

    Back up to:
    Q1   Q2   Q3  

    Putting it all together

    You are now ready to prepare the two remaining scenes of the composite.

    1. Open MER_RR__2COLRA20040202_~.N1,
    2. select the 'Bands' folder and open the 'algal_1' and 'l2_flags' data sets,
    3. combine these two into a stack with a blank image,
    4. apply the formula you just finished refining ( mer2water_a1e.frm), and
    5. save the masked image created by the formula as mer20040202_a1e.dat.
    6. Open MER_RR__2COLRA20040203_~.N1 and repeat 2-5 above.

    Before you continue close all windows except the three images you have just created ( mer20040201_a1e.dat, mer20040202_a1e.dat and mer20040203_a1e.dat).
     

    back to top of page next

    Next: Creating the composite