MODEL2RPC

Convert a math model to RPC model


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

Back to top

Description


MODEL2RPC generates a rational-polynomial-coefficient-model segment or text/xml file from an input math-model segment. A rational-polynomial coefficient is known as an RPC.
Back to top

Parameters


model2rpc(fili, filo, mmseg, rpczref)

Name Type Caption Length Value range
FILI * str Input-file name 1 -    
FILO str Output-file name 0 -    
MMSEG List[int] Input-math-model segment 0 - 1  
RPCZREF str RPC-elevation reference 0 - 6 Default: ELLIPS

* Required parameter
Back to top

Parameter descriptions

FILI

The name of the input file that contains the math-model segment to convert.

FILO

The name of the output file to receive the RPC segment. Currently, only a PCIDSK (.pix) file can properly support the creation of a math model.

If the output file is not specified, a new rational-function-model (RFMODEL) segment is created in the input file (FILI).

If the output file name has a .txt/.rpb extension, the RPC output is written to a text file. If the output file name has a .xml extension, the RPC output is written to an xml file. There are two different RPC text file formats with different extensions, i.e., _rpc.txt and .rpb. _rpc.txt format is mostly used by satellites such as IKONOS and GeoEye old formats and .rpb is mostly used by satellites such as QuickBird and WorldView. This program will output the RPC according to the file extension.

MMSEG

The input-math-model segment from which to generate the RPC model. If MMSEG is zero, it will generate RPC model from the geocoded image.

RPCZREF

The computed RPC-elevation reference.

Available options are:

The default is ELLIPS (ellipsoid).

Back to top

Return Value

Returns: execution status

Type:  PCI_INT

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

Back to top

Details

MODEL2RPC converts a math model inside an image file to a rational-function-model segment.

If no value is specified for the output file (FILO), a new segment is created in the input file (FILI). If the the value specified for FILO is a file name with a .txt extension, MODEL2RPC writes the RPC information to that text file.

Back to top

Example

Generate a rational-function model for a given PCISDK file.

from pci.model2rpc import model2rpc

fili = "image.pix" # input file containing math model
filo = "" # create new output segment in FILI
mmseg = [] # use last segment in FILI
rpczref = "ELLIPS" # use ellipsoidal
model2rpc( fili, filo, mmseg, rpczref )
            

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