arrakis.linmos

Run LINMOS on cutouts in parallel

Module Contents

Classes

ImagePaths

Class to hold image paths

Functions

cli()

Command-line interface

find_images(→ ImagePaths)

Find the images and weights for a given field and stokes parameter

genparset(→ str)

Generate parset for LINMOS

get_yanda(→ str)

Pull yandasoft image from dockerhub.

linmos(→ Optional[pymongo.UpdateOne])

Run linmos

main(→ None)

Main script

smooth_images(→ Dict[str, ImagePaths])

Smooth cubelets to a common resolution

class arrakis.linmos.ImagePaths[source]

Bases: NamedTuple

Class to hold image paths

images: List[pathlib.Path][source]

List of image paths

weights: List[pathlib.Path][source]

List of weight paths

arrakis.linmos.cli()[source]

Command-line interface

arrakis.linmos.find_images(field: str, beams: dict, stoke: str, datadir: pathlib.Path) ImagePaths[source]

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.

Return type:

ImagePaths

arrakis.linmos.genparset(image_paths: ImagePaths, stoke: str, datadir: pathlib.Path, holofile: pathlib.Path | None = None) str[source]

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.

Return type:

str

arrakis.linmos.get_yanda(version='1.3.0') str[source]

Pull yandasoft image from dockerhub.

Parameters:

version (str, optional) – Yandasoft version. Defaults to “1.3.0”.

Returns:

Path to yandasoft image.

Return type:

str

arrakis.linmos.linmos(parset: str | None, fieldname: str, image: str, holofile: pathlib.Path) pymongo.UpdateOne | None[source]

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.

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

Raises:
  • Exception – If LINMOS fails.

  • Exception – LINMOS output not found.

Returns:

Mongo update object.

Return type:

pymongo.UpdateOne

arrakis.linmos.main(field: str, datadir: pathlib.Path, host: str, epoch: int, 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[source]

Main script

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.

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

arrakis.linmos.smooth_images(image_dict: Dict[str, ImagePaths]) Dict[str, ImagePaths][source]

Smooth cubelets to a common resolution

Parameters:

image_list (ImagePaths) – List of cubelets to smooth.

Returns:

Smoothed cubelets.

Return type:

ImagePaths