mirar.catalog.base package

Base classes for the catalog system.

Submodules

mirar.catalog.base.base_catalog module

Module for Catalog base class

class mirar.catalog.base.base_catalog.ABCatalog(search_radius_arcmin: float)[source]

Bases: object

Abstract class for catalog objects

property abbreviation

Abbreviation for naming catalog files

class mirar.catalog.base.base_catalog.BaseCatalog(*args, min_mag: float, max_mag: float, filter_name: str, cache_catalog_locally: bool = False, catalog_cachepath_key: str = 'RFCTPATH', **kwargs)[source]

Bases: ABCatalog, ABC

Base class for catalog objects Attributes:

min_mag: Minimum magnitude for stars in catalog max_mag: Maximum magnitude for stars in catalog filter_name: Filter name for catalog cache_catalog_locally: Whether to cache catalog locally? catalog_cachepath_key: Header key that stores the full path to the cached catalog. Recommended to use the inbuilt REF_CAT_PATH_KEY. Users need to add this to the image header themselves. e.g. For winter, we use a CustomImageModifer to add this key to the header, as our catalogs are cached by field-id, subdet-id and filter.

get_catalog(ra_deg: float, dec_deg: float) Table[source]

Returns a catalog centered on ra/dec

Parameters:
  • ra_deg – RA

  • dec_deg – Dec

Returns:

Catalog

get_output_path(output_dir: Path, base_name: str | Path) Path[source]

Get save path for catalog

Parameters:
  • output_dir – Output directory for catalog

  • base_name – Base name for catalog

Returns:

Full output path

write_catalog(image: Image, output_dir: str | Path) Path[source]

Generates a custom catalog for an image

Parameters:
  • image – Image

  • output_dir – output directory for catalog

Returns:

path of catalog

class mirar.catalog.base.base_catalog.BaseMultiBackendCatalog(*args, backend: str | None = None, **kwargs)[source]

Bases: ABC

Base class for composite catalogs that are made up of multiple catalog backends

static set_backend(backend: str | None) Type[BaseCatalog][source]

Set backend for composite catalog

Parameters:

backend – Backend name

mirar.catalog.base.base_gaia module

Module for obtaining a Gaia/2Mass catalog

class mirar.catalog.base.base_gaia.BaseGaia2Mass(*args, filter_name: str = 'j', snr_threshold: float = 5, trim: bool = False, image_catalog_path: str | None = None, acceptable_j_ph_quals: str | list[str] = None, acceptable_h_ph_quals: str | list[str] = None, acceptable_k_ph_quals: str | list[str] = None, **kwargs)[source]

Bases: BaseCatalog, ABC

Base Gaia/2Mass catalog

abbreviation = 'tmass'
convert_to_ab_mag(src_list: Table) Table[source]

Convert 2MASS magnitudes to AB magnitudes

Parameters:

src_list – Source list

Returns:

Source list with AB magnitudes

get_catalog(ra_deg: float, dec_deg: float) Table[source]

Returns a catalog centered on ra/dec

Parameters:
  • ra_deg – RA

  • dec_deg – Dec

Returns:

Catalog

get_source_table(ra_deg: float, dec_deg: float) Table[source]

Get the source table for a given position

Parameters:
  • ra_deg – RA in degrees

  • dec_deg – Dec in degrees

Returns:

Table

static trim_catalog(ref_catalog: Table, image_catalog: Table) Table[source]

Trim a reference catalog by only taking ref sources within 2 arcseconds of image sources

Parameters:
  • ref_catalog – reference catalog

  • image_catalog – image catalog

Returns:

trimmed ref catalog

mirar.catalog.base.base_xmatch_catalog module

Base Catalog for crossmatching

class mirar.catalog.base.base_xmatch_catalog.BaseXMatchCatalog(*args, num_sources: int = 1, **kwargs)[source]

Bases: ABCatalog, ABC

Base Catalog for crossmatching

property catalog_name

Name of catalog

property column_dtypes

dtype of columns

property column_names

Name of columns

property dec_column_name

Name of Dec column

property projection

projection for kowalski xmatch

query(coords: dict) dict[source]

Query coords for result

Parameters:

coords – ra/dec

Returns:

crossmatch

property ra_column_name

Name of RA column

mirar.catalog.base.catalog_from_file module

Module for Catalog base class

class mirar.catalog.base.catalog_from_file.CatalogFromFile(catalog_path: str | Path, *args, **kwargs)[source]

Bases: BaseCatalog

Local catalog from file

abbreviation = 'local'
get_catalog(ra_deg: float, dec_deg: float) Table[source]

Returns a catalog centered on ra/dec

Parameters:
  • ra_deg – RA

  • dec_deg – Dec

Returns:

Catalog

mirar.catalog.base.errors module

Module for errors in Catalog

exception mirar.catalog.base.errors.CatalogCacheError[source]

Bases: CatalogError

Class for errors in CatalogCache

exception mirar.catalog.base.errors.CatalogError[source]

Bases: ProcessorError

Class for errors in Catalog