MERGEBAND

Merge and combine bands


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example

Back to top

Description


Data can be distributed with multiple bands (for example, red, green, blue, and near infra-red) that are separated into different files. MERGEBAND lets you merge and recombine multiple bands into a single PCIDSK (.pix) file.
Back to top

Parameters


mergeband(mfile, filo, rpcfile)

Name Type Caption Length Value range
MFILE * str Input file name, directory, or text file 1 - 192
FILO * str Output file 1 -    
RPCFILE str RPC text file 0 -  

* Required parameter
Back to top

Parameter descriptions

MFILE

Specifies a particular file or multiple files containing images to be merged. Wildcards (*) can be used.

MFILE can be set using any of the following options:
If the text file option is used, the following general rules apply:

FILO

Specifies the output PCIDSK file that will contain the merged bands.

If the file already exists, the program displays an error and exits.

RPCFILE

Specifies the name of the input RPC text file that provides the coefficients that define the rational functions math model for the scene.

If this parameter is not specified, MERGEBAND automatically finds the RPC text file in the same folder as the input image files. The RPC text file name must have the same base name as one of the image file names, with the suffix "_rpc.txt".

Back to top

Return Value

Returns: execution status

Type:  PCI_INT

The return value is 0. This function returns only if it executes successfully; otherwise, it throws an exception.

Back to top

Details

Because of CD size limitations, some high-resolution satellite data, such as IKONOS, is distributed with an RPC file and the four channels (blue, green, red, and NIR) in separate NITF or TIFF files. MERGEBAND recombines the four channels into a single multi-channel file and imports the RPC file.

The order in which the files is entered using the MFILE parameter sets the order of the channels. For example, the first file is the first channel, the second file is the second channel, and so on.

The RPC file is a text file that provides the coefficients that define the rational functions math model for the scene.

If the RPCFILE parameter is not specified, MERGEBAND automatically finds the RPC text file in the same folder as the image files. The RPC text file name must have the same base name as one of the image file names with "_rpc.txt" appended

Note: MERGEBAND assumes that the georeferencing is identical for all input files.
Back to top

Example

Merge image band files in MergeBandList.txt into one PCIDSK file, called Merged.pix. MergeBandList.txt contains four lines of band file names:
"C:\Demo\po_123456_red_0000000.tif"
"C:\Demo\po_123456_grn_0000000.tif"
"C:\Demo\po_123456_blu_0000000.tif"
"C:\Demo\po_123456_nir_0000000.tif"
from pci.mergeband import mergeband

mfile   =   "MergeBandList.txt"
filo    =   "Merged.pix"
rpcfile = ""

mergeband(mfile, filo, rpcfile)

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