bashes.features module

class bashes.features.AbsFeatureCalculator(nfeatures)

Bases: object

Feature calculator abstract base class.

nfeatures

int

The number of features to calculate.

Parameters:nfeatures (int) – The number of features to calculate.
getFeatureTransform(psf)

Returns a matrix that transforms pixel values to features.

Parameters:psf (galsim.GSObject) – The psf model for the corresponding image.
class bashes.features.FourierMoments(stampSize, pixelScale, sigma)

Bases: bashes.features.AbsFeatureCalculator

Calculates fourier domain moment features.

Parameters:
  • stampSize (int) – The postage stamp size in pixels.
  • pixelScale (int) – The postage stamp pixel scale.
  • sigma (float,None) – The Gaussian weight function sigma. A value of None indicates that sigma should be calculated on-the-fly (not supported yet).
getFeatureTransform(psf)

Returns a matrix that transforms pixel values to features.

Parameters:psf (galsim.GSObject) – The psf model for the corresponding image.
class bashes.features.PixelFeatures(stampSize)

Bases: bashes.features.AbsFeatureCalculator

Simple pixel feature calculator.

nfeatures

int

The total number of pixels.

Parameters:stampSize (int) – The postage stamp size in pixels.
getFeatureTransform(psf)

Returns a matrix that transforms pixel values to features.

Parameters:psf (galsim.GSObject) – The psf model for the corresponding image.
bashes.features.circularize(image)

Returns the azimuthally averaged 2d image about the center.

Parameters:image (np.ndarray) – Square 2D image.
bashes.features.fourierMatrix(n)

Returns the fourier transform matrix for a square 2d matrix of size n. The following are equivalent:

fourierMatrix(self.stampSize).dot(image.flatten()) np.fft.fft2(image).flatten()
Parameters:n (int) – Square image size.
bashes.features.main()