arrakis.linmos ============== .. py:module:: arrakis.linmos .. autoapi-nested-parse:: Run LINMOS on cutouts in parallel .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: arrakis.linmos.TQDM_OUT Classes ------- .. autoapisummary:: arrakis.linmos.ImagePaths Functions --------- .. autoapisummary:: arrakis.linmos.cli arrakis.linmos.find_images arrakis.linmos.genparset arrakis.linmos.get_yanda arrakis.linmos.linmos arrakis.linmos.linmos_parser arrakis.linmos.main arrakis.linmos.serial_loop arrakis.linmos.smooth_images Module Contents --------------- .. py:class:: ImagePaths Bases: :py:obj:`NamedTuple` Class to hold image paths .. !! processed by numpydoc !! .. py:attribute:: images :type: list[pathlib.Path] List of image paths .. !! processed by numpydoc !! .. py:attribute:: weights :type: list[pathlib.Path] List of weight paths .. !! processed by numpydoc !! .. py:function:: cli() Command-line interface .. !! processed by numpydoc !! .. py:function:: find_images(field: str, beams_row: tuple[int, pandas.Series], stoke: str, datadir: pathlib.Path) -> ImagePaths Find the images and weights for a given field and stokes parameter :Parameters: * **field** (*str*) -- Field name. * **beams** (*dict*) -- Beam information. * **stoke** (*str*) -- Stokes parameter. * **datadir** (*Path*) -- Data directory. :raises Exception: If no files are found. :returns: List of images and weights. :rtype: ImagePaths .. !! processed by numpydoc !! .. py:function:: genparset(image_paths: ImagePaths, stoke: str, datadir: pathlib.Path, holofile: pathlib.Path | None = None) -> str Generate parset for LINMOS :Parameters: * **image_paths** (*ImagePaths*) -- List of images and weights. * **stoke** (*str*) -- Stokes parameter. * **datadir** (*Path*) -- Data directory. * **holofile** (*Path, optional*) -- Path to the holography file to include in the bind list. Defaults to None. :raises Exception: If no files are found. :returns: Path to parset file. :rtype: str .. !! processed by numpydoc !! .. py:function:: get_yanda(version='1.3.0') -> str Pull yandasoft image from dockerhub. :Parameters: **version** (*str, optional*) -- Yandasoft version. Defaults to "1.3.0". :returns: Path to yandasoft image. :rtype: str .. !! processed by numpydoc !! .. py:function:: linmos(parset: str | None, fieldname: str, image: str, holofile: pathlib.Path) -> pymongo.UpdateOne | None Run linmos :Parameters: * **parset** (*str*) -- Path to parset file. * **fieldname** (*str*) -- Name of RACS field. * **image** (*str*) -- Name of Yandasoft image. * **holofile** (*Path*) -- Path to the holography file to include in the bind list. :raises Exception: If LINMOS fails. :raises Exception: LINMOS output not found. :returns: Mongo update object. :rtype: pymongo.UpdateOne .. !! processed by numpydoc !! .. py:function:: linmos_parser(parent_parser: bool = False) -> argparse.ArgumentParser .. py:function:: main(field: str, datadir: pathlib.Path, host: str, epoch: int, sbid: int | None = None, holofile: pathlib.Path | None = None, username: str | None = None, password: str | None = None, yanda: str = '1.3.0', yanda_img: pathlib.Path | None = None, stokeslist: list[str] | None = None, limit: int | None = None) -> None LINMOS flow :Parameters: * **field** (*str*) -- RACS field name. * **datadir** (*str*) -- Data directory. * **host** (*str*) -- MongoDB host IP. * **holofile** (*str*) -- Path to primary beam file. * **username** (*str, optional*) -- Mongo username. Defaults to None. * **password** (*str, optional*) -- Mongo password. Defaults to None. * **yanda** (*str, optional*) -- Yandasoft version. Defaults to "1.3.0". * **yanda_img** (*Path, optional*) -- Path to a yandasoft singularirt image. If `None`, the container version `yanda` will be downloaded. Defaults to None. * **stokeslist** (*List[str], optional*) -- Stokes parameters to process. Defaults to None. * **limit** (*int, optional*) -- Limit the number of islands to process. Defaults to None. .. !! processed by numpydoc !! .. py:function:: serial_loop(field: str, beams_row: tuple[int, pandas.Series], stokeslist: list[str], cutdir: pathlib.Path, holofile: pathlib.Path, image: pathlib.Path) -> list[pymongo.UpdateOne | None] .. py:function:: smooth_images(image_dict: dict[str, ImagePaths]) -> dict[str, ImagePaths] Smooth cubelets to a common resolution :Parameters: **image_list** (*ImagePaths*) -- List of cubelets to smooth. :returns: Smoothed cubelets. :rtype: ImagePaths .. !! processed by numpydoc !! .. py:data:: TQDM_OUT