Statistical measures#

swectral.make_img_func(func[, name_suffix])

Create a function from the given function that accepts image path only, fixing other parameters.

swectral.make_roi_func(func[, name_suffix])

Create a function from the given function that accepts only image path and region of interest (ROI) coordinates, fixing other parameters.

swectral.make_array_func(func[, name_suffix])

Create a function from the given function that accepts an array-like only, fixing other parameters.

swectral.roispec(image_path, roi_coordinates)

Extract spectra from a spectral image in a (multi-)polygon region of interest (ROI) defined with vertex coordinate pairs.

swectral.roi_mean(image_path, roi_coordinates)

Computes spectral mean of the provided region of interests (ROI) in the provided image.

swectral.roi_std(image_path, roi_coordinates)

Computes spectral mean of the provided region of interests (ROI) in the provided image.

swectral.roi_median(image_path, roi_coordinates)

Computes spectral mean of the provided region of interests (ROI) in the provided image.

swectral.Stats2d([axis, measure])

Statistical measure calculator for 2D array-like data.

swectral.nderiv(data_array_2d, n[, axis, ...])

Compute the n-th numerical derivative of 1D data series contained in a 2D array-like object.

swectral.moment2d(data_array_2d, n[, ...])

Compute the n-th statistical moment of 2D array-like data along a specified axis.

swectral.pixcount(image_path, roi_coordinates)

Count valid pixel number within a region of interest (ROI) within a threshold at a specific band.

swectral.bandquant(spec_array_2d, band, bins)

Compute quantile values of a specified spectral band from a 2D array-like spectral dataset.

swectral.spectral_angle_arr(spec_array_2d, ...)

Compute spectral angles between multiple spectra and a reference spectrum.

swectral.spectral_angle(spec_1, spec_2[, ...])

Compute the spectral angle between two one-dimensional spectra.

swectral.round_digit(value, sig_digit[, mode])

Round values or values in arraylike to specified significant digits.