luv_finder.mock

Synthetic ALMA observations of spectral-line sources via CASA simobserve.

Functions

resolve_antenna_config(name)

Absolute path to a CASA antenna configuration, by bare name or path.

source_from_grid(grid, source)

source with position, size and line width taken from a targeted grid.

Classes

MockObservation([cube_shape, dv, ...])

Build a line cube, observe it with simobserve, image it, and move the products.

class luv_finder.mock.MockObservation(cube_shape=(30, 256, 256), dv='100km/s', freq_center='40GHz', cell='0.25arcsec', sensitivity=None, integration_time=None, fits_filename=None, sources=None, direction='J2000 00h00m00.10 -40d00m00.00', ptg_file=None, alma_config='alma.cycle13.3.cfg', output_folder='output/ms_files', support_folder='support', seed=242, calibrate_snr=True, pointings=None, windows=None, image=True)[source]

Build a line cube, observe it with simobserve, image it, and move the products.

Parameters:
cube_shape(nchan, ny, nx)
dv, freq_center, cellstr with units, e.g. “100km/s”, “40GHz”, “0.25arcsec”
sensitivitystr or float, per-channel rms in Jy (ignored if integration_time given)
integration_timestr with units, e.g. “8min”
sourceslist of dict

position (dra, ddec) arcsec east and north; optional axis_maj/axis_min, the Gaussian FWHM in arcsec (the model’s bmaj/bmin, default a sigma of one cell), and pa, the major axis’ position angle in degrees east of north (default 0); line {width km/s, mean GHz, snr}; continuum {snr, index}, flux density propto (nu / freq_center)^index (default 0, flat), snr at freq_center.

alma_configstr

Bare name of a CASA antenna configuration, e.g. alma.cycle13.3.cfg, resolved from CASA’s own data directory.

calibrate_snrbool

Re-simulate once with the flux rescaled so that each line’s declared snr is its achieved matched-filter S/N. Doubles the runtime.

pointingslist of (dra, ddec), optional

Pointing centres in arcsec east and north of direction, observed in turn (a mosaic); default one pointing at direction.

windowslist of dict, optional

Spectral windows {freq_center, nchan}, each observed by its own simobserve of the same sky (its own noise, seed seed + k) and concatenated into one MS; default the cube’s own. The channel width in Hz (dv at freq_center) and the flux scale are shared.

imagebool

tclean the MSs and plot the maps (one window only).

achieved_snr() → list[float][source]

Optimal matched-filter S/N of each line source in the simulated data.

Uses the noiseless visibilities as the signal and the noisy weights as the noise model, so this is the expected S/N rather than one noisy draw. The template is the source itself, sqrt(sum_jk w Re[V’]^2), which the filter attains; for a point source it equals the channel-averaged S/N.

classmethod from_yaml(path: str, grid: dict | str | None = None, **overrides) → MockObservation[source]

Build from a YAML preset; grid sets the first source’s geometry (see source_from_grid()).

plot_results(plots_dir: str = 'plots') → None[source]

Line / continuum maps (noiseless, noisy, SNR) for every source.

simulate_observation() → None[source]

simobserve the cube, or every window’s cube and concat them (windows).

luv_finder.mock.resolve_antenna_config(name: str) → str[source]

Absolute path to a CASA antenna configuration, by bare name or path.

luv_finder.mock.source_from_grid(grid: dict | str, source: dict) → dict[source]

source with position, size and line width taken from a targeted grid.

grid is a grid YAML (or its dict) with one value per key.