virgil.scenes
Synthetic truth images for testing image reconstructions: simulate data from a known scene with your own coverage and noise before trusting an image of real data.
Synthetic truth images for testing image reconstructions.
Each function returns a unit-sum (npix, npix) array in the virgil
image orientation (East left, North up, centre at the middle of the pixel
grid, as in render), ready for Image.from_brightness.
Position angles run North to East. The ring and spiral shapes are inspired by
the training scenes of Jonah Goldfine's frito
(https://github.com/JonahDG/frito), re-implemented here in virgil
conventions.
ring(npix, pixel_scale_mas, radius_mas, width_mas, inc_deg=0.0, pa_deg=0.0, asymmetry=0.0, asymmetry_pa_deg=0.0)
Gaussian-profile ring, optionally inclined and azimuthally modulated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
npix
|
int
|
Number of pixels on a side. |
required |
pixel_scale_mas
|
float
|
Pixel size in milliarcseconds. |
required |
radius_mas
|
float
|
Radius of the ring's peak in milliarcseconds (the semi-major axis when inclined). |
required |
width_mas
|
float
|
Standard deviation of the radial profile in milliarcseconds. |
required |
inc_deg
|
float
|
Inclination in degrees; 0 is face-on, and the minor axis is
|
0.0
|
pa_deg
|
float
|
Position angle of the major axis, North to East, in degrees. |
0.0
|
asymmetry
|
float
|
Amplitude (0 to 1) of the modulation
|
0.0
|
asymmetry_pa_deg
|
float
|
Position angle, North to East, of the brightest part of the ring, in degrees. |
0.0
|
Returns:
| Type | Description |
|---|---|
(Array, shape(npix, npix))
|
The ring, summing to one. |
spiral(npix, pixel_scale_mas, step_mas, width_mas, turns=2.0, pa_deg=0.0, fade_mas=None)
Archimedean spiral, like the dust pinwheels of WR 104 and WR 137.
The arm is r = step_mas * theta / (2 pi), starting at the centre and
winding towards increasing position angle as it moves outwards.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
npix
|
int
|
Number of pixels on a side. |
required |
pixel_scale_mas
|
float
|
Pixel size in milliarcseconds. |
required |
step_mas
|
float
|
Radial distance between successive turns, in milliarcseconds. |
required |
width_mas
|
float
|
Standard deviation of the Gaussian cross-section, measured along the radial direction, in milliarcseconds. |
required |
turns
|
float
|
Number of turns of the arm, which ends in a rounded cap. |
2.0
|
pa_deg
|
float
|
Position angle, North to East, of the start of the arm, in degrees. |
0.0
|
fade_mas
|
float
|
If given, the brightness falls off as |
None
|
Returns:
| Type | Description |
|---|---|
(Array, shape(npix, npix))
|
The spiral, summing to one. |
gaussian_blob(npix, pixel_scale_mas, sigma_mas, dra=0.0, ddec=0.0)
Circular Gaussian, e.g. a clump or a resolved companion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
npix
|
int
|
Number of pixels on a side. |
required |
pixel_scale_mas
|
float
|
Pixel size in milliarcseconds. |
required |
sigma_mas
|
float
|
Standard deviation in milliarcseconds. |
required |
dra
|
float
|
Offset of the centre from the image centre in milliarcseconds, positive to the East and North. |
0.0
|
ddec
|
float
|
Offset of the centre from the image centre in milliarcseconds, positive to the East and North. |
0.0
|
Returns:
| Type | Description |
|---|---|
(Array, shape(npix, npix))
|
The blob, summing to one. |