Skip to content

eo_tools.S1.util

boxcar(img, dimaz, dimrg)

Apply a boxcar filter to an image.

Parameters:

Name Type Description Default
img complex or real array

Input image with arbitrary number of dimensions, shape (naz, nrg, ...).

required
dimaz float

Size in azimuth of the filter.

required
dimrg float

Size in range of the filter.

required

Returns:

Type Description

complex or real array: Filtered image, shape (naz, nrg, ...).

Note

The filter is always applied along 2 dimensions (azimuth, range). Please ensure to provide a valid image.

presum(img, m, n)

Computes the m by n presummed image.

Parameters:

Name Type Description Default
img array - like

Input image array with shape (naz, nrg,...).

required
m int

Number of lines to sum. Must be an integer >= 1.

required
n int

Number of columns to sum. Must be an integer >= 1.

required

Raises:

Type Description
TypeError

If m or n are not integers.

ValueError

If m or n are less than 1, or if m > img.shape[0] or n > img.shape[1].

Returns:

Name Type Description
array

Presummed image array with shape (M, N,...), where M and N are the largest multiples of m and n that are less than or equal to img.shape[0] and img.shape[1], respectively.

Note: Returns the input array if m==1 and n==1.

remap(img, rr, cc, kernel='bicubic')

Resample an image using row, column lookup tables

Parameters:

Name Type Description Default
img array

image to resample (complex is allowed)

required
rr array

lookup table for row positions

required
cc array

lookup table for column positions

required
kernel str

Kernel type ("nearest", "bilinear", "bicubic" -- 4 point, "bicubic6" -- 6 point). Defaults to "bicubic".

'bicubic'

Returns:

Name Type Description
array

Resampled image with same dimensions as rr and cc.