FRD2P

Reduction to pole filter


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

Back to top

Description


Applies a reduction to pole filter to a potential field image. The filter is applied in the frequency domain. A 2-D Fast Fourier transformation (FFT) is first applied to the image. After filtering, the image is transformed back to the spatial domain.
Back to top

Parameters


frd2p(fili, filo, dbic, dboc, dbiw, dbow, srcang, regang, filb)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO * str Output file name 1 -    
DBIC * List[int] Input potential field channel 1 - 1  
DBOC * List[int] Output filtered image channel 1 - 1  
DBIW List[int] Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
DBOW List[int] Raster output window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
SRCANG * List[float] Source field direction angles 2 - 2 0 - 180
Default: 30
REGANG * List[float] Regional field direction angles 2 - 2  
FILB str Buffer file name 0 -    

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the PCIDSK file from which image data is read.

FILO

Specifies the name of the PCIDSK file to receive the transformed image data.

The output file can be the same as the input file. The specified output file must exist before running FRD2P.

DBIC

Specifies the input channels containing the potential fields to use in the transformation.

DBOC

Specifies the output channel to receive the filtered image data.

DBIW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) read from the input image. If this parameter is not specified, the entire image is processed by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

DBOW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) to be output. If this parameter is not specified, the entire layer is output by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

Note: The window offset (Xoffset, Yoffset) may be different, but the window size (Xsize, Ysize) must be the same as the specified input window size (DBIW).

SRCANG

Specifies, in degrees, the inclination and azimuth angles of the source magnetic field. Default values for both angles are 30.0.

REGANG

Specifies, in degrees, the inclination and azimuth angles of the regional magnetic field. Default values for both angles are 30.0.

FILB

Optionally specifies the name of the temporary buffer file.

Because this function uses large amounts of RAM, a temporary buffer file is automatically created for large images. This parameter records the name of the buffer file created by FCONT. Typically, no user interaction is required for this parameter.

Back to top

Details

FRD2P applies the reduction to pole filter to a potential field image. The filter is applied in the frequency domain. The image is transformed using a 2-D Fast Fourier transformation (FFT), then transformed back to the spatial domain after filtering.

Because this function does not require the entire image to be loaded into memory, there is no limit on the size of input image. If necessary, the function automatically creates a buffer file, if FILB is not specified. The buffer file name is recorded in FILB for efficiently reusing the buffer in another run.

This function is most efficient if the input window has dimensions of a power of 2; otherwise, FCONT must pad extra rows and columns to force the image dimensions a power of 2.

Back to top

Example

from pci.frd2p import frd2p

fili	=	'magfield.pix'	# input file
filo	=	'magfield.pix'	# output file
dbic	=	[1]	# potential fields channel
dboc	=	[2]	# output filtered channel
dbiw	=	[]	# process entire image
dbow	=	[]	# output entire image
srcang	=	[90,0]	# source field direction angles
regang	=	[45,60]	# regional field direction angles
filb	=	''	# default, no buffer file specified

frd2p( fili, filo, dbic, dboc, dbiw, dbow, srcang, regang, filb )
Back to top

Algorithm

The input image is first transformed to frequency domain using 2-D FFT. The dimensions of the transformed image are power of 2 and are at least as large as the input image dimensions. After applying the filter, the frequency image is transformed back to the spatial domain and truncated to the input image size.

The reduction to pole filter has the following form:

        f^2 / [c1 f + i(a1 u + b1 v)] [c2 f + i(a2 u + b2 v)]
where:

The filter gain at u=v=0 is undefined. A value of 1.0 is inserted. The resolution of u, v are given as:

        Delta_u = 1/(SizeU * Delta_x)
        Delta_v = 1/(SizeV * Delta_y)
where:

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