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¶
A basic structure used to describe a known catalogue. |
Functions¶
|
This is a stub function that will be expanded in the future. It |
|
|
|
Download all of the expected reference catalogue data that flint relies on |
|
Download a catalogue from the vizier catalogue service. The table |
|
|
|
Load in a known reference catalogue |
|
Attempt to deduce the appropriate column name from a set of |
|
List the known reference catalogues that are expected/downloaded by flint |
|
Attempt to load the set of reference catalogues to ensure they are correctly |
Module Contents¶
- class flint.catalogue.Catalogue[source]¶
Bases:
NamedTupleA 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.
- 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:
- 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_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:
ra
dec
peakflux
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