flint.catalogue

Utilities around catalogues.

Known reference catalogues are described by their ViZeR catalogue id, which are used to download and store the appropriately formed catalogues on disk. If the ViZeR service is down then attempts to download and form FITS catalgoues will fail. These only need to be downloaded once, provided they can be stored and retained on disk.

Attributes

Classes

Catalogue

A basic structure used to describe a known catalogue.

Functions

_guess_catalogue_type(→ Catalogue)

This is a stub function that will be expanded in the future. It

cli(→ None)

download_reference_catalogues(→ tuple[pathlib.Path, ...)

Download all of the expected reference catalogue data that flint relies on

download_vizier_catalogue(→ pathlib.Path)

Download a catalogue from the vizier catalogue service. The table

get_parser(→ argparse.ArgumentParser)

get_reference_catalogue(→ tuple[astropy.table.Table, ...)

Load in a known reference catalogue

guess_column_in_table(→ str)

Attempt to deduce the appropriate column name from a set of

list_known_reference_catalogues(→ None)

List the known reference catalogues that are expected/downloaded by flint

verify_reference_catalogues(→ bool)

Attempt to load the set of reference catalogues to ensure they are correctly

Module Contents

class flint.catalogue.Catalogue[source]

Bases: NamedTuple

A basic structure used to describe a known catalogue.

alpha_col: str | None = None[source]

Column name containing the spectral index, used to calculate the source SED. If None a default is used.

dec_col: str[source]

Column name containing the declination

file_name: str[source]

The file name of the known catalogue

flux_col: str[source]

Column name containing the flux density

freq: float[source]

Reference frequency of the catalogue, in Hertz

maj_col: str[source]

Column name containing the major-axis of the source gaussian component

min_col: str[source]

Column name containing the min-axis of the source gaussian component

name_col: str[source]

Column name containing the source/component name

pa_col: str[source]

Column name containing the pa of the source gaussian component

q_col: str | None = None[source]

Column name containing the curvature of the spectral index, used to calculate the source SED. If None a default is used.

ra_col: str[source]

Column name containing the right-ascension

survey: str[source]

Shorthand name of the sourcey catalogue

vizier_id: str | None = None[source]

The ID of the catalogue on Vizier that is used to download the catalogue

flint.catalogue._guess_catalogue_type(table: astropy.table.Table | pathlib.Path, survey: str = 'askap', file_name: str = 'askap.fit', freq: float = -1) Catalogue[source]

This is a stub function that will be expanded in the future. It is intended to guess the appropriate source finder that constructed a component catalogue, resolving issues around the column names.

This stub function will return a aegean catalogue description

Parameters:
  • table (Union[Table, Path]) – The table that will be inspected

  • survey (str, optional) – The name of the survey to use. Defaults to askap.

  • file_name (str, optional) – The file name that would be used for the catalogue. Defaults of askap.fits.

Returns:

Placeholder Catalogue representing Aegean catalogues

Return type:

Catalogue

flint.catalogue.cli() None[source]
flint.catalogue.download_reference_catalogues(reference_directory: pathlib.Path, dry_run: bool = False) tuple[pathlib.Path, Ellipsis][source]

Download all of the expected reference catalogue data that flint relies on

Parameters:
  • reference_directory (Path) – The parent directory catalgoues will be written to

  • dry_run (bool, optional) – If True, no downloading will take place. Defaults to False.

Returns:

Collection of paths of all the downloaded reference catalogues

Return type:

Tuple[Path, …]

flint.catalogue.download_vizier_catalogue(output_path: pathlib.Path, vizier_id: str, dry_run: bool = False) pathlib.Path[source]

Download a catalogue from the vizier catalogue service. The table will be obtained using astroquery and written out to the supplied output_path, from which the format is inferred.

Parameters:
  • output_path (Path) – Where the table will be written to

  • vizier_id (str) – The catalogue ID that will be downloaded

  • dry_run (bool, optional) – If True, no downloading will take place. Defaults to False.

Returns:

Path the file was written to

Return type:

Path

flint.catalogue.get_parser() argparse.ArgumentParser[source]
flint.catalogue.get_reference_catalogue(reference_directory: pathlib.Path, survey: str, verify: bool = True) tuple[astropy.table.Table, Catalogue][source]

Load in a known reference catalogue

If verify is True then the Catalogue.flux_col, if present, will have its units converted to Jy.

Parameters:
  • reference_directory (Path) – The path to the directory where reference catalogues were downloaded to

  • survey (str) – The name of the survey to load.

  • verify (bool, optional) – If True, the table column names are inspected to ensure they are correct. Defaults to True.

Raises:

ValueError – Raised when the requested survey is not known

Returns:

The loaded table and corresponding set of expected columns

Return type:

Tuple[Table, Catalogue]

flint.catalogue.guess_column_in_table(table: astropy.table.Table, column: str, guess_column: str | None = None) str[source]

Attempt to deduce the appropriate column name from a set of column names in a table. A lookup of known column names for different contexts if consulted. Available modes are:

  1. ra

  2. dec

  3. peakflux

  4. intflux

If guess_column is provided and is in the table this is returned

Parameters:
  • table (Table) – The table with the column names to inspect

  • column (str) – The type of the column we are attempting to deduce.

  • guess_column (Optional[str], optional) – Consider whether this column exists first. Defaults to None.

Raises:

ValueError – Raised when either the RA or Dec columns could not be figured out

Returns:

The names of the peak flux column

Return type:

str

flint.catalogue.list_known_reference_catalogues() None[source]

List the known reference catalogues that are expected/downloaded by flint

flint.catalogue.verify_reference_catalogues(reference_directory: pathlib.Path, load_catalogue: bool = True) bool[source]

Attempt to load the set of reference catalogues to ensure they are correctly formed

Parameters:
  • reference_directory (Path) – The directory containing the reference catalogues

  • load_catalogue (bool, optional) – Load the catalogue as part of verification. If False only check to see if the file exists. Defaults to True.

Returns:

Indicates whether all catalogue files exist and are correctly formed

Return type:

bool

flint.catalogue.KNOWN_REFERENCE_CATALOGUES: dict[str, Catalogue][source]
flint.catalogue.PREFERRED_COLUMNS[source]
flint.catalogue.PREFERRED_DEC_COLUMN_NAMES = ['DEJ2000', 'dec'][source]
flint.catalogue.PREFERRED_INT_COLUMN_NAMES = ['int_flux', 'Sint'][source]
flint.catalogue.PREFERRED_INT_ERR_COLUMN_NAMES = ['local_rms'][source]
flint.catalogue.PREFERRED_PEAK_COLUMN_NAMES = ['peak_flux', 'Sp'][source]
flint.catalogue.PREFERRED_RA_COLUMN_NAMES = ['RAJ2000', 'ra'][source]