RFMODEL

Generate Rational Function Model


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

Back to top

Description


RFMODEL calculates the mathematical models required for orthorectification using rational functions, and stores the result in a segment.
Back to top

Parameters


rfmodel(mfile, dbgc, mmseg, adjorder, numcoeff, mapunits)

Name Type Caption Length Value range
MFILE* str Input file name, directory, or text file 1 -    
DBGC List[int] Input GCP segment or layer 0 - 1  
MMSEG List[int] Math model segment or layer 0 - 1  
ADJORDER List[int] RPC adjustment order (0, 1, 2) 0 - 1 0 - 2
NUMCOEFF List[int] Number of coefficients (3 to 20) 0 - 1 3 - 20
MAPUNITS str Map units 0 -   PIXEL, UTM, METER, and others

* Required parameter
Back to top

Parameter descriptions

MFILE

Specifies the name of a folder, image file, or text file that contains the input images. 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:

If MFILE is a directory name or if multiple file names are entered, then all images in MFILE should be processed using the parameters set for RFMODEL.

If a directory is specified, then the DBGC, MMSEG, ADJORDER, and NUMCOEFF parameters are set to a single value for all input images. If a text file is specified, the DBGC, MMSEG, ADJORDER, and NUMCOEFF parameters are read from the text file for each image, and those parameters can be empty.

If one file is specified for MFILE, the model computed will be an independent model (one image).

If a text file is specified for MFILE, the listed files in the text file are processed with the listed parameters.

DBGC

Specifies the ground control point (GCP) segment or layer to use to compute the model.

If a directory is specified for MFILE, then this segment number will be applied to all images. If a text file is specified, DBGC is read from the text file, and this parameter can be empty.

MMSEG

Specifies the math model segment or layer that stores the model.

If a directory is specified for MFILE, then this segment number will be applied to all images. If a text file is specified, MMSEG is read from the text file, and this parameter can be empty. If no value is specified, a new segment is created.

ADJORDER

If RPC data is supplied with the data, this value specifies the RPC adjustment order to be used in the RPC model refinement. Valid values are 0, 1 or 2.

NUMCOEFF

If RPC data is not supplied with the data, this value specifies the number of coefficients to be used to calculate the rational function. Valid values are 3 to 20.

MAPUNITS

Specifies the projection string for the output model.

The standard definitions are as follows:

For a complete list of supported projections and Earth models, see Understanding map projections. The format of the map units string is described in Output units.

If this parameter is not specified, the map units of the GCP segment are used.

Back to top

Return Value

Returns: A list of statistical values.

Type:  PCI_DOUBLE

Parameter: IMSTAT

A list containing the doubles: [GCP RMS, GCP maximum RMS, GCP minimum RMS, abs(GCP maximum residual), abs(GCP minimum residual) math model segment number]. The last value in the returned list is the segment number to which the computed math model was written. The remaining values are in pixels. If more than one file is processed, the list is extended with the same set of statistical values for each file. This function returns only if it executes successfully; otherwise, it throws an exception instead of returning.

Back to top

Details

RFMODEL calculates the mathematical model required for orthorectification using rational functions. It computes an updated rational functions solution, based on provided GCPs or rational function coefficients, or both.

There are several use scenarios for RFMODEL:
Note: If you have RPCs but no GCPs, RFMODEL need not run. ORTHO and other functions interpret the RPC model transparently from the original raw image files (NITF, TIFF with TXT).
Note: When run with EASI the function sets the parameter named IMSTAT to the values that are returned by the Python version.
Back to top

Examples

You have an IKONOS image and would like to correct it using rational functions.

from pci.rfmodel import rfmodel

mfile ="ikonos.pix"	# input image file
dbgc = [2]		# use gcp segment 2
mmseg = []		# create a new math model segment
adjorder = [0]		# use 0 order RPC adjustment
numcoeff = []		# Leave none for RPC coefficient number
mapunits = "UTM 11 d0"	# output projection

rfmodel (mfile, dbgc, mmseg, adjorder, numcoeff, mapunits)
		

You have an image without existing RPC math model and would like to generate a new RPC segment.

from pci.rfmodel import rfmodel

mfile ="17029_pan.pix"	# input image file
dbgc = [3]		# use gcp segment 3
mmseg = []		# create a new math model segment
adjorder = []		# leave none for RPC adjustment order
numcoeff = [20]		# use 20 for RPC coefficient number
mapunits = ""	# output projection

rfmodel (mfile, dbgc, mmseg, adjorder, numcoeff, mapunits)
		

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