arrakis.makecat

Make an Arrakis catalogue

Module Contents

Functions

add_metadata(vo_table, filename)

Add metadata to VO Table for CASDA

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(→ rmtable.RMTable)

Cut out bad sources, and add flag columns

fix_blank_units(→ arrakis.utils.typing.TableLike)

Fix blank units in table

flag_blended_components(→ rmtable.RMTable)

Identify blended components in a catalogue and flag them.

get_alpha(cat)

get_fit_func(→ Tuple[numpy.polynomial.Polynomial.fit, ...)

Fit an envelope to define leakage sources

get_integration_time(cat, field_col, epoch)

is_leakage(frac, sep, fit)

Determine if a source is leakage

lognorm_from_percentiles(x1, p1, x2, p2)

Return a log-normal distribuion X parametrized by:

main(→ None)

Main

replace_nans(filename)

Replace NaNs in a XML table with a string

sigma_add_fix(tab)

write_votable(→ None)

Attributes

TQDM_OUT

arrakis.makecat.add_metadata(vo_table: astropy.io.votable.tree.Table, 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.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: rmtable.RMTable) rmtable.RMTable[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: rmtable.RMTable) rmtable.RMTable[source]

Identify blended components in a catalogue and flag them.

Parameters:

cat (RMTable) – Input catalogue

Returns:

Output catalogue with minor components flagged

Return type:

RMTable

arrakis.makecat.get_alpha(cat)[source]
arrakis.makecat.get_fit_func(tab: astropy.table.Table, nbins: int = 21, offset: float = 0.002, degree: int = 2, do_plot: bool = False, high_snr_cut: float = 30.0) Tuple[numpy.polynomial.Polynomial.fit, matplotlib.pyplot.Figure][source]

Fit an envelope to define leakage sources

Parameters:
  • tab (Table) – Catalogue to fit

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

Returns:

3rd order polynomial fit.

Return type:

np.polynomial.Polynomial.fit

arrakis.makecat.get_integration_time(cat: rmtable.RMTable, field_col: pymongo.collection.Collection, epoch: int)[source]
arrakis.makecat.is_leakage(frac, sep, fit)[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: str, username: str | None = None, password: str | None = None, verbose: bool = True, outfile: str | None = None) None[source]

Main

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)[source]
arrakis.makecat.write_votable(rmtab: arrakis.utils.typing.TableLike, outfile: str) None[source]
arrakis.makecat.TQDM_OUT[source]