karabo.imaging.imager_base

Overview

This package defines base classes from which the specialised image classes are derived.

Classes

class DirtyImagerConfig(imaging_npixel: int, imaging_cellsize: float, combine_across_frequencies: bool = True)

Base class for the config / parameters of a dirty imager.

Contains basic parameters common across all dirty imagers. Inherit and add parameters specific to a dirty imager implementation.

Attributes:

imaging_npixel (int): Image size imaging_cellsize (float): Scale of a pixel in radians combine_across_frequencies (bool): Whether or not to combine images

across all frequency channels into one image. Defaults to True.

__init__(imaging_npixel: int, imaging_cellsize: float, combine_across_frequencies: bool = True) None
class DirtyImager

Abstract base class for a dirty imager.

A dirty imager creates dirty images from visibilities.

abstract create_dirty_image(visibility: Visibility, /, *, output_fits_path: Path | str | None = None) Image

Creates a dirty image from a visibility.

Args:
visibility: Visibility object

from which to create the dirty image. Contains the visibilities of an observation.

output_fits_path: Path to write the dirty image to.

Example: /tmp/dirty.fits. If None, will be set to a temporary directory and a default file name. Defaults to None.

Returns:

Image: Dirty image

class DirtyImagerConfig(imaging_npixel: int, imaging_cellsize: float, combine_across_frequencies: bool = True)

Base class for the config / parameters of a dirty imager.

Contains basic parameters common across all dirty imagers. Inherit and add parameters specific to a dirty imager implementation.

Attributes:

imaging_npixel (int): Image size imaging_cellsize (float): Scale of a pixel in radians combine_across_frequencies (bool): Whether or not to combine images

across all frequency channels into one image. Defaults to True.

__init__(imaging_npixel: int, imaging_cellsize: float, combine_across_frequencies: bool = True) None
class ImageCleanerConfig(imaging_npixel: int, imaging_cellsize: float)

Base class for the config / parameters of an image cleaner.

Contains basic parameters common across all image cleaners. Inherit and add parameters specific to an image cleaner implementation.

Attributes:

imaging_npixel (int): Image size imaging_cellsize (float): Scale of a pixel in radians

__init__(imaging_npixel: int, imaging_cellsize: float) None
class ImageCleaner

Abstract base class for an image cleaner.

An image cleaner creates clean images from dirty images or directly from visibilities, in that case including the dirty imaging process.

abstract create_cleaned_image(visibility: Visibility, /, *, dirty_fits_path: Path | str | None = None, output_fits_path: Path | str | None = None) Image

Creates a clean image from a dirty image or from visibilities.

Arguments:

visibility: Visibility from which a clean image should be created. dirty_fits_path: Path to dirty image FITS file that

should be reused to create a clean image. If None, dirty image will be created first from the visibilities. Defaults to None.

output_fits_path: Path to write the clean image to.

Example: /tmp/restored.fits. If None, will be set to a temporary directory and a default file name. Defaults to None.

Returns:

Image: Clean image