| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: References :: Related |
| Back to top |
| Back to top |
avhrcor(fili, filo, dbic, dboc, dbiw, dbow, avhrrseg, pixres, resample, memsize, timemult)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI * | str | Input file name | 1 - | |
| FILO * | str | Output file name | 1 - | |
| DBIC * | List[int] | Input raster channel(s) | 1 - | |
| DBOC | List[int] | Output raster channel(s) | 0 - | |
| DBIW | List[int] | Raster input window | 0 - 4 | Xoffset, Yoffset, Xsize, Ysize |
| DBOW | List[int] | Raster output window | 0 - 4 | Xoffset, Yoffset, Xsize, Ysize |
| AVHRRSEG | List[int] | AVHRR calibration/orbit text segment | 0 - 1 | |
| PIXRES | List[float] | Output pixel resolution (m) | 0 - 1 | Default: 1000.0 |
| RESAMPLE | str | Resampling Mode | 0 - 5 | NEAR | BILIN | CUBIC | 8PT | 16PT Default: NEAR |
| MEMSIZE | List[float] | Working memory size (MB) | 0 - 1 | |
| TIMEMULT | List[int] | Multiplier for start scan date interval | 0 - 1 | 1 - Default: 1 |
| Back to top |
FILI
Specifies the name of the input file that contains the uncorrected AVHRR image data and the AVHRRSEG text segment. The input file must be a PCIDSK file (created with FIMPORT or MIAVHRR) or an actual level-1b AVHRR disk file.
FILO
Specifies the name of the output PCIDSK file to receive the corrected image data. The output file must contain a georeferenced segment.
If the specified output file does not already exist, AVHRCOR creates a new output file with extents based on the four corner points of the input image. The new output file is either in Universal Transverse Mercator (UTM) or Universal Polar Stereographic (UPS) coordinates, and uses the WGS 84 datum. UPS is used when the input file contains data near or including a polar region because UTM is typically a suitable projection only for data between latitude 75 degrees north and latitude 75 degrees south.
DBIC
Specifies the image channel(s) to be corrected.
DBOC
Specifies the channels in the output file (FILO) to receive the corrected image data.
For each input channel specified (DBIC), an output channel must be specified. Duplicate channels are not allowed.
If the output file does not exist, this parameter is ignored.
DBIW
Optionally specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) of data to correct. If this parameter is not specified, the entire image is used by default. Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.
DBOW
Optionally specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) to which the output is registered. If this parameter is not specified, the output window is the entire output image. Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.
If the output file (FILO) does not already exist, this parameter is ignored.
AVHRRSEG
Specifies the input text segment that contains AVHRR calibration and orbital data. This segment is automatically created when FIMPORT or MIAVHRR reads in an AVHRR image (from disk or tape, respectively).
If this parameter is not specified, AVHRCOR tries to use any valid AVHRR text segment in the input file.
PIXRES
This parameter applies only when a new output file is created; it allows you to specify a pixel resolution or size (in meters) for the output file. By default, the pixel size is set to 1,000 m (for example, 1000 x 1000 meters). The pixel size determines the number of pixels and lines in the output file. Decreasing the pixel size results in a larger output file and increased computation time.
RESAMPLE
Specifies the resampling method to use during the correction process.
MEMSIZE
Specifies the size, in megabytes, of the AVHRCOR internal working memory.
Only a portion of the input image must be held in RAM at any particular time during processing. The size of the portion that must be in memory depends on the size of the input image and on the amount of rotation between the input image and the geocoded output image.
TIMEMULT
Specifies a multiplication factor that indicates the time interval in which AVHRCOR searches for the exact starting scan date of the input image. The default value is 1, which indicates a default search interval of 60 minutes.
| Back to top |
AVHRCOR uses the NORAD Simplified General Perturbations (SGP) satellite orbital model to perform a geometric correction using the following steps:
Step 1: Use the satellite name to locate the corresponding Two Line Element (TLE) file in either the current working directory or $PCIHOME/etc. For example, the TLE file for the NOAA-12 satellite is named noaa-12.2le. A TLE file contains orbital element values for a satellite at various epochs (dates).
Step 2: Locate the epoch in the TLE file that is closest to the approximate starting scan date. Extract the corresponding orbital element values. These orbital element values are used in satellite position and velocity prediction models. For best results, ensure that the TLE files are kept up-to-date. Ideally, the epoch date would not differ from the starting scan date by more than a few days.
Step 3: Given one GCP and an approximate starting scan date, use the satellite orbital model to compute the exact starting scan date. This process is referred to as image date refinement. The GCP is used only to refine the image date. After image date refinement is performed, the mapping between pixel-line coordinates and geographic coordinates may still not precisely match the GCP. As a result, a pixel-line shift is applied to ensure that the GCP is matched precisely. Image-date refinement is performed only if a single GCP is available in the input file text segment.
Step 4: When you find the starting scan date, the transformations between the input image coordinates and the output image georeferencing system are fully determined. Every pixel in the output image is created by resampling the input image using these transformations.
Resampling
Resampling is the process of sampling one or more input pixels to create one output pixel (this is distinct from the transform phase, which simply determines where the output pixel lies on the input image). In general, resampling is accomplished by taking a weighted average of a small window of input pixels around a point determined by the transform phase. The quality of the corrected output image and the time required for calculation is highly dependent on the chosen resampling method.
Nearest Neighbor: This method takes the single input pixel nearest to the transformed point as the resampled output pixel.
Bilinear Interpolation: This method takes a weighted average of the four input pixels around the transformed point.
Cubic Convolution: AVHRCOR uses the 4-point classic method. This variation of cubic convolution uses a 4x4 window of input pixels. This method is closer to the perfect sin(x)/x resampler than Nearest Neighbor or Bilinear Interpolation.
Sin(x)/x: AVHRCOR uses sin(x)/x resampler using either an 8x8 or 16x16 window.
TLE data file
AVHRCOR requires NORAD Two-Line Element (TLE) data files to operate properly. A TLE file is a text file that contains information about specific satellite orbital parameters. Each pair of lines in a TLE file describes a satellite's orbital position in space on a specific date. The etc folder contains TLE files for various NOAA satellites; there is one TLE file for each satellite. A TLE file has a .2le file name extension.
If you are working with recent AVHRR data, you may need to obtain more up-to-date TLE files; these are publicly available and may be acquired through the Internet. When you download a TLE file, be sure to rename it properly (for example, noaa-12.2le) and save it to the current working folder. Files obtained from various Internet sites can be edited; for example, some of the files contain TLE entries for more than one satellite and distinguish between satellites by preceding each TLE entry with the satellite name. To construct a proper TLE file that AVHRCOR can use, extract the relevant TLE entries from the file but omit the satellite name portion. TLE files saved to the current working directory override any in the $PCIHOME/etc directory.
For best results with AVHRCOR, ensure that the TLE file contains an entry with an epoch date that is close to the scan date of the geometrically corrected AVHRR image.
Text segment format
AVHRCOR looks only for text with the following format; the rest of the information is ignored.
SATID: NOAA-12 YEAR: 1994 DAY: 203.599031 GCP: LONG = -96.117188 LAT = 49.062500 GCP: X = 1024.5 Y = 0.5 GCP: D = 0 TLELINE: ... TLE Line 1 ... TLELINE: ... TLE Line 2 ...
With the exception of the TLE lines, the spacing of the blanks is inconsequential. If any of the required information is missing from the text segment, AVHRCOR cannot perform the geometric correction.
Using a standard text editor, you may create your own text segment for AVHRCOR using this format. Use TEXREAD to read the text file into a text segment.
DAY: specifies the approximate starting scan date or time of the image, in GMT or UTC. This value does not need to be exact, but it must be within 60 minutes of the exact date. Sixty minutes is equivalent to 0.042 days.
The DAY value indicates the day of the year. It consists of an integral portion that ranges from 1 to 365 (or 366 for a leap year) and a fractional portion that indicates the time of day. DAY 1 refers to January 1 and DAY 203 refers to July 22 in a non-leap year or July 21 in a leap year. The search interval (60 minutes) can be increased by using the TIMEMULT parameter.
The first two GCP lines specify a single GCP used with AVHRCOR. The units for the LAT/LONG component of the GCP are decimal longitude and latitude. For example, LONG = 80.0 is the same as 80 degrees East longitude. Similarly, LAT = -30.0 is the same as 30 degrees South latitude. The GCP x value must be a number between 0.0 and the number of pixels in the input image. The GCP y value must be a number between 0.0 and the number of lines in the input image. Using non-integer GCP x and y values allows you to specify a GCP for any part of a pixel; for example, if you have a 200 pixel x 100 line image, the exact center of the top-left pixel in the image would have coordinates of x = 0.5 and y = 0.5. The exact center of the bottom-right pixel would have coordinates of x = 199.5 and y = 99.5. The exact center of the entire image would have coordinates of x = 100.0 and y = 50.0.
The third GCP line specifies the datum code against which the GCP is referenced. This line is optional; if it is not present, AVHRCOR uses a default value of D = 1 (indicating datum code D001 or WGS 72). WGS 72 is used as the default because Level 1b AVHRR data from NOAA/SAA contains GCPs that are in the WGS 72 system. See the Datum codes section for more information.
The GCP lines are optional. If they are not present in the text segment, no refinement of the starting scan date of the image is performed. The approximate image date specified by the YEAR and DAY lines are used as the precise image date. In this case, the TIMEMULT parameter has no effect. The results of the geometric correction might be less accurate in this situation, depending on the accuracy of the approximate image date.
Datum codes
The following shows some examples of valid datum code numbers:
D = -1 NAD27 (USA, NADCON) D = -2 NAD83 (USA, NADCON) D = -3 NAD27 (Canada, NTv1) D = -4 NAD83 (Canada, NTv1) D = 800 Normal Sphere D = 0 WGS 1984 D = 1 WGS 1972
For a complete list of datum codes, refer to 'Projections and earth models' in the Technical Reference section of the CATALYST Professional Online Help.
Definitions
| Back to top |
Correct a three-channel input database by using Nearest-Neighbor resampling and generate the results to a three-channel file. The AVHRR calibration and orbital data is stored in segment 2.
from pci.avhrcor import avhrcor fili = "NOAA-14.PIX" filo = "NOAA-14C.PIX" dbic = [1,2,3] dboc = [1,2,3] dbiw = [] dbow = [] avhrrseg = [2] pixres = [4000] resample = "NEAR" memsize = [] timemult = [] avhrcor( fili, filo, dbic, dboc, dbiw, dbow, avhrrseg, pixres, resample, memsize, timemult )
| Back to top |
NOAA Technical Memorandum, 1979 (revised 1988), "Data Extraction and Calibration of Tiros-N/NOAA Radiometers", ed. Walter G. Planet, (NESS 107 - Rev. 1, U.S. Department of Commerce., Appendix C).
Hoots, Felix R. and Ronald L. Roehrich, "Models for Propagation of NORAD Element Sets", Spacetrack Report No. 3, December 1980.
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.