btk.catalog module

The catalog module defines the Catalog class and its implementation for Catsim and COSMOS.

Contains abstract base class Catalog that standarizes catalog usage across BTK.

class btk.catalog.Catalog(raw_catalog: Table)

Bases: ABC

Abstract base class containing the catalog for BTK.

Each new catalog should be a subclass of Catalog.

self.table

Standardized table containing information from the catalog

Type:

astropy.table

__init__(raw_catalog: Table)

Creates Catalog object and standarizes raw_catalog information.

The standarization is done via the attribute self.table via the _prepare_table method.

Parameters:

raw_catalog – Raw catalog containing information to create table.

abstract classmethod from_file(catalog_files: str | Tuple[str, str])

Constructs the catalog object from a file. Should be implemented in subclasses.

get_raw_catalog() Table

Returns the raw catalog.

property name: str

Property containing the name of the (sub)class.

It is used to check whether the catalog is compatible with the chosen DrawBlendsGenerator.

class btk.catalog.CatsimCatalog(raw_catalog: Table)

Bases: Catalog

Implementation of Catalog for the Catsim catalog.

classmethod from_file(catalog_files: str)

Constructs the catalog object from a file.

Parameters:

catalog_files – path to a file containing a readable astropy table

class btk.catalog.CosmosCatalog(raw_catalog: Table, galsim_catalog: COSMOSCatalog)

Bases: Catalog

Class containing catalog information for drawing COSMOS galaxies from galsim.

__init__(raw_catalog: Table, galsim_catalog: COSMOSCatalog)

Initializes the COSMOS Catalog class.

classmethod from_file(catalog_files: Tuple[str, str], exclusion_level='marginal')

Constructs the catalog object from a file. It also places exclusion level cuts.

For more details: (https://galsim-developers.github.io/GalSim/_build/html/real_gal.html)

Parameters:
  • catalog_files – tuple containing the two paths to the COSMOS data.

  • exclusion_level

    Level of additional cuts to make on the galaxies based on the quality of postage stamp definition and/or parametric fit quality (beyond the minimal cuts imposed when making the catalog - see Mandelbaum et al. (2012, MNRAS, 420, 1518) for details). Options:

    • ”none”: No cuts.

    • ”bad_stamp”: Apply cuts to eliminate galaxies that have failures in

      postage stamp definition. These cuts may also eliminate a small subset of the good postage stamps as well.

    • ”bad_fits”: Apply cuts to eliminate galaxies that have failures in the

      parametric fits. These cuts may also eliminate a small subset of the good parametric fits as well.

    • ”marginal”: Apply the above cuts, plus ones that eliminate some more

      marginal cases.

    Note that the _selection.fits file must be present in the same repo as the real images catalog, Otherwise the “bad_stamp” and “marginal” cuts will fail (default: “marginal”)

get_galsim_catalog() COSMOSCatalog

Returns the galsim.COSMOSCatalog object.