DN2TOA

Calculate top of atmosphere reflectance


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: References :: Related

Back to top

Description


The Top Of the Atmosphere (TOA) computation converts pixel values to physical reflectance, as measured above the atmosphere. It normalizes the different solar illumination conditions at different acquisition times and helps to validate thee image's calibration coefficients (a high percentage of pixels in the image with TOA values over 100 indicate incorrect calibration coefficients).
Back to top

Parameters


dn2toa(fili, dbic, srcbgd, asensor, cfile, znangle, outunits, filo, ftype, foptions)

Name Type Caption Length Value range
FILI * str Input image 1 -    
DBIC List[int] Input channels 0 -   1 -
SRCBGD str Source background value 0 -   Default: FILE
ASENSOR str Sensor name 0 -  
CFILE str Calibration file (*.cal) 0 -    
ZNANGLE List[float] Solar zenith angle (deg) 0 - 1 0.0 - 90.0
OUTUNITS str Output units 0 - 28 Default: 16bit_Reflectance
FILO * str Output computed reflectance image 1 -    
FTYPE str Output file type 0 - 4 Default: PIX
FOPTIONS str Output file options 0 - 64  

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the input image from one of the supported sensors (see the ASENSOR parameter description).

The input image can be a raw image, an orthorectified image, or the output haze-free image from HAZEREM.

DBIC

Optionally specifies the list of input channels to process. The specified channels must exist. By default, all channels are processed.

If FILI does not contain metadata but has as many channels as sensor bands, this parameter can be empty; DN2TOA will map the first channel to the first band, the second to the second band, and so on. To verify the expected number of bands for each sensor, check the sensor files available in PCIHOME\atcor\cal\.

If FILI does not contain metadata and has more or fewer channels than bands for the selected sensor, this parameter must be specified. For instance, if the sensor is Landsat-7 and FILI has all the reflective bands from Landsat (that is, it has 6 channels containing bands 1,2,3,4,5, and 7), this parameter should be specified as DBIC=1,2,3,4,5,6.

If FILI contains the wavelength metadata information for each channel, DBIC can be empty.

Note: When FILI contains a panchromatic file, DBIC should specify at most 1 channel.

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.

Available options are:
Note: To specify multiple values, use a comma-delimited list. The first value is applied to the first channel, the second value to the second channel, and so on. If fewer values are specified than the number of input channels, the last value is repeated for all remaining channels. If more values are specified than the number of input channels, the extra values are ignored.

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.

CFILE

Optionally specifies the path and name of the text file that contains, for each band, the calibration coefficients used to transform the values from the image to absolute at-sensor radiance values. This information is typically provided with the data set as an offset and a gain for each channel.

The specified text file should contain the band number, offset, and gain, and the units for each. The following shows an example of a calibration file for Landsat images:
7      c0       c1 [mW/cm2 sr micron]
1   -0.0500   0.0778700
2   -0.2600   0.0798800  
3   -0.3000   0.0621600
4   -0.5500   0.0639700
5   -0.1150   0.0126200 
6    0.3200   0.00372047
7   -0.0420   0.00438900

The atcor\cal\ folder in the CATALYST Professional installation directory contains sample calibration files for every sensor supported by the atmospheric correction functions (MASKING, ATCOR, ATCOR_T). Each row in a calibration file lists the calibration coefficients for each sensor band; the bands are listed in increasing band order.

Ensure that the offset (c0) and gain (c1) values correspond to the scene. These values must be provided in the expected units for the specific sensor (shown at the top right of the calibration file).

If this parameter is not specified, DN2TOA reads the RadiometricTransOffset, RadiometricTransGain, and RadiometricTransUnits metadata tags for each channel in the input file. If the Calibration File (CFILE) parameter is not specified, or if the coefficients cannot be derived from the metadata, DN2TOA errors.

ZNANGLE

Specifies the solar zenith angle (0-90 degrees) at the time of image acquisition.

If this parameter is not specified, the function derives the solar zenith from any one of the following combination of metadata tags found at the file level of the input file (FILI):

If this parameter is not specified and none of the combinations of metadata tags are found in full, this function errors.

OUTUNITS

Optionally specifies the output units for the atmospherically corrected image.

Available options are:

FILO

Specifies the name of the output file to receive the computed reflectance image.

The specified file must not already exist. The output file will contain as many channels as the input file (FILI) or the same number of channels specified in DBIC. The bit depth is determined by the OUTUNITS parameter.

FTYPE

Specifies the output file format type, represented by a three- or four-letter code. The format type must be a GDB-supported file type.

Supported formats include, among others:

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.

Back to top

Details

DN2TOA generates a Top Of the Atmosphere (TOA) image that can be used for further processing, such as masking and atmospheric correction.

This function converts imagery from digital number to at-satellite reflectance (Top of the Atmosphere reflectance). This step is required before calculating radiometric transformations such as the Tasseled Cap transformation or Normalized Difference Vegetation Index, which require at-satellite reflectance input instead of digital numbers.

DN2TOA supports imagery stored in any GDB-supported format. For more information, refer to GDB file formats in the Technical Reference section of the CATALYST Professional Online Help.

The generated TOA image can be used to determine the seed and lowest threshold for cloud detection by MASKING.

Supported sensors

The following sensors are supported:
  • ALI
  • ALOS Avnir-2
  • Aster
  • Cartosat PAN
  • CBERS-4
  • CBERS-4A
  • Deimos-1
  • Deimos-2
  • DMC
  • Dragonette
  • DS-EO
  • FASat-Charlie
  • Formosat-2
  • FORMOSAT-5
  • Geoeye-1
  • GF1
  • GF2
  • GF4
  • GF6
  • GF7
  • Gokturk1
  • IRS-1A
  • IRS-1B
  • IRS-1C
  • IRS-1D
  • IRS-P6
  • Ikonos-2
  • Jilin-1
  • KazEOSat-2
  • KOMPSAT-2
  • KOMPSAT-3
  • KOMPSAT-3A
  • Landsat-4 MSS
  • Landsat-5 MSS
  • Landsat-4 TM
  • Landsat-5 TM
  • Landsat-7 ETM+
  • Landsat-8
  • Maxar-Legion
  • OrbView-3
  • PeruSAT-1
  • PlanetScope
  • Pleiades
  • QuickBird
  • PlanetScope
  • RapidEye
  • Resourcesat-2
  • SAC-C
  • Sentinel-2
  • SPOT-1
  • SPOT-2
  • SPOT-3
  • SPOT-4
  • SPOT-5
  • SPOT-6
  • SPOT-7
  • SuperView
  • Thaichote (THEOS)
  • TripleSat
  • WorldView-2
  • WorldView-3
  • WorldView-4
  • ZY1E
  • ZY3
  • ZY3-2
Note: When specifying a sensor, use the exact syntax, as shown in the preceding list.
Back to top

Example

Calculate Top of Atmopshere reflectance on a SPOT-5 data set.

from pci.dn2toa import dn2toa

fili = "spot5.pix"
dbic = []
srcbgd = ""
asensor = ""
cfile = "spot5.cal"
znangle = [27.9]
outunits = "Reflectance"
filo = "toa.pix"
ftype = ""
foption = ""

dn2toa( fili, dbic, srcbgd, asensor, cfile, znangle, outunits, filo, ftype, foption )
Back to top

References

Chander, G.; Markham, B.; Helder, D. Summary of Current Radiometric Calibration Coefficients for Landsat MSS, TM, ETM+ and EO-1 ALI Sensors. Remote Sensing of Environment, 113, 893-903.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.