arrakis.cutout ============== .. py:module:: arrakis.cutout .. autoapi-nested-parse:: Produce cutouts from RACS cubes .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: arrakis.cutout.T arrakis.cutout.TQDM_OUT Classes ------- .. autoapisummary:: arrakis.cutout.CutoutArgs Functions --------- .. autoapisummary:: arrakis.cutout.big_cutout arrakis.cutout.cli arrakis.cutout.cutout_image arrakis.cutout.cutout_islands arrakis.cutout.cutout_parser arrakis.cutout.cutout_weight arrakis.cutout.get_args arrakis.cutout.main arrakis.cutout.make_cutout Module Contents --------------- .. py:class:: CutoutArgs Bases: :py:obj:`NamedTuple` Arguments for cutout function .. !! processed by numpydoc !! .. py:attribute:: dec_high :type: float Upper DEC bound in degrees .. !! processed by numpydoc !! .. py:attribute:: dec_low :type: float Lower DEC bound in degrees .. !! processed by numpydoc !! .. py:attribute:: outdir :type: pathlib.Path Output directory .. !! processed by numpydoc !! .. py:attribute:: ra_left :type: float Upper RA bound in degrees .. !! processed by numpydoc !! .. py:attribute:: ra_right :type: float Lower RA bound in degrees .. !! processed by numpydoc !! .. py:function:: 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] .. py:function:: cli() -> None Command-line interface .. !! processed by numpydoc !! .. py:function:: 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 Perform a cutout. :returns: Update query for MongoDB :rtype: pymongo.UpdateOne .. !! processed by numpydoc !! .. py:function:: 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 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. .. !! processed by numpydoc !! .. py:function:: cutout_parser(parent_parser: bool = False) -> argparse.ArgumentParser .. py:function:: cutout_weight(image_name: pathlib.Path, source_id: str, cutout_args: CutoutArgs | None, field: str, stoke: str, beam_num: int, dryrun=False) -> pymongo.UpdateOne .. py:function:: get_args(comps: pandas.DataFrame, source: pandas.Series, outdir: pathlib.Path) -> CutoutArgs | None 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 :raises Exception: Problems with coordinates :returns: List of cutout arguments for cutout function :rtype: List[CutoutArgs] .. !! processed by numpydoc !! .. py:function:: main(args: argparse.Namespace) -> None Main script :Parameters: **args** (*argparse.Namespace*) -- Command-line args .. !! processed by numpydoc !! .. py:function:: 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) .. py:data:: T .. py:data:: TQDM_OUT