| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Examples :: Related |
| Back to top |
| Back to top |
ihr(file, imstat)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILE * | str | Input file name | 1 - | |
| IMSTAT | List[float] | Image Statistics | 0 - 15 |
| Back to top |
FILE
Specifies the name of the PCIDSK image file from which header and georeferencing data are to be extracted.
IMSTAT
| Back to top |
IHR reads header and georeferencing data from the specified input file (FILI), and saves the retrieved data to the IMSTAT parameter.
| Back to top |
Get database header and georeferencing data from the demo database file irvine.pix, and print the values.
from pci.ihr import ihr file='irvine.pix' imstat=[] ihr( file, imstat ) print(imstat)
IMSTAT - Image Statistics > 512 512 10 9
1 0 0 32
30 30 1 428720
3734400 444080 3719040
The code shown below calculates the georeferenced location of the center of a specified database position (X,Y). Scaling factors (XSCALE,YSCALE) are calculated, given georeferenced locations of the upper-left and lower-right corners of the database, and the number of pixels and lines on the database.
from pci.ihr import ihr
def get_location(file_, x, y):
imstat=[]
ihr( file_, imstat )
xscale=(imstat[13]-imstat[11]) / imstat[0]
yscale=(imstat[13]-imstat[11]) / imstat[1]
print('Georeferenced X position = ' + imstat[11]+xscale*(x-0.5))
print('Georeferenced Y position = ' + imstat[12]+yscale*(y-0.5))
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.