AVHMLIN

AVHRR Skipped Missing Line Insertion


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

Back to top

Description


Detects missing lines in AVHRR PCIDSK files containing orbit segments and inserts blank lines in their place. Only PCIDSK files created from Level 1b or CEOS raw data will have orbit segments. A missing line is detected simply as a jump in the scanline indexing found in an orbit segment. In other words, a missing line (in the context of this program) is a skipped line - one that has been physically omitted from the image. AVHMLIN inserts blank lines where they are missing and pushes the remaining scanlines down. AVHMLIN operates on the PCIDSK file in- place and does not increase the number of database lines in the file if blank lines are inserted. This means that scanlines at the bottom of the image may be overwritten.
Back to top

Parameters


avhmlin(file, orbit, num1, num2)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
ORBIT List[int] Input orbit segment 0 - 1  
NUM1 List[int] Number of lines to skip 0 - 1 0 -
Default: 10
NUM2 List[int] Mode of operation 0 - 1 0 | 1 | 2
Default: 0

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the AVHRR PCIDSK file to process.

ORBIT

Optionally specifies the AVHRR orbit segment containing the per-scanline indexing information. If not supplied, AVHMLIN searches for the first appropriate orbit segment to use.

NUM1

Optionally specifies the number of scanlines to skip before beginning scanline detection/insertion. Often, the first few scanlines of Level 1b data will be corrupt, and it is prudent to skip several scanlines before beginning detection. Otherwise, a corrupt line may cause invalid scanline insertions to be performed. By default, this parameter is set to 10.

NUM2

Optionally specifies the mode of operation.

Available modes are:
Back to top

Details

AVHRR detects missing lines in AVHRR PCIDSK files containing orbit segments and inserts blank lines in their place. Only PCIDSK files created from Level 1b or CEOS raw data will have orbit segments.

AVHRR raw data from certain sources (e.g., Level 1B from the NOAA Satellite Active Archive) may contain missing lines. A missing line in this case is considered to be a scanline that has been physically omitted from the raw image. Because each scanline in an AVHRR raw image has an associated scanline number or index, it is possible to detect missing lines based on jumps in this indexing.

For the Level 1B and CEOS AVHRR formats, an orbit segment is created upon import (using FIMPORT). This orbit segment contains the scanline number/index for each scanline in the image. Thus, using the orbit segment, AVHMLIN can determine precisely which scanlines are missing.

For each missing line, AVHMLIN inserts a blank image line into the image and also into the orbit segment. However, because AVHMLIN does not increase the number of lines in the PCIDSK file, this means that lines at the bottom of the image will be dropped (including those in the orbit segment). Beyond the loss of some imagery, this has implications for image start times, particularly for rotated imagery where the timing of each scanline is in decreasing order.

AVHMLIN tries to do some post-processing on its own with regards to scanline timing. It attempts to adjust the GMT times of inserted blank lines (because they have no timing to begin with). In addition, AVHMLIN adjusts the GMT times of scanlines whose timing seems out of place. For LAC/HRPT, the timing difference between each scanline must follow a repeating pattern: 166 ms, 167 ms, 167 ms, 166 ms, ... Scanlines that deviate from this pattern are assumed to be corrupt. They will have their times adjusted and their associated imagery will be zeroed out (treated as a blank line). For GAC data, the timing difference between scanlines is always 500 ms.

If scanline time adjustment is performed, AVHMLIN modifies the image DAY line in the AVHRR text segment, and updates the AVHRR_ImageDayOfYear metadata field in the file. It also comments out the single GCP lines in the text segment, as they may have been invalidated by the timimg adjustments.

By default, AVHMLIN does not perform any scanline insertions within the first 10 scanlines of the image. Often, the first few scanlines are corrupt (including scanline numbers). To avoid making invalid insertions, AVHMLIN does not use these scanlines for determining whether or not an insertion is required. Use the NUM1 parameter to change the number of lines to skip.

Back to top

Example

TBD

from pci.avhmlin import avhmlin

file	=	'level1b.pix'
orbit	=	[]	# default, search for orbit segment
num1	=	[]	# default, skip 10 scanlines
num2	=	[]	# default, mode 0

avhmlin( file, orbit,num1,num2 )

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