arrakis.cutout
Produce cutouts from RACS cubes
Attributes
Classes
Arguments for cutout function |
Functions
|
|
|
Command-line interface |
|
Perform a cutout. |
|
Flow to cutout islands in parallel. |
|
|
|
|
|
Get arguments for cutout function |
|
Main script |
|
Module Contents
- arrakis.cutout.big_cutout(sources: pandas.DataFrame, comps: pandas.DataFrame, beam_num: int, stoke: str, datadir: pathlib.Path, outdir: pathlib.Path, host: str, epoch: int, field: str, pad: float = 3, username: str | None = None, password: str | None = None, limit: int | None = None, dryrun: bool = False) list[pymongo.UpdateOne] [source]
- arrakis.cutout.cutout_image(lock: threading.Lock, image_name: pathlib.Path, data_in_mem: numpy.ndarray, old_header: astropy.io.fits.Header, cube: spectral_cube.SpectralCube, source_id: str, cutout_args: CutoutArgs | None, field: str, beam_num: int, stoke: str, pad: float = 3, dryrun: bool = False) pymongo.UpdateOne [source]
Perform a cutout.
- Returns:
Update query for MongoDB
- Return type:
pymongo.UpdateOne
- arrakis.cutout.cutout_islands(field: str, directory: pathlib.Path, host: str, epoch: int, sbid: int | None = None, 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]
Flow to cutout islands in parallel.
- Parameters:
field (str) – RACS field name.
directory (Path) – Directory to store cutouts.
host (str) – MongoDB host.
username (str, optional) – Mongo username. Defaults to None.
password (str, optional) – Mongo password. Defaults to None.
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_weight(image_name: pathlib.Path, source_id: str, cutout_args: CutoutArgs | None, field: str, stoke: str, beam_num: int, dryrun=False) pymongo.UpdateOne [source]
- arrakis.cutout.get_args(comps: pandas.DataFrame, source: pandas.Series, outdir: pathlib.Path) CutoutArgs | None [source]
Get arguments for cutout function
- Parameters:
comps (pd.DataFrame) – List of mongo entries for RACS components in island
beam (Dict) – Mongo entry for the RACS beam
island_id (str) – RACS island ID
outdir (Path) – Input directory
- 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
- arrakis.cutout.make_cutout(lock: threading.Lock, host: str, epoch: int, source: pandas.Series, comps: pandas.DataFrame, outdir: pathlib.Path, image_name: pathlib.Path, 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, dryrun: bool = False)[source]