avcloud [ parameter=value ] [ inputfile outputfile ] avcloud [ parameter=value ] [ inputfile ... directory ] avcloudP [ parameter=value ] [ input_outputfile ... ]
Parameters are day_sun_elev, night_sun_elev, min_land_temp, land_temp_std, min_sea_temp, sea_temp_std, max_land_rad, max_sea_rad, sea_rad_std, max_coast_rad, min_land_r2/r1, max_sea_r2/r1, min_sun_reflect, max_ch4_ch3, max_ch3_ch5, ch4_ch5_test, poly_size_km, local_limits, local_area_size, land_temp_range, land_rad_range, sea_temp_range, sea_rad_range, min_area_pts, snow_ice, debug.
avcloud, avcloudP computes a cloud mask for a given AVHRR image. avcloudP writes output data to associated input files. No output filename should be specified when invoking avcloudP.
avcloud is based on the following paper
"An improved method for detecting clear sky and cloudy radiances from AVHRR data", R.W.Saunders and K.T.Kriebel, Int. Journal of Remote Sensing, 1988, Vol. 9, No. 1, pp. 123-150
Input AVHRR datasets have the following requirements:
- Channel 4 is required for any cloud testing.
- Channel 2 is required for day time cloud testing.
- Channel 3 is required for any night time cloud testing.
- Channel 1 is desired for some day time cloud tests.
- Channel 5 is desired for some day and night cloud tests.
Datasets output from avcloud contain a single variable cloud. For any given pixel, cloud is zero if the pixel is clear, and non-zero if the pixel is cloudy.
The non-zero value assigned to cloud is the number of the first test failed in the following cloud detection process:
(0) day is true if sun elevation angle > day_sun_elev night is true if sun elevation angle < night_sun_elev land is true if the surrounding 3x3 box is entirely over land sea is true if the surrounding 3x3 box is entirely over sea coast is true if land and sea are false (1) temp = ch5 if available, otherwise temp = ch4 if land or coast, if temp < min_land_temp, assume cloudy if sea if temp < min_sea_temp, assume cloudy (2) std = ch4 standard deviation in 3x3 box if sea if std > sea_temp_std, assume cloudy if land and night if std > land_temp_std, assume cloudy (3) if day if sea or coast rad = ch2 if land rad = ch1 if available, otherwise rad = ch2 rad = rad/cos(sun zenith angle) if sea if rad > max_sea_rad, assume cloudy if land if rad > max_land_rad, assume cloudy if coast if rad > max_coast_rad, assume cloudy (4) if day and sea std = ch2 standard deviation in a 3x3 box if std > sea_rad_std, assume cloudy (5) if day, and if ch1 is available if land if ch2/ch1 < min_land_r2/r1, assume cloudy if sea if ch2/ch1 > max_sea_r2/r1, assume cloudy (6) if night (low fog and uniform stratus check) if ch4-ch3 > max_ch4_ch3, assume cloudy (7) if night, and if ch5 is available (medium and high cloud check) if ch3-ch5 > max_ch3_ch5, assume cloudy (8) if ch5 is available and ch4_ch5_test=yes (thin cirrus cloud check) if ch4-ch5 > tdiff(ch4, 1/cos(sat zenith angle)), assume cloudy tdiff() is described in NOTES below.
All the limits used in the above tests are user parameters, with the exception of the tdiff() test. That test can be turned of using the user parameter ch4_ch5_test. For any other cloud test, the limit can be set so the test is essentially turned off.
The limits min_land_temp, min_sea_temp, max_land_rad, and max_sea_rad can be refined by an optional local area analysis. In this case, different limits are used for different areas of the image.
For each local area, conservative land and sea maximum temperatures and conservative land and sea minimum radiances are computed. (At least 5% of the temperatures in the local area are above the temperature maximum. At least 5% of the radiances are below the radiance minimum.) Then the following local adjustments are made to certain cloud detection limits:
local min clear land temp = max( min_land_temp, local land max temp - land_temp_range ) local min clear sea temp = max( min_sea_temp, local sea max temp - sea_temp_range ) local max clear land radiance = min( max_land_rad, local land min rad - land_rad_range ) local max clear sea radiance = min( max_sea_rad, local sea min rad - sea_rad_range )
The user parameters land_temp_range, sea_temp_range, land_rad_range, and sea_rad_range refer to the maximum expected range of values within a local area.
A test to distinguish surface snow and ice from clouds is also provided. The snow and ice test is based on the following paper: "An Algorithm for snow and ice detection using AVHRR data An extension to the APOLLO software package", G. Gesell, INT. J. REMOTE SENSING, 1989, vol. 10, nos. 4 & 5, 897-905 . It is optional and can be enabled or disabled with the snow_ice parameter.
Note that because different cloud tests are performed over land and over sea and over coast, it is crucial that the input image be accurately navigated. See navigate.
n% avcloud n14.96093.0934 mask day_sun_elev : real ? [10] night_sun_elev : real ? [-5] min_land_temp : real ? [-10] land_temp_std : real ? [1.5] min_sea_temp : real ? [0] sea_temp_std : real ? [0.25] max_land_rad : real ? [40] max_sea_rad : real ? [10] sea_rad_std : real ? [0.2] max_coast_rad : real ? [15] min_land_r2/r1 : real ? [0] max_sea_r2/r1 : real ? [0.75] min_sun_reflect: real ? [50] max_ch4_ch3 : real ? [1] max_ch3_ch5 : real ? [1.5] local_limits : char( 3) ? [yes] local_area_size: int ? [100] min_area_pts : int ? [1000] land_temp_range: real ? [25] sea_temp_range : real ? [5] land_rad_range : real ? [25] sea_rad_range : real ? [5] snow_ice : char( 3) ? [no] n14.96093.0934: Local area study phase n14.96093.0934: Cloud screening phase mask: Completed
tdiff() used in the last cloud test is a function of the AVHRR channel 4 brightness temperature and the secant of the satellite zenith angle. It is interpolated from the following table:
static double TDIFF[6][5] = { /* thin cirrus test limits */ 0.55, 0.60, 0.65, 0.90, 1.10, /* function of temp, secant */ 0.58, 0.63, 0.81, 1.03, 1.13, 1.30, 1.61, 1.88, 2.14, 2.30, 3.06, 3.72, 3.95, 4.27, 4.73, 5.77, 6.92, 7.00, 7.42, 8.43, 9.41, 10.74, 11.03, 11.60, 13.39 }; #define NUM_TDIFF_ROWS 6 #define NUM_TDIFF_COLS 5 static double TDIFF_ROW_TEMP[] = { /* temperature in degrees K */ 260., 270., 280., 290., 300., 310. }; static double TDIFF_COL_SECANT[] = { /* 1./cos(sat zenith) */ 1., 1.25, 1.50, 1.75, 2.0 };