arrakis.cutout

Produce cutouts from RACS cubes

Module Contents

Classes

CutoutArgs

Arguments for cutout function

Functions

big_cutout(→ List[pymongo.UpdateOne])

cli(→ None)

Command-line interface

cutout_image(→ pymongo.UpdateOne)

Perform a cutout.

cutout_islands(→ None)

Perform cutouts of RACS islands in parallel.

cutout_parser(→ argparse.ArgumentParser)

cutout_weight(→ pymongo.UpdateOne)

get_args(→ Union[List[CutoutArgs], None])

Get arguments for cutout function

main(→ None)

Main script

worker(host, epoch, beam, comps, outdir, image_name, ...)

Attributes

T

TQDM_OUT

class arrakis.cutout.CutoutArgs[source]

Bases: NamedTuple

Arguments for cutout function

dec_high: float[source]

Upper DEC bound in degrees

dec_low: float[source]

Lower DEC bound in degrees

outdir: str[source]

Output directory

ra_high: float[source]

Upper RA bound in degrees

ra_low: float[source]

Lower RA bound in degrees

arrakis.cutout.big_cutout(beams: List[Dict], beam_num: int, stoke: str, datadir: str, outdir: str, host: str, epoch: int, field: str, pad: float = 3, username: str | None = None, password: str | None = None, limit: int | None = None) List[pymongo.UpdateOne][source]
arrakis.cutout.cli() None[source]

Command-line interface

arrakis.cutout.cutout_image(image_name: str, data_in_mem: numpy.ndarray, old_header: astropy.io.fits.Header, cube: spectral_cube.SpectralCube, source_id: str, cutout_args: CutoutArgs, field: str, beam_num: int, stoke: str, pad=3, dryrun=False) pymongo.UpdateOne[source]

Perform a cutout.

Returns:

Update query for MongoDB

Return type:

pymongo.UpdateOne

arrakis.cutout.cutout_islands(field: str, directory: str, host: str, epoch: int, username: str | None = None, password: str | None = None, pad: float = 3, stokeslist: List[str] | None = None, dryrun: bool = True, limit: int | None = None) None[source]

Perform cutouts of RACS islands in parallel.

Parameters:
  • field (str) – RACS field name.

  • directory (str) – Directory to store cutouts.

  • host (str) – MongoDB host.

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

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

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

  • pad (int, optional) – Number of beamwidths to pad cutouts. Defaults to 3.

  • stokeslist (List[str], optional) – Stokes parameters to cutout. Defaults to None.

  • dryrun (bool, optional) – Do everything except write FITS files. Defaults to True.

arrakis.cutout.cutout_parser(parent_parser: bool = False) argparse.ArgumentParser[source]
arrakis.cutout.cutout_weight(image_name: str, source_id: str, cutout_args: CutoutArgs, field: str, stoke: str, beam_num: int, dryrun=False) pymongo.UpdateOne[source]
arrakis.cutout.get_args(comps: List[Dict], beam: Dict, island_id: str, outdir: str) List[CutoutArgs] | None[source]

Get arguments for cutout function

Parameters:
  • comps (List[Dict]) – List of mongo entries for RACS components in island

  • beam (Dict) – Mongo entry for the RACS beam

  • island_id (str) – RACS island ID

  • outdir (str) – Output directory

  • field (str) – RACS field name

  • datadir (str) – Input directory

  • stokeslist (List[str]) – List of Stokes parameters to process

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

Raises:
  • e – Exception

  • Exception – Problems with coordinates

Returns:

List of cutout arguments for cutout function

Return type:

List[CutoutArgs]

arrakis.cutout.main(args: argparse.Namespace) None[source]

Main script

Parameters:
  • args (argparse.Namespace) – Command-line args

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

arrakis.cutout.worker(host: str, epoch: int, beam: Dict, comps: List[Dict], outdir: str, image_name: str, data_in_mem: numpy.ndarray, old_header: astropy.io.fits.Header, cube: spectral_cube.SpectralCube, field: str, beam_num: int, stoke: str, pad: float = 3, username: str | None = None, password: str | None = None)[source]
arrakis.cutout.T[source]
arrakis.cutout.TQDM_OUT[source]