lsst_inaf_agile.catalog_combined

Module for the combined catalog of AGNs, galaxies, and stars.

Attributes

logger

Classes

CatalogCombined

Combined catalog class of AGN, galaxies, and stars.

Module Contents

logger[source]
class CatalogCombined(dirname: str, catalog_galaxy=None, catalog_agn=None, catalog_star=None, catalog_binary=None, sql_query=None, cache=True)[source]

Combined catalog class of AGN, galaxies, and stars.

If the catalog does not exist, then create it. If the catalog exists as a FITS file, try to load it. Finally, if there is a database containing the catalog, return that one instead.

Parameters:
  • dirname (str) – Directory name to contain the catalog.

  • catalog_galaxy (catalog_galaxy.CatalogGalaxy or None) – Galaxy catalog.

  • catalog_agn (catalog_agn.CatalogAGN or None) – AGN catalog.

  • catalog_star (catalog_star.CatalogStar or None) – Single star catalog.

  • catalog_binary (catalog_star.CatalogStar or None) – Binary star catalog.

  • sql_query (str) – Input SQL query if a database file is read.

  • cache (bool) – Use an existing catalog whenever available. Otherwise, always overwrite the one in disk.

dirname[source]
catalog_galaxy = None[source]
catalog_agn = None[source]
catalog_star = None[source]
catalog_binary = None[source]
catalog_combined[source]
get_catalogs()[source]

Return the non-None catalogs.

get_filename()[source]

Return the FITS filename of the combined catalog.

get_dtype()[source]

Return the combined catalog dtype constructed from the individual input catalogs.

Return type:

List of (name, type) corresponding to the names and types of the columns.

get_number_galaxy_star_binary()[source]

Return the tuple (N_galaxy, N_star, N_binary).

N is the number of objects in the combined catalog.

get_catalog_combined()[source]

Construct the combined catalog based on the dtype.

For each column in the catalog, the column is looked for in the AGN/galaxy/star/binary catalogs. Upon a match, the corresponding rows are assigned the values from the reference catalog. Note that some columns may appear in multiple catalog.

The indices correspond to the following object types: AGN in [0, n_galaxy[, galaxy in [0, n_galaxy[, star in [n_galaxy, n_galaxy + n_star], and binary in [n_galaxy + n_star, n_total[.

Return type:

The combined catalog as a numpy ndarray.

postprocess()[source]

Add columns in post-processing.

get_flux_total(band, rest_frame=False)[source]

Return the total flux.

The total flux is defined for each type of object as follows: - AGN: sum of galaxy bulge, galaxy disk, and point fluxes - galaxy: sum of galaxy bulge and disk fluxes - star: point fluxes - binary star: sum of the component point fluxes

write()[source]

Write the combined catalog to a FITS file.

ingest(filename_database, name_table, if_exists='replace')[source]

Ingest the truth catalog into a sqlite3 database.

Parameters:
  • filename_database (str) – filename of the sqlite3 database

  • name_table (str) – name of the table in the sqlite3 database

  • if_exists (str) – sqlite3 action to handle an existing table

get_is_galaxy()[source]

Return boolean vector selecting galaxies.

get_is_star()[source]

Return boolean vector selecting stars.

get_index_star(i)[source]

Return the index in the stellar catalog corresponding to ‘i’ in the combined catalog.

Parameters:

i (int) – ID of the truth catalog object

write_reference_catalog(filename: str, maglim: float, selection_band: str)[source]

Write a mock LSST reference catalog in CSV format to the given ‘filename’.

The reference catalog is cut to brighter than the magnitude limit ‘maglim’ in the band ‘selection_band’.

get_area()[source]

Return the EGG catalog area in deg2.

__getitem__(key)[source]

Return combined catalog value corresponding to ‘key’.

get_luminosity_function(key, bins, zmin, zmax, select=None, values=None, nmin=1, deredden=False, use_occupation_fraction=False)[source]

Return the expected luminosity function.

Can be used to estimate any function e.g. LX, Mstar.

Parameters:
  • key (str) – name of the column in the truth catalog

  • bins (array_like) – bins for the histogram

  • zmin (float) – minimum redshift

  • zmax (float) – maximum redshift

  • select (array_like) – boolean vector for selecting values

  • values (array_like) – values to use instead of the value corresponding to ‘key’

  • nmin (int) – minimum allowed counts per bin

  • deredden (bool) – for magnitudes, deredden the magnitude before computing the LF

  • use_occupation_fraction (bool) – weight LF by occupation fraction