Astronomical Signal Components

ast_signal.py — sky-signal components.

Components that put a sky into the model state, as opposed to ast_vis, which turns a sky into visibilities.

“Discrete” here means a discrete set of parametric sources — a catalogue of positions, fluxes and shapes — as opposed to the image-plane sky an ImageSky/ImageSkyVis pair would carry.

class tabascal.components.ast_signal.FixedDiscreteSky[source]

A fixed (non-fitted) sky of discrete sources — points and elliptical Gaussians.

Why this exists: a free per-antenna gain is only identifiable against a sky the gain cannot deform. Every other sky model here is flexible — the astronomical GP has per-baseline freedom, so g_p conj(g_q) * vis_ast is a reparametrisation of an already-free vis_ast and the gain is a flat direction of the likelihood. A source with a KNOWN position, flux and shape is rigid, so it anchors the gain. The gain component it is meant to be paired with is the constant-gain model of issue #124.

“Discrete” is the set of sources, not their size: a discrete source may be a point or an extended Gaussian. ImageSky is reserved for a sky carried as an image.

Sources come either as an inline list, in degrees and Jy:

ast:
  point_sources:
    - {name: Fornax A, ra: 50.6738, dec: -37.2083, I: 750.0,
       ref_freq_mhz: 154.0, alpha: -0.77}

or as a path to an OSKAR 12-column sky model file (see read_oskar_sky_model()):

ast:
  point_sources: /path/to/sky.osm

I is the flux at the reference frequency and the spectrum is the power law I(nu) = I * (nu / ref_freq)**alpha (alpha: 0 for a flat spectrum). A source with a non-zero major/minor FWHM is an elliptical Gaussian, with its position angle measured from north through east; zero FWHM is a point.

Writes ast_radec (n_src, 2) in radians, ast_I (n_src, n_freq) in Jy and ast_shape (n_src, 3) as (FWHM major, FWHM minor, position angle) in radians. Carries no free parameters and pairs with DiscreteSkyVis, which must be listed after it.

NOTE the flux is in the same scale as the data the model is fit to, so with a gain table (data calibrated to Jy) these are physical Jy. Without it, the data are in raw correlator units and a Jy catalogue flux is meaningless.

build_constants()[source]

Return arrays that do not change during the forward pass.

Returns a dict of array_name -> array_value. These will be stored in constants as “_c/<ClassName>/array_name” by Model.__init__.

build_forward()[source]

Build the forward computation function

setup(config)[source]

Initialize component with configuration

tabascal.components.ast_signal.INLINE_FIELDS = {'I': ('I', 'Stokes I flux in Jy'), 'Q': ('Q', 'Stokes Q flux in Jy'), 'U': ('U', 'Stokes U flux in Jy'), 'V': ('V', 'Stokes V flux in Jy'), 'alpha': ('alpha', 'spectral index, dimensionless'), 'dec': ('dec_deg', 'declination in degrees'), 'fwhm_major_arcsec': ('fwhm_major_arcsec', 'major-axis FWHM in arcsec'), 'fwhm_minor_arcsec': ('fwhm_minor_arcsec', 'minor-axis FWHM in arcsec'), 'position_angle_deg': ('position_angle_deg', 'position angle in degrees'), 'ra': ('ra_deg', 'right ascension in degrees'), 'ref_freq_mhz': ('ref_freq_hz', 'reference frequency in MHz'), 'rm': ('rm', 'rotation measure in rad/m^2')}

the OSKAR column each maps to, and a description of the value used when reporting a bad one. ra, dec and I are required; the rest default to zero. name is handled separately, as it is not a number.

Type:

The inline-YAML source fields

tabascal.components.ast_signal.OSKAR_COLUMNS = ('ra_deg', 'dec_deg', 'I', 'Q', 'U', 'V', 'ref_freq_hz', 'alpha', 'rm', 'fwhm_major_arcsec', 'fwhm_minor_arcsec', 'position_angle_deg')

The OSKAR sky model columns, in file order. Whitespace-separated text with # comments; trailing columns may be omitted and default to zero. This is the format Karabo emits.

tabascal.components.ast_signal.OSKAR_LEGACY_COLUMNS = ('ra_deg', 'dec_deg', 'I', 'Q', 'U', 'V', 'ref_freq_hz', 'alpha', 'fwhm_major_arcsec', 'fwhm_minor_arcsec', 'position_angle_deg')

the first eight modern columns followed by the Gaussian shape, with no rotation measure. It is not the modern layout truncated, so an 11-column row read as a modern one puts the major axis in the rotation-measure column and the shape one place left of where it belongs.

Type:

The legacy 11-column OSKAR layout

tabascal.components.ast_signal.POLARISATION_COLUMNS = ('Q', 'U', 'V', 'rm')

Parsed but not modelled. See _check_unpolarised().

tabascal.components.ast_signal.read_oskar_sky_model(path: str) list[source]

Read an OSKAR sky model file into a list of row dicts.

One source per line, fields separated by whitespace and/or commas, # starts a comment and blank lines are skipped. The columns are OSKAR_COLUMNS; a row may stop after any column from Stokes I onwards and the rest default to zero, so ra dec I is a valid flat-spectrum point source. An 11-column row is the legacy layout, OSKAR_LEGACY_COLUMNS.