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.
Pixel fluxes are softmax(log_brightness) over the pixels in
support: positive, summing to one, zero outside. Inside a
System it has a flux weight and offset like
any component, so unresolved sources stay analytic; visibilities are the
exact Fourier transform of the pixels, each a point at its centre. A
constant added to log_brightness changes nothing, so fit fixes it (a
free array comes back as log of the pixel fluxes); a pixel whose
optimum is zero flux can fit far below the rest (-1e3 or lower, set by
rounding): read an image from brightness, not from those values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_brightness
|
array-like, shape (nrow, ncol), or GaussianField
|
Log pixel fluxes up to a constant, oriented as
|
required |
pixel_scale_mas
|
float
|
Pixel size in mas; the image centre, index |
required |
support
|
array-like of bool
|
Pixels allowed to carry flux, same shape as |
None
|
flux
|
optional
|
As for any |
1.0
|
dra
|
optional
|
As for any |
1.0
|
ddec
|
optional
|
As for any |
1.0
|
rotation_deg
|
float
|
Position angle (North to East) of the grid's "up" axis (default 0);
matching |
0.0
|
ft
|
(auto, dft, nufft)
|
Transform for irregular uv points (default |
"auto"
|
blur_fwhm_mas
|
float
|
FWHM in mas of a fixed (not fitted) Gaussian blurring kernel in the
forward model: the data are compared with the blurred image, so the
pixels are the unblurred sky. Default |
None
|
smooth_fwhm_mas
|
float
|
Deprecated alias of |
required |
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)
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.