Quality analysis core functions
Functions
| allclose(a, b[, rtol, atol]) | Returns True if two arrays are element-wise equal within a tolerance. |
| any(a[, axis, out]) | Test whether any array element along a given axis evaluates to True. |
| arange | arange([start,] stop[, step,], dtype=None) |
| argmax(a[, axis]) | Indices of the maximum values along an axis. |
| argsort(a[, axis, kind, order]) | Returns the indices that would sort an array. |
| array | array(object, dtype=None, copy=True, order=None, subok=False, ndmin=True) |
| asarray(a[, dtype, order]) | Convert the input to an array. |
| atleast_1d(*arys) | Convert inputs to arrays with at least one dimension. |
| barthann(M[, sym]) | Return the M-point modified Bartlett-Hann window. |
| bartlett(M[, sym]) | The M-point Bartlett window. |
| blackman(M[, sym]) | The M-point Blackman window. |
| blackmanharris(M[, sym]) | The M-point minimum 4-term Blackman-Harris window. |
| bohman(M[, sym]) | The M-point Bohman window. |
| boxcar(M[, sym]) | The M-point boxcar window. |
| chebwin(M, at[, sym]) | Dolph-Chebyshev window. |
| cmplx_sort(p) | sort roots based on magnitude. |
| compute_image_stats(image) | Compute simple image statistics. |
| compute_radiometric_stats(image) | Compute simple radiometric statistics. |
| concatenate | concatenate((a1, a2, ...), axis=0) |
| convolve(in1, in2[, mode]) | Convolve two N-dimensional arrays. |
| convolve2d(in1, in2[, mode, boundary, fillvalue]) | Convolve two 2-dimensional arrays. |
| correlate(in1, in2[, mode]) | Cross-correlate two N-dimensional arrays. |
| correlate2d(in1, in2[, mode, boundary, ...]) | Cross-correlate two 2-dimensional arrays. |
| deconvolve(signal, divisor) | Deconvolves divisor out of signal. |
| detrend(data[, axis, type, bp]) | Remove linear trend along axis from data. |
| dot | dot(a, b) |
| enl(image) | |
| expand_dims(a, axis) | Expand the shape of an array. |
| extract(condition, arr) | Return the elements of an array that satisfy some condition. |
| extract_cuts(data[, axis, az_rotation_flag, ...]) | It returns the data cuts. |
| factorial(n[, exact]) | n! = special.gamma(n+1) |
| fft(x[, n, axis, overwrite_x]) | |
| fft2(x[, shape, axes, overwrite_x]) | |
| fftconvolve(in1, in2[, mode]) | Convolve two N-dimensional arrays using FFT. See convolve. |
| fftn(x[, shape, axes, overwrite_x]) | fftn(x, shape=None, axes=None, overwrite_x=0) -> y |
| filtfilt(b, a, x) | |
| flattop(M[, sym]) | The M-point Flat top window. |
| flipud(m) | Flip array in the up/down direction. |
| gaussian(M, std[, sym]) | Return a Gaussian window of length M with standard-deviation std. |
| general_gaussian(M, p, sig[, sym]) | Return a window with a generalized Gaussian shape. |
| get_window(window, Nx[, fftbins]) | Return a window of length Nx and type window. |
| hamming(M[, sym]) | The M-point Hamming window. |
| hann(M[, sym]) | The M-point Hanning window. |
| hanning(M[, sym]) | The M-point Hanning window. |
| hilbert(x[, N]) | Compute the analytic signal. |
| hilbert2(x[, N]) | Compute the ‘2-D’ analytic signal of x of length N. |
| ifft(x[, n, axis, overwrite_x]) | ifft(x, n=None, axis=-1, overwrite_x=0) -> y |
| ifft2(x[, shape, axes, overwrite_x]) | ifft2(x, shape=None, axes=(-2,-1), overwrite_x=0) -> y |
| ifftn(x[, shape, axes, overwrite_x]) | ifftn(x, s=None, axes=None, overwrite_x=0) -> y |
| ifftshift(x[, axes]) | Inverse of fftshift. |
| interpolate2d(input_matrix[, ...]) | Returns the input matrix interpolated by a factor. |
| invres(r, p, k[, tol, rtype]) | Compute b(s) and a(s) from partial fraction expansion: r,p,k |
| invresz(r, p, k[, tol, rtype]) | Compute b(z) and a(z) from partial fraction expansion: r,p,k |
| irf_shape_1d(input_array[, resolution]) | Return the IRF Shape -6dB/-3dB and -10dB/-3dB. |
| irf_shape_2d(input_matrix[, resolution]) | Return the IRF Shape -6dB/-3dB and -10dB/-3dB ratios along X and |
| iscomplexobj(x) | Return True if x is a complex type or an array of complex numbers. |
| islr_1d(input_array[, resolution]) | Return [ISLR, Main lobe energy, Side lobe energy]. |
| islr_2d(input_matrix[, resolution]) | Return the 2 dimensional - ISLR Integrated Side Lobe Ratio parameter. |
| isscalar(num) | Returns True if the type of num is a scalar type. |
| kaiser(M, beta[, sym]) | Return a Kaiser window of length M with shape parameter beta. |
| lfilter(b, a, x[, axis, zi]) | Filter data along one-dimension with an IIR or FIR filter. |
| lfilter_zi(b, a) | |
| lfiltic(b, a, y[, x]) | Given a linear filter (b,a) and initial conditions on the output y and the input x, return the inital conditions on the state vector zi which is used by lfilter to generate the output given the input. |
| linspace(start, stop[, num, endpoint, retstep]) | Return evenly spaced numbers over a specified interval. |
| local_maxima(input_array) | Return the two arrays with the positions and corresponding values of the local maxima computed on the input array. |
| local_maxima_tpz(input_array[, max_index]) | Return the 4 1d arrays with the positions and corresponding values of the local maxima on the left and on the right side of the absolute array maximum. |
| main_lobe_width(v[, factor, precision, kind]) | Returns the main lobe width of the input array. |
| main_lobe_width2(v[, factor, precision, kind]) | Returns the main lobe width of the input array. |
| matrix_squint_rotation(input_matrix[, ...]) | Return the matrix anti-clockwise rotated according to the angle value. |
| matrix_squint_rotation2(input_matrix[, ...]) | Return the matrix anti-clockwise rotated according to the angle value. |
| max(a[, axis, out]) | Return the maximum along an axis. |
| mean(a[, axis, dtype, out]) | Compute the arithmetic mean along the specified axis. |
| medfilt(volume[, kernel_size]) | Perform a median filter on an N-dimensional array. |
| medfilt2d(input[, kernel_size]) | Median filter two 2-dimensional arrays. |
| min(a[, axis, out]) | Return the minimum along an axis. |
| nuttall(M[, sym]) | A minimum 4-term Blackman-Harris window according to Nuttall. |
| ones(shape[, dtype, order]) | Return a new array of given shape and type, filled with ones. |
| order_filter(a, domain, rank) | Perform an order filter on an N-dimensional array. |
| parzen(M[, sym]) | The M-point Parzen window. |
| poly(seq_of_zeros) | Return polynomial coefficients given a sequence of roots. |
| polyadd(a1, a2) | Returns sum of two polynomials. |
| polyder(p[, m]) | Return the derivative of the specified order of a polynomial. |
| polydiv(u, v) | Returns the quotient and remainder of polynomial division. |
| polymul(a1, a2) | Returns product of two polynomials represented as sequences. |
| polysub(a1, a2) | Returns difference from subtraction of two polynomials input as sequences. |
| polyval(p, x) | Evaluate a polynomial at specific values. |
| power_balance(data[, fft_flag]) | It estimates the central frequency of the input data spectrum. |
| power_balance2d(data[, axis, fft_flag]) | It estimates the central frequency of the input data spectrum. |
| prod(a[, axis, dtype, out]) | Return the product of array elements over a given axis. |
| product(a[, axis, dtype, out]) | Return the product of array elements over a given axis. |
| pslr_1d(input_array[, resolution, sslr_flag]) | Return a tuple with the left and right PSLR. |
| pslr_2d(input_matrix[, resolution]) | Return a tuple with the left and right PSLR value per axis. |
| radiometric_res(image) | |
| rank(a) | Return the number of dimensions of an array. |
| ravel(a[, order]) | Return a flattened array. |
| real(val) | Return the real part of the elements of the array. |
| real_if_close(a[, tol]) | If complex input returns a real array if complex parts are close to zero. |
| remez(numtaps, bands, desired[, weight, Hz, ...]) | Calculate the minimax optimal filter using Remez exchange algorithm. |
| resample(x, num[, t, axis, window, freq_shift]) | Resample to num samples using Fourier method along the given axis. |
| reshape(a, newshape[, order]) | Gives a new shape to an array without changing its data. |
| residue(b, a[, tol, rtype]) | Compute partial-fraction expansion of b(s) / a(s). |
| residuez(b, a[, tol, rtype]) | Compute partial-fraction expansion of b(z) / a(z). |
| resolution1d(v[, precision, kind]) | Returns the resolution of the input array. |
| resolution2d(input_matrix[, precision, kind]) | Returns the resolution of the input matrix in x and y direction. |
| roots(p) | Return the roots of a polynomial with coefficients given in p. |
| scipy_fft(x[, n, axis, overwrite_x]) | Return discrete Fourier transform of arbitrary type sequence x. |
| scipy_fft2(x[, shape, axes, overwrite_x]) | fft2(x, shape=None, axes=(-2,-1), overwrite_x=0) -> y |
| size(a[, axis]) | Return the number of elements along a given axis. |
| slepian(M, width[, sym]) | Return the M-point slepian window. |
| smooth_image(im) | |
| sort(a[, axis, kind, order]) | Return a sorted copy of an array. |
| sslr_1d(input_array[, resolution]) | Return a tuple with the left and right SSLR value (respect of the absolute |
| sslr_2d(input_matrix[, resolution]) | Return a tuple with the left and right SSLR value per axis. |
| sum(a[, axis, dtype, out]) | Return the sum of array elements over a given axis. |
| take(a, indices[, axis, out, mode]) | Take elements from an array along an axis. |
| target_measures(data[, az_rotation_flag, ...]) | It computes all the target analisys parameters. |
| transpose(a[, axes]) | Permute the dimensions of an array. |
| triang(M[, sym]) | The M-point triangular window. |
| unique(x) | Return the sorted, unique elements of an array or sequence. |
| unique_roots(p[, tol, rtype]) | Determine the unique roots and their multiplicities in two lists |
| where | where(condition, [x, y]) |
| wiener(im[, mysize, noise]) | Perform a Wiener filter on an N-dimensional array. |
| zeropadding1d(X, num[, shift]) | Returns the num-length input array zero padded. |
| zeropadding2d(X, num[, axis, shift]) | Returns the input 2-d array zero padded along the input axis. |
| zeros | zeros(shape, dtype=float, order=’C’) |
Classes
| OrderedDict(*args, **kwds) |
Compute simple image statistics.
| Input : |
|
|---|---|
| Output : |
|
Compute simple radiometric statistics.
| Input : |
|
|---|---|
| Output : |
|
It returns the data cuts.
| Parameters : |
|---|
data : 2d matrix
axis: it it specifies the axis along which the algorithm must be perfomed
- axis == 0: zero padding along the columns (azimuth)
- axis == 1: zero padding along the rows (range)
| Output : | (row cut, column cut) == (azimuth cut, range cut) |
|---|
Returns the input matrix interpolated by a factor.
| Parameters : |
|---|
Note
the interpolation of the input matrix as result of the application of the Fourier (zero padding) 2D interpolation.
Return the IRF Shape -6dB/-3dB and -10dB/-3dB.
| Parameters : |
|---|
| Output : |
|---|
Note
estimate the ratio of the resolution measured at two different attenuation levels of the main lobe. The output result is a tuple containing the IRF Shape -6dB/-3dB and -10dB/-3dB ratios. In case of unattended values of resolution, it returns None.
Return the IRF Shape -6dB/-3dB and -10dB/-3dB ratios along X and Y axis around the absolute maximum value.
| Parameters : |
|---|
| Output : |
|---|
Note
estimate the ratio of the resolution measured at two different attenuation levels of the main lobe. The output result is a tuple containing the IRF Shape -6dB/-3dB and -10dB/-3dB ratios along X and Y axis. In case of unattended values of resolution, it returns None.
Return [ISLR, Main lobe energy, Side lobe energy].
| Parameters : |
|---|
| Output : |
|---|
ISLR [dB]: Integrated Side Lobe Ratio
Main Lobe Energy: energy in [peak pos - res: peak pos + res]
defined in [peak pos - 10*res: peak pos + 10*res] minus the Main Lobe Energy
Note
compute the ratio of the energy in the side lobes (outside 2 resolution cells and within 20 resolution cells from the absolute maximum) to the energy of the main lobe. In case the input array dimension is not enough to compute the ISLR, the value is set to None.
Return the 2 dimensional - ISLR Integrated Side Lobe Ratio parameter.
| Parameters : |
|---|
| Output : |
|---|
Note
compute the ratio of the energy in the side lobes (outside a box of 2x2 resolution cells and within a box of 20x20 resolution cells from the absolute maximum) to the energy of the main lobe. In case the input array dimension is not enough to compute the ISLR values, it returns None.
Return the two arrays with the positions and corresponding values of the local maxima computed on the input array.
| Parameters : |
|---|
Note
the function calculates the first derivative and the second derivative of the input array function. The local maxima are detected finding the zeros of the first derivative function with the correspondent value of the second derivative lower than zero. if (f’(x) == 0) and (f’‘(x)<0) then x = x_max
Return the 4 1d arrays with the positions and corresponding values of the local maxima on the left and on the right side of the absolute array maximum.
| Parameters : |
|---|
| Output : |
|---|
Note
the function implements an iterative method to find out the local maxima.
Returns the main lobe width of the input array.
| Parameters : |
|---|
| Output : |
|---|
Note
the main lobe width is computed considering as:: limit values = peak value * factor.
Returns the main lobe width of the input array.
| Parameters : |
|---|
| Output : |
|---|
Note
the main lobe width is computed considering as:: limit values = peak value * factor.
Return the matrix anti-clockwise rotated according to the angle value.
| Parameters : |
|---|
input_matrix : 2-d array
In case it is not set, then it is computed*.
‘1’: range direction ‘0’: azimuth direction
| Output : |
|---|
Note
in case the squint angle is not set, then it is computed by a fitting algorithm which aims to find the angle rotation introduced by the squint.
Return the matrix anti-clockwise rotated according to the angle value.
| Parameters : |
|---|
input_matrix : 2-d array
In case it is not set, then it is computed*.
‘1’: range direction ‘0’: azimuth direction
| Output : |
|---|
Note
in case the squint angle is not set, then it is computed by a fitting algorithm which aims to find the angle rotation introduced by the squint.
It estimates the central frequency of the input data spectrum.
| Parameters : |
|---|
data : 1d array - it can be a time domain signal or a signal spectrum fft_flag : boolean value
- True: the data input is already in fft domain (spectrum)
- False: the dat input is a time domain signal
| Output : | The cetral frequency of the data spectrum expressed as sample index. |
|---|
It estimates the central frequency of the input data spectrum.
| Parameters : |
|---|
data : 2d array - it can be a time domain signal or a signal spectrum
| Output : | The cetral frequency of the data spectrum expressed as sample index. |
|---|
Return a tuple with the left and right PSLR.
| Parameters : |
|---|
| Output : |
|---|
Note
in case the PSLR can not be computed, the value is set to None. The definition of PSLR has been taken from document CSM-UGS-STD-SPE-0084-2.1 pg.43.
Return a tuple with the left and right PSLR value per axis.
| Parameters : |
|---|
input_matrix : 2-d array
[X axis resolution, Y axis resolution]. In case it is not set, then it is computed
| Output : |
|---|
Note
the PSRL value is computed respect to the absolute maximum value of the input matrix, which must be bidimensional. In case the PSLR can not be computed, the value is set to None.
Resample to num samples using Fourier method along the given axis.
| Parameters : |
|---|
x: input array (multidimensional)
num: output length of the resampled array along the given axis
t: see Notes (it’s forced to None if freq_shift != 0.0)
window: see Notes
spectrum), it can be an array of shift positions.
| Output : |
|---|
Note
the resampled signal starts at the same value of x but is sampled with a spacing of len(x) / num * (spacing of x). Because a Fourier method is used, the signal is assumed periodic.
Window controls a Fourier-domain window that tapers the Fourier spectrum before zero-padding to aleviate ringing in the resampled values for sampled signals you didn’t intend to be interpreted as band-limited.
If window is a string then use the named window. If window is a float, then it represents a value of beta for a kaiser window. If window is a tuple, then the first component is a string representing the window, and the next arguments are parameters for that window.
‘blackman’ (‘black’, ‘blk’) ‘hamming’ (‘hamm’, ‘ham’) ‘bartlett’ (‘bart’, ‘brt’) ‘hanning’ (‘hann’, ‘han’) ‘kaiser’ (‘ksr’) # requires parameter (beta) ‘gaussian’ (‘gauss’, ‘gss’) # requires parameter (std.) ‘general gauss’ (‘general’, ‘ggs’) # requires two parameters
(power, width)
The first sample of the returned vector is the same as the first sample of the input vector, the spacing between samples is changed from dx to
dx * len(x) / num
If t is not None, then it represents the old sample positions, and the new sample positions will be returned as well as the new samples.
Returns the resolution of the input array.
| Parameters : |
|---|
The waveform must be passed as amplitude values. It can be a complex array.
kind: kind of interpolation
| Output : |
|---|
Note
the resolution is computed as the main lobe peak width at -3dB.
Returns the resolution of the input matrix in x and y direction.
| Parameters : |
|---|
The waveform must be passed as amplitude values. It can be a complex matrix.
precision: the required precision of the measure
kind: kind of interpolation
| Output : |
|---|
Note
the resolution is computed as the main lobe peak width at -3dB along both X and Y axis.
Return a tuple with the left and right SSLR value (respect of the absolute maximum of the input array).
| Parameters : |
|---|
| Output : |
|---|
Note
in case the SSLR can not be computed, the value is set to None.
Return a tuple with the left and right SSLR value per axis.
| Parameters : |
|---|
| Output : |
|---|
Note
the PSRL value is computed respect to the absolute maximum value of the input matrix, which must be bidimensional. In case the PSLR can not be computed, the value is set to None.
It computes all the target analisys parameters.
| Parameters : |
|
|---|---|
| Output : |
|
Returns the num-length input array zero padded.
| Parameters : |
|---|
Note
the zero padding fills up the output array till reaching the length ‘num’. The zeros will be inserted in:
- (N+1)/2 + shift*N from the left side
- -(N-1)/2 + shift*N from the right side
Returns the input 2-d array zero padded along the input axis.
| Parameters : |
|---|
X: 2d array.
num: int output length of the X array along the input axis.
a single value in case a costant shift is required.
Note
the zero padding fills up the output array till reaching the length ‘num’ along the specified axis: in case the axis == 0 then the zero padding is performed along the columns, i.e. the number of rows changes to num; in case the axis == 1 then the zero padding is performed along the rows, i.e. the number of columns changes to num.