Skip to content

Image: pixelised brightness

A pixel image is one more component of a System, for image reconstruction. Its visibilities are the exact Fourier transform of the pixels.

virgil.models.Image

Bases: Component

Pixelised brightness distribution, for image reconstruction.

The pixel fluxes are brightness = softmax(log_brightness) taken over the pixels in support: positive, summing to one, and exactly zero outside the support. Like any other component, the image has a flux weight and an offset inside a System, so unresolved sources can stay analytic (e.g. a PointSource star) while resolved emission goes in the pixels.

Visibilities are the exact Fourier transform of the pixels, each treated as a point at its centre.

Parameters:

Name Type Description Default
log_brightness array-like, shape (nrow, ncol), or GaussianField

Log pixel fluxes, up to an additive constant, in the orientation of render: row 0 is the top (North) and column 0 the left (East) of the image. Alternatively an object with an evaluate(pixel_scale_mas) method returning them, such as a GaussianField (a Gaussian-process prior on the log-brightness).

required
pixel_scale_mas float

Pixel size in milliarcseconds. The image centre, at index ((nrow - 1) / 2, (ncol - 1) / 2), is at (dra, ddec).

required
support array-like of bool

Pixels allowed to carry flux (default: all); see circular_support.

None
flux (float, array - like or Spectrum)

Weight relative to the other components of a System (default 1).

1.0
dra float

Offset of the image centre in milliarcseconds, positive to the East and North.

0.0
ddec float

Offset of the image centre in milliarcseconds, positive to the East and North.

0.0
rotation_deg float

Position angle (North to East) of the pixel grid's "up" axis, so that pixels can follow a detector rather than the sky; default 0 (North up). An image whose rotation matches the uv lattice of its data (data.uv_grid.rotation_deg, e.g. AMI data at their parallactic angle) is transformed with an exact two-sided matrix Fourier transform, which is much faster.

0.0

Examples:

>>> image = Image(np.zeros((32, 32)), pixel_scale_mas=2.0)
>>> envelope = Image.from_model(GaussianDisk(sigma=8.0), 32, 2.0, flux=0.3)
>>> scene = System(star=PointSource(), env=envelope)

brightness property

Pixel fluxes: positive, unit sum, zero outside support.

eta property

The log-brightness array, evaluated if it is a field.

from_brightness(brightness, pixel_scale_mas, *, floor=1e-06, **kwargs) classmethod

Build an image from non-negative pixel fluxes.

Pixels fainter than floor times the brightest are raised to that level, so that their logarithm is finite. Other keyword arguments (support, flux, dra, ddec, rotation_deg) go to Image.

from_model(model, npix, pixel_scale_mas, **kwargs) classmethod

Pixelise a model, e.g. a parametric fit, as a starting image.

The pixels sample model on an npix x npix grid (rotated by rotation_deg, if given); see from_brightness for the keyword arguments.

virgil.models.circular_support(npix, pixel_scale_mas, radius_mas, inner_radius_mas=0.0)

Pixels of an npix x npix image within radius_mas of its centre.

Returns a boolean array for the support of an Image. With inner_radius_mas, pixels closer to the centre than that are left out too: a hole under an analytic star, so that the image cannot pile flux onto it.