beams module

Provide classes to represent the beam of a radio telescope.

class martini.beams.GaussianBeam(bmaj: Quantity, Unit("arcsec")]=<Quantity 15. arcsec>, bmin: Quantity, Unit("arcsec")]=<Quantity 15. arcsec>, bpa: Quantity, Unit("deg")]=<Quantity 0. deg>, truncate: float = 4.0)[source]

Bases: _BaseBeam

Implement a Gaussian beam model.

Parameters:
  • bmaj (Quantity) – Quantity, with dimensions of angle. Beam major axis (FWHM) angular size.

  • bmin (Quantity) – Quantity, with dimensions of angle. Beam minor axis (FWHM) angular size.

  • bpa (Quantity) – Quantity, with dimensions of angle. Beam position angle (East of North).

  • truncate (float) – Number of FWHM at which to truncate the beam image.

f_kernel() Callable[[float | ndarray, float | ndarray], Quantity][source]

Return a function defining the beam amplitude as a function of position.

The model implemented is a 2D Gaussian with FWHM’s specified by bmaj and bmin and orientation by bpa.

Returns:

Accepts 2 arguments (both of ndarray type) and return an ndarray of corresponding size.

Return type:

callable

init_beam_header() None[source]

Do nothing - beam header initialized in __init__ for this class.

init_kernel(datacube: DataCube) None

Calculate the required size of the beam image.

Parameters:

datacube (DataCube) – Data cube to use, cube size is required for pixel size, position & velocity centroids.

kernel_size_px() tuple[int, int][source]

Return a 2-tuple specifying the half-size of the beam image to be initialized.

Size measured in pixels.

Returns:

2-tuple, each element an integer, specifying the kernel size (x, y) in pixels.

Return type:

tuple

needs_pad() tuple[int, int]

Determine the padding of the datacube required by the beam.

The beam should be padded enough to prevent edge effects during convolution.

Returns:

2-tuple, each element an integer, containing pad dimensions (x, y).

Return type:

tuple