synthesizer.imaging.base_imaging

A base class to encompass common functionality for all imaging classes.

This class is not intended to be used directly, but rather as a base class for other imaging classes. It provides a common interface and shared functionality for all imaging related methods.

It mostly handles the attributes and operations related to the image’s/spectral cube’s resolution and dimensions but also provides some useful flagging properties and methods.

Classes

class synthesizer.imaging.base_imaging.ImagingBase(resolution, fov)[source]

A base class to encompass common functionality for all imaging classes.

This base classes handles the common geometry operations and related information. Of particular importance is the abstraction of angular vs cartesian unit systems.

cart_resolution

The spatial resolution of the image in Cartesian coordinates. If the image is in angular coordinates, this is None.

Type:

unyt_quantity

ang_resolution

The spatial resolution of the image in angular coordinates. If the image is in Cartesian coordinates, this is None.

Type:

unyt_quantity

cart_fov

The field of view of the image in Cartesian coordinates. If the image is in angular coordinates, this is None.

Type:

unyt_quantity

ang_fov

The field of view of the image in angular coordinates. If the image is in Cartesian coordinates, this is None.

Type:

unyt_quantity

npix

The number of pixels in the image. This is a 2D array with the number of pixels in each dimension.

Type:

np.ndarray

orig_resolution

The original resolution of the image in the units of the image. This is used to keep track of the original resolution when resampling the image.

Type:

unyt_quantity

orig_npix

The original number of pixels in the image. This is used to keep track of the original number of pixels when resampling the image.

Type:

np.ndarray

has_cartesian_units

True if the image has Cartesian units, False otherwise.

Type:

bool

has_angular_units

True if the image has angular units, False otherwise.

Type:

bool

fov

The field of view of the image in the units of the image. This is a property that returns the field of view in the units of the image.

Type:

unyt_quantity

resolution

The resolution of the image in the units of the image. This is a property that returns the resolution in the units of the image.

Type:

unyt_quantity

property fov

The field of view of the image.

property has_angular_units

Check if the image has angular units.

property has_cartesian_units

Check if the image has Cartesian units.

property resolution

The resolution of the image.

set_fov(fov)[source]

Set the field of view of the image.

This will also update the resolution and npix to reflect the new fov.

Note that this will be modified to ensure an integer number of pixels tessellate the image.

Parameters:

fov (unyt_quantity) – The new field of view of the image.

set_npix(npix)[source]

Set the number of pixels in the image.

This will also update the resolution and fov to reflect the new npix.

Parameters:

npix (int/tuple) – The new number of pixels in the image. If a single value is given then the image is assumed to be square.

set_resolution(resolution)[source]

Set the resolution of the image.

This will also update the FOV and npix to reflect the new resolution.

Parameters:

resolution (unyt_quantity) – The new resolution of the image.

abstract property shape

The shape of the image.

Examples using synthesizer.imaging.base_imaging.ImagingBase

Get sum of image inside an aperture

Get sum of image inside an aperture

Image addition example

Image addition example

Create image example

Create image example