arrakis.makecat

Make an Arrakis catalogue

Attributes

TQDM_OUT

Classes

SpectralIndices

Functions

add_metadata(vo_table, filename)

Add metadata to VO Table for CASDA

cat_parser(→ argparse.ArgumentParser)

cli()

Command-line interface

combinate(→ Tuple[arrakis.utils.typing.ArrayLike, ...)

Return all combinations of data with itself

compute_local_rm_flag(→ astropy.table.Table)

Compute the local RM flag

cuts_and_flags(→ arrakis.utils.typing.TableLike)

Cut out bad sources, and add flag columns

fix_blank_units(→ arrakis.utils.typing.TableLike)

Fix blank units in table

flag_blended_components(→ arrakis.utils.typing.TableLike)

Identify blended components in a catalogue and flag them.

get_alpha(→ SpectralIndices)

get_fit_func(→ Tuple[Callable, matplotlib.pyplot.Figure])

Fit an envelope to define leakage sources

get_integration_time(cat, field_col[, sbid])

is_leakage(→ bool)

Determine if a source is leakage

lognorm_from_percentiles(x1, p1, x2, p2)

Return a log-normal distribuion X parametrized by:

main(→ None)

Make a catalogue from the Arrakis database flow

replace_nans(filename)

Replace NaNs in a XML table with a string

sigma_add_fix(→ arrakis.utils.typing.TableLike)

update_tile_separations(→ arrakis.utils.typing.TableLike)

Update the tile separations in the catalogue

write_votable(→ None)

Module Contents

class arrakis.makecat.SpectralIndices[source]

Bases: NamedTuple

alphas: numpy.ndarray[source]
alphas_err: numpy.ndarray[source]
betas: numpy.ndarray[source]
betas_err: numpy.ndarray[source]
arrakis.makecat.add_metadata(vo_table: astropy.io.votable.tree.VOTableFile, filename: str)[source]

Add metadata to VO Table for CASDA

Parameters:

vo_table (vot) – VO Table object

Returns:

VO Table object with metadata

Return type:

vot

arrakis.makecat.cat_parser(parent_parser: bool = False) argparse.ArgumentParser[source]
arrakis.makecat.cli()[source]

Command-line interface

arrakis.makecat.combinate(data: arrakis.utils.typing.ArrayLike) Tuple[arrakis.utils.typing.ArrayLike, arrakis.utils.typing.ArrayLike][source]

Return all combinations of data with itself

Parameters:

data (ArrayLike) – Data to combine.

Returns:

Data_1 matched with Data_2

Return type:

Tuple[ArrayLike, ArrayLike]

arrakis.makecat.compute_local_rm_flag(good_cat: astropy.table.Table, big_cat: astropy.table.Table) astropy.table.Table[source]

Compute the local RM flag

Parameters:
  • good_cat (Table) – Table with just good RMs

  • big_cat (Table) – Overall table

Returns:

Table with local RM flag

Return type:

Table

arrakis.makecat.cuts_and_flags(cat: arrakis.utils.typing.TableLike, leakage_degree: int = 4, leakage_bins: int = 16, leakage_snr: float = 30.0) arrakis.utils.typing.TableLike[source]

Cut out bad sources, and add flag columns

A flag of ‘True’ means the source is bad.

Parameters:

cat (rmt) – Catalogue to cut and flag

arrakis.makecat.fix_blank_units(rmtab: arrakis.utils.typing.TableLike) arrakis.utils.typing.TableLike[source]

Fix blank units in table

Parameters:

rmtab (TableLike) – TableLike

arrakis.makecat.flag_blended_components(cat: arrakis.utils.typing.TableLike) arrakis.utils.typing.TableLike[source]

Identify blended components in a catalogue and flag them.

Parameters:

cat (TableLike) – Input catalogue

Returns:

Output catalogue with minor components flagged

Return type:

TableLike

arrakis.makecat.get_alpha(cat: arrakis.utils.typing.TableLike) SpectralIndices[source]
arrakis.makecat.get_fit_func(tab: arrakis.utils.typing.TableLike, nbins: int = 21, offset: float = 0.002, degree: int = 2, do_plot: bool = False, high_snr_cut: float = 30.0) Tuple[Callable, matplotlib.pyplot.Figure][source]

Fit an envelope to define leakage sources

Parameters:
  • tab (TableLike) – Catalogue to fit

  • nbins (int, optional) – Number of bins along seperation axis. Defaults to 21.

Returns:

3rd order polynomial fit.

Return type:

Callable

arrakis.makecat.get_integration_time(cat: rmtable.RMTable, field_col: pymongo.collection.Collection, sbid: int | None = None)[source]
arrakis.makecat.is_leakage(frac: float, sep: float, fit: Callable) bool[source]

Determine if a source is leakage

Parameters:
  • frac (float) – Polarised fraction

  • sep (float) – Separation from tile centre

  • fit (function) – Fitting function

Returns:

True if source is leakage

Return type:

bool

arrakis.makecat.lognorm_from_percentiles(x1, p1, x2, p2)[source]

Return a log-normal distribuion X parametrized by:

P(X < p1) = x1 P(X < p2) = x2

arrakis.makecat.main(field: str, host: str, epoch: int, sbid: int | None = None, leakage_degree: int = 4, leakage_bins: int = 16, leakage_snr: float = 30.0, username: str | None = None, password: str | None = None, verbose: bool = True, outfile: str | None = None) None[source]

Make a catalogue from the Arrakis database flow

Parameters:
  • field (str) – RACS field name

  • host (str) – MongoDB host IP

  • username (str, optional) – Mongo username. Defaults to None.

  • password (str, optional) – Mongo password. Defaults to None.

  • verbose (bool, optional) – Verbose output. Defaults to True.

  • outfile (str, optional) – Output file name. Defaults to None.

  • cat_format (str, optional) – Type of catalogue .e.g. fits. Defaults to None.

arrakis.makecat.replace_nans(filename: str)[source]

Replace NaNs in a XML table with a string

Parameters:

filename (str) – File name

arrakis.makecat.sigma_add_fix(tab: arrakis.utils.typing.TableLike) arrakis.utils.typing.TableLike[source]
arrakis.makecat.update_tile_separations(rmtab: arrakis.utils.typing.TableLike, field_col: pymongo.collection.Collection) arrakis.utils.typing.TableLike[source]

Update the tile separations in the catalogue

Parameters:
  • rmtab (TableLike) – Table to update

  • field_col (Collection) – Field collection

Returns:

Updated table

Return type:

TableLike

arrakis.makecat.write_votable(rmtab: arrakis.utils.typing.TableLike, outfile: str) None[source]
arrakis.makecat.TQDM_OUT[source]