| Environments | PYTHON :: EASI |
| Quick links | Description :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example :: Related |
| Back to top |
| Back to top |
genapmodel(mfile, xmli, camparam, tfile, mapunits, eotype, eovdatum, angunits, rotkappa)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| MFILE | str | Input file or folder | 0 - | |
| XMLI | str | Input camera-calibration file name | 0 - | |
| CAMPARAM | List[float] | Input camera-calibration parameters | 0 - | |
| TFILE * | str | Exterior orientation file name | 1 - | |
| MAPUNITS * | str | EO map units | 1 - 16 | |
| EOTYPE * | str | EO format | 1 - | |
| EOVDATUM * | str | EO vertical datum | 3 - | ELLIPS | MSL Default: MSL |
| ANGUNITS * | str | EO angle unit | 1 - 8 | DEGREES | GRADIANS | RADIANS | DMS |
| ROTKAPPA * | List[float] | Angle of rotation | 1 - 1 | Default: 0.0 |
| Back to top |
MFILE
The name of a folder, image file, or text file in which APMODEL segments are to be generated.
XMLI
This parameter is mutually exclusive with CAMPARAM.
The name of the XML file that contains the camera-calibration information.
For more information about the camera-calibration file, follow the link to CAMIMPORT under Related functions at the end of this topic.
CAMPARAM
This parameter is mutually exclusive with XMLI.
It contains a list of camera calibration values, all floating point (double) values.
If set, it must be given values for the first 3 entries: FOCAL LENGTH, CHIP SIZE WIDTH, and CHIP SIZE HEIGHT. The remaining entries can be omitted, and their default values will be used. If you need to set a specific entry, and don't have some of the previous entries, then you need to set all previous missing entries to their defaults. For example: if you have a YSCALE different than the default, then you need to set all previous CAMPARAM entries, either to their default or to the new value.
TFILE
The name of the exterior orientation (EO) file. You specify the content of this file (how it is structured) with the EOTYPE parameter.
MAPUNITS
The projection or map units of the EO values in the input EO file.
For a complete list of supported projections and Earth models, see Understanding map projections. For a description of the format of the map units string, see Output units.
EOTYPE
The EOTYPE defines the format of the input EO file.
Supported values are:
IDxxxxxxx dictates the order of the values of each line in the input EO file. Each line in the input EO file must contain seven or eight values: [ID] [C] [C] [C] [O] [O] [O] {T}
Examples:
image1 123456.12 2345678.9 1000.0 0.1 0.2 50.0
image1 1000.0 123456.12 2345678.9 50.0 0.2 0.1 2023-01-15T10:31:17.749Z
The basenames of each input file from the input file or folder are matched against consecutive IDs. Only files with an exact (case-insensitive) match between the file basename and an image ID are accepted for further processing.
EOVDATUM
The elevation/vertical datum of all elevation values in the exterior orientation file.
If the vertical datum of the DEM and the flying height of the camera differ, the EGM2008 geoid model is used for the conversions during orthorectification.
ANGUNITS
The unit of angle of the EO file.
You need only specify a value for this parameter when the value of the EOTYPE parameter is IDxxxxxxx.
ROTKAPPA
The angle of rotation to add to the input kappa values in the ANGUNITS parameter.
In some cases, the kappa values in the EO file must be rotated (such as 90, -90 or 180). Apply the correction by specifying the angle of rotation.
| Back to top |
Returns: execution status
Type: PCI_INT
| Back to top |
GENAPMODEL creates APMODEL segments for multiple PIX files. The input is a camera-calibration file in XML format and a text file that contains the EO value for each PIX file. This function supports BINGO, PAT-B, and user-defined EO formats. In some cases, the kappa values in the exterior orientation file are rotated at a constant value, such as 90, -90, or 180. It is possible to correct the kappa values by specifying a value for the ROTKAPPA parameter.
| Back to top |
Read EO data into the PIX file.
You have multiple files in PIX format and want to create an APMODEL segment for each file. The camera-calibration file is stored in the file camera.xml, and the EO values are stored in the file named eo.dat (input EO file). The format of the file is in the form of IDXYZWPK. A rotation of 100 grad is also applied to the kappa values stored in eo.dat.
from pci.genapmodel import genapmodel
mfile = "*.pix"
xmli = "camera.xml"
camparam = []
tfile = "eo.dat"
mapunits = "UTM 17 d0"
eotype = "IDXYZWPK"
eovdatum = "MSL"
angunits = "GRAD"
rotkappa = [100]
genapmodel( mfile, xmli, camparam, tfile, mapunits, eotype, eovdatum, angunits, rotkappa )
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.