| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: References :: Related |
| Back to top |
| Back to top |
hazerem(fili, fili_pan, srcbgd, asensor, visirchn, chanopt, maskfili, maskseg, hazecov, hazeflsz, filo, filo_pan, ftype, foptions, extchn)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI * | str | Input multispectral image file | 1 - | |
| FILI_PAN | str | Input panchromatic image | 0 - | |
| SRCBGD | str | Source background value | 0 - | Default: FILE |
| ASENSOR | str | Sensor name | 0 - | |
| VISIRCHN | List[int] | Input blue, red, and NIR channels | 0 - 3 | |
| CHANOPT | str | Channel processing options | 0 - | |
| MASKFILI | str | Input haze, cloud, and water mask file | 0 - | |
| MASKSEG | List[int] | Haze, cloud, and water mask segments | 0 - 3 | |
| HAZECOV | List[int] | Percentage of haze cover | 0 - 2 | |
| HAZEFLSZ | List[int] | Haze smoothing filter size | 0 - 1 | 1 - 301 Default: 7 |
| FILO * | str | Output haze-free multispectral image file | 1 - | |
| FILO_PAN | str | Output haze-free panchromatic image file | 0 - | |
| FTYPE | str | Output file type | 0 - 4 | Default: PIX |
| FOPTIONS | str | Output file options | 0 - 64 | |
| EXTCHN | str | Copy to output channels from input file which are not processed. | 0 - 3 | NO | YES Default: NO |
| Back to top |
FILI
Specifies the name of the input file that contains multispectral imagery from one of the supported sensors (see ASENSOR).
The pixel values in the input raster file (FILI) must be TOA Radiance or TOA Reflectance.
FILI_PAN
Optionally specifies the name of the input file that contains the panchromatic image associated with the input multispectral image.
The panchromatic image must have been acquired at the exact same time, under the same haze conditions as the multispectral image. The input panchromatic image must be a single-channel file. If the specified file contains more than one channel, only the first channel is processed.
SRCBGD
Specifies which pixels in the source image are to be considered as background (NoData) pixels. In general, if a pixel is considered NoData, the application handles the pixel in a special manner.
FILE [, <value>]: same as FILE, but defines the NoData value for every channel, when metadata does not exist.
For example, the default "FILE, 0" specifies that the function uses metadata. If the metadata is unavailable, pixels that have a value of 0 are considered NoData.
ASENSOR
Optionally specifies the name of the sensor used to capture the input image.
See the Function Details section for a list of supported sensors.
If this parameter is not specified, the function checks for the PlatformName metadata tag at the file level.
If this parameter is not specified and the PlatformName metadata tag is not found, the function will error.
VISIRCHN
Optionally specifies the channels that contain the blue, red, and near-infraRed (NIR) bands. If this parameter is not specified, channel numbers are automatically determined from the specified sensor type (ASENSOR). If the NIR band is not available, the algorithm will still run, but the urban areas and bare soil pixels will likely be overcorrected in the output.
CHANOPT
Optionally specifies how the channels in the file should be processed and written to the output file. Channel options are defined using a string of characters, one character for each channel.
For example, if the input file has four channels and this parameter is either 'p,p,c,s' or 'p,p,c', the first two channels should have haze removal applied, the third should be copied as is, since the input is TOA Radiance and the fourth skipped. The output file would then contain three channels: the first two with haze removed and the third with an exact copy of the third input channel.
If this parameter is not specified, the function uses a default value for the specified sensor. The default applies haze removal to all visible channels (Coastal/Blue/Green/Red/RedEdge/NIR). and copies the rest (SWIR) and thermal IR channels.
Output is always in TOA Radiance
MASKFILI
Optionally specifies the name of the file that contains haze, cloud, and water masks. These masks are typically generated by MASKING, which is run prior to running HAZEREM.
Supplying haze, cloud, and/or water masks improves haze removal results over land. Haze will still be removed over water, but clouds are left undisturbed. When a cloud mask is not provided but the scene contains clouds, the cloud pixels are assumed to be haze and will receive the maximum possible correction, resulting in an overcorrected image.
MASKSEG
Optionally specifies the bitmap segments that contain masks for haze (first value), cloud (second value), and water (third value).
If the file does not contain a haze (or cloud) mask, the missing mask can be skipped by placing a 0 in the first (or second) value.
HAZECOV
Optionally specifies the percentage of the image that is covered in haze. The default value is 50.
This value should be set as low as possible while still allowing haze to be removed. Low percentages cause the least change to the original image values. It may be necessary to run HAZEREM with different haze cover values to achieve the best results.
HAZEFLSZ
Optionally specifies the size of a smoothing filter to apply to the haze computations. Valid values are odd integers, from 1 to 301; the default value is 7.
Although large filter sizes tend to generate more natural color, if the haze thickness varies quickly (that is, it is thin, high cloud or fills small valleys), a large filter size will leave small pockets and fringes of haze. This value should be set as high as possible while still allowing all haze to be removed. It may be necessary to run HAZEREM with different haze smoothing filter values to achieve the best results.
FILO
Specifies the name of the output file to receive the haze-corrected image. The output will be in TOA Radiance.
The specified file must not already exist; a new file will always be created to store the haze-corrected multispectral image.
FILO_PAN
Optionally specifies the name of the output file to receive the haze-corrected panchromatic image if an input PAN file was specified. The output will be in TOA Radiance. (FILI_PAN).
The specified file must not already exist; a new file will always be created to store the haze-corrected panchromatic image.
FTYPE
Optionally specifies the output file format type, represented by a three- or four-letter code. The format type must be a GDB-supported file type. This parameter applies to both the multispectral and panchromatic images files.
For a complete list of GDB-recognized file types and their codes, see GDB file formats in the Technical Reference section of the CATALYST Professional Online Help.
FOPTIONS
Specifies the file creation options to be applied when creating the output file. These are specific to the file format; in each case, the default of no options is allowed. This parameter can be used to specify compression schemes, file format subtypes, and other information.
Different options are available for different file types (see the FTYPE parameter). The options are described in GDB file formats in the Technical Reference section of the CATALYST Professional Online Help.
EXTCHN
Specifies the output channel option. It is possible that not all channels from the input file are processed for haze removal. This can happen either when VISIRCHN list is provided of image metadata is analyzed to select set of channels to apply haze removal. This switch provides an option to copy to output file the channels from input file which are not processed.
This parameter is optional.
| Back to top |
HAZEREM is the second step in a typical atmospheric correction workflow. This algorithm prepares the image by correcting the radiometric variability caused by haze, thus reducing some of the atmospheric effect on the image in the raw domain. This produces a better-looking image, ready for analysis or operations such as automated GCP collection, color balancing, or mosaicking, without relying on the accuracy of atmospheric lookup tables.
HAZEREM uses the coarse classification masks created by MASKING to identify and derive haze statistics. The identification of haze is based on a transformation of the visible band space, where spectral response to diverse surface cover classes under clear-sky conditions is highly correlated. Bright land surface cover types such as urban and bare soil may be problematic because they are often confused with haze. The algorithm produces the best results when there are a good number of clear and hazy pixels over vegetation.
The output will be in TOA Radiance.
Supported sensors
| Back to top |
This example removes the haze from the LANDSAT7 ETM+ sensor, based on the image irvine.pix, which contains channel 1 as blue, channel 2 as green, channel 3 as red, and channel 4 as NIR; channel 5 is a SWIR band (~1.6um). The result will be put to a new PCIDSK file. The haze will be removed from the first four channels. If, after evaluating the results, a stronger correction is required, set the HAZECOV parameter to a higher value. Similarly, if a lighter correction is desired, set HAZECOV to a lower value (which will produce an image with DN values closer to the original DNs).
from pci.hazerem import hazerem fili = "irvine.pix" fili_pan = "l7_pan.pix" srcbgd = "" asensor = "Landsat-7 ETM+" visirchn = [1,3,4] chanopt = "" maskfili = "" maskseg = [] hazecov = [15] hazeflsz = [] filo = "Irvine _HazeRemoved.pix" filo_pan = "l7_pan_HazeRemoved.pix" ftype = "" foptions = "" extchn = "" hazerem( fili, fili_pan, srcbgd, asensor, visirchn, chanopt, maskfili, maskseg, hazecov, hazeflsz, filo, filo_pan, ftype, foptions, extchn )
| Back to top |
Y. Zhang, B. Guindon, and J. Cihlar. "An image transform to characterize and compensate for spatial variations in thin cloud contamination of Landsat images", Remote Sensing of Environment 82 (2002), pp. 173-87.
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.