RESAMP

Resample image or bitmap


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

Back to top

Description


Resamples the input image or bitmap file and creates a new file of a different resolution.
Back to top

Parameters


resamp(fili, dbic, dbsl, sltype, filo, ftype, foptions, pxszout, resample)

Name Type Caption Length Value range
FILI* str Input file name 1 -    
DBIC List[int] Input raster channels 0 -    
DBSL List[int] Input segments 0 - 48  
SLTYPE* str Segment list data types 3 -   See Details
Default: ALL
FILO* str Output file name 1 -    
FTYPE str Format of output file 0 - 4 Default: PIX
FOPTIONS str Options for output format 0 -    
PXSZOUT* List[float] Ground size of output pixel 1 - 2  
RESAMPLE* str Resampling method 3 -   NEAR | BILIN | CUBIC | AVERA | MODE | BITFRAC[=<frac_val>]
Default: NEAR

* Required parameter
Back to top

Parameter descriptions

FILI

The name of the input GDB-format file to resample.

DBIC

The input channels to resample.

DBSL

The input segment or segments to write to the output file. Bitmap, Rational Function math model and Incidence Angle array segments are resampled. Other segment types, such as vectors, LUTs, and pseudocolor tables (PCT) are copied to the output file.

SLTYPE

The GDB-supported data types for any input segments specified.

Each segment of any of the following types (specified with a segment number for DBSL) is processed. Bitmap, Rational Function math model and Incidence Angle array segments are resampled. Other types of segment-held data are copied to the output file. If you do not specify a value for DBSL, ALL is applied for SLTYPE.

The following GDB-format types are supported:
The following example specifies segments 1, 3, and 5 for segment types vector and LUT. If a vector data type exists in segments 1 and 3 only, and a LUT type in segment 5, the result is VEC 1, 3 and LUT 5. A standard PCIDSK file does not support more than one type per segment; however, other file types may support multiple types per segment. Therefore, if vector data exists in segments 1, 3, and 5 and LUT data exists in segment 3, the result is VEC 1, 3, 5 and LUT 3.
DBSL    =   1,3,5
SLTYPE  =   VEC, LUT

FILO

The name of the output file to which to write the resampled data.

FTYPE

The format of the output file.

The format must be one of the following GDB-updatable types:

The default value is PIX.

FOPTIONS

The options specific to the format to apply when creating the output file. With each, the default of no options is allowed (empty string).

Typically, the available options for a format include a compression scheme, format subtype, or other information.

For information about the available options for each supported format, see:

PXSZOUT

The output resolution of one pixel in the X and Y (easting and northing) dimensions.

When you specify only one value, it applies to both resolutions in the X and Y (easting and northing) dimensions.

The size units for the PXSZOUT values are those of the input projection. If the input projection is Long/Lat, you must specify the the pixel-size coordinates in decimal degrees. With nonprojection georeferencing, such as meter or feet, the pixel size is expressed in these units.

For example, to resample a meter-based UTM projection to a pixel resolution of 30 by 30 meters, enter 30,30.

RESAMPLE

The resampling method to use to determine the output pixel values.

You can specify one of the following:
Back to top

Details

RESAMP changes the resolution of all raster input (imagery and bitmaps). Rational Function math model and Incidence Angle array segments are also resampled, while other segment types are simply transferred from the input file to the output file.

Note: Rational Function math model resampling is only supported for SAR datasets which have appropiate metadata.

Resampling downward decreases the resolution; resampling upward increases the resolution.

You can run RESAMP to convert multiple data sets of various resolutions to a resolution you specify. For example, when using the overlay functionality, all the data sets must be resampled to a common resolution value.

RESAMP will copy any file-level and channel-level metadata to the output file.

BITFRAC is a downsampling method for bitmaps and cannot be used when processing raster channels.

A value between 0 and 1 can be specified to define minimal fractional part of pixels set in original resolution before output pixel can be set as well. For example, resample="BITFRAC=0.75" means that a pixel in the output bitmap will be set to one (1) only if at least three-quarters of its area is covered by set (1-valued) pixels in the input bitmap. If nothing is specified then default value of 0.5 is used. 0 is a special value which means that just one input pixel is enough for the output value to be set. 1 means all input pixels must be set for the output pixel to be set as well.

Note: If necessary, you can resample data that is in a pixel projection. The default size is 1 by 1 pixel. When resampling upward, the output x and y pixel size values must be greater than 1. (A specified value of 2,2 combines 4 pixels into 1 pixel.) When resampling downward, the value specified must be less than 1. (A specified value of 0.5,0.5 divides each pixel into 4 pixels.)
Back to top

Example

from pci.resamp import *

fili    =   "irvine.pix"
dbic    =   [1,2,3]
dbsl    =   [25,26]
sltype  =   "ALL"
filo    =   "test.pix"
ftype   =   "PIX"
foptions    = ' '
pxszout =   [1.2, 1.2]  # output with a 1.2 meter resolution
resample    =   "CUBIC" # Cubic-convolution method

resamp( fili, dbic, dbsl, sltype, filo, ftype, foptions, pxszout, resample )
            

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