The skyCatalogs package

Reference documentation for core objects with the skyCatalogs package

The skyCatalog class

The skyCatalog class represents a catalog. Users gain access to a catalog by calling its static method open_catalog.

class skycatalogs.skyCatalogs.SkyCatalog(config, mp=False, skycatalog_root=None, loglevel='INFO')

A base class with derived classes for galaxies, static (w.r.t. coordinates) point sources, SSOs

skyCatalogs.open_catalog(mp=False, skycatalog_root=None, loglevel='INFO')
Parameters:
  • config (config_file yaml file containing)

  • also (skycatalog_root optional override of skycatalog_root. This value may) – be supplied by setting the environment variable SKYCATALOG_ROOT. Precedence is 1) argument 2) environment variable 3) value in config file for key skycatalog_root. However set, this value joined to value of the key catalog_dir will be used to find the catalog data.

  • level (loglevel logging)

Return type:

SkyCatalog

get_objects_by_region(region, obj_type_set=None, mjd=None, exposure=30.0)
Parameters:
  • circle) (region region is a named tuple(may be box or) – or object of type PolygonalRegion

  • if (obj_type_set Return only these objects. Defaults to value in config) – specified; else default to all defined in config

  • epoch. (mjd MJD of observation)

  • (seconds) (exposure exposure length)

Returns:

  • ObjectList containing sky objects visible in the region

  • [at the specified time]

get_object_type_by_region(region, object_type, mjd=None, exposure=30.0)
Parameters:
  • box (region) – types made depend on object_type

  • region (circle or PolygonalRegion. Supported) – types made depend on object_type

  • parent (object_type known object type without)

  • epoch. (mjd MJD of observation)

  • (seconds) (exposure exposure)

Return type:

an ObjectList containing all objects found.

get_object_type_names()
Return type:

All object type names in the catalog’s config

get_object_type_by_hp(hp, object_type, region=None, mjd=None, exposure=30.0)
get_hps_by_region(region, object_type='galaxy')
Parameters:
  • (min-ra (Region can be a box (named 4-tuple)

  • max-ra

  • min-dec

  • max-dec))

:param : :param a circle (named 3-tuple (ra: :param dec: :param radius)) or of type: :param PolygonalRegion.: :param Catalog area partition must be by healpix:

Return type:

Set of healpixels intersecting the region

get_hps_by_region(region, object_type='galaxy')
Parameters:
  • (min-ra (Region can be a box (named 4-tuple)

  • max-ra

  • min-dec

  • max-dec))

:param : :param a circle (named 3-tuple (ra: :param dec: :param radius)) or of type: :param PolygonalRegion.: :param Catalog area partition must be by healpix:

Return type:

Set of healpixels intersecting the region

get_object_iterator_by_hp(hp, obj_type_set=None, max_chunk=None, mjd=None)
Parameters:
  • epoch (mjd MJD of observation)

  • id (hp A healpix)

  • available (obj_type_set Return only these objects. Defaults to all)

  • specified (max_chunk If) – number of objections per iteration

  • this (iterator will return no more than) – number of objections per iteration

Return type:

An iterator

get_object_type_by_region(region, object_type, mjd=None, exposure=30.0)
Parameters:
  • box (region) – types made depend on object_type

  • region (circle or PolygonalRegion. Supported) – types made depend on object_type

  • parent (object_type known object type without)

  • epoch. (mjd MJD of observation)

  • (seconds) (exposure exposure)

Return type:

an ObjectList containing all objects found.

get_object_type_names()
Return type:

All object type names in the catalog’s config

get_objects_by_region(region, obj_type_set=None, mjd=None, exposure=30.0)
Parameters:
  • circle) (region region is a named tuple(may be box or) – or object of type PolygonalRegion

  • if (obj_type_set Return only these objects. Defaults to value in config) – specified; else default to all defined in config

  • epoch. (mjd MJD of observation)

  • (seconds) (exposure exposure length)

Returns:

  • ObjectList containing sky objects visible in the region

  • [at the specified time]

hps_by_type(object_type)
Parameters:

string (object_type)

Return type:

list of healpixels (int) having data for object type object_type

property raw_config

Return config, typically uploaded from yaml.

toplevel_only(object_types)
Parameters:
  • names (object_types Set of object type)

  • parent. (Remove object types with a parent. Add in the)

  • values (Return the resulting types (as list) and their)

There are several classes (one per supported object type) representing individual objects as observed at a particular time, all subclassing BaseObject.

class skycatalogs.objects.base_object.BaseObject(ra, dec, id, object_type, belongs_to, belongs_index)

Abstract base class for static (in position coordinates) objects. Likely need a variant for SSO.

id()
ra()
dec()
object_type()
get_native_attribute(attribute_name)
get_LSST_fluxes(cache=True, as_dict=True, mjd=None)

Return a dict of fluxes for LSST bandpasses or, if as_dict is False, just a list in the same order as LSST_BANDS

get_flux(bandpass, sed=None, mjd=None)

Return the total object flux integrated over the bandpass in photons/sec/cm^2 Use supplied sed if there is one

get_gsobject_components(gsparams=None, rng=None, exposure=None)

Return a dictionary of the GSObject components for the sky catalogs object, keyed by component name. Must be implemented by subclass

get_instcat_entry(band='r', component=None)

Return the string corresponding to instance catalog line :param band One of [‘u’: :param ‘g’: :param ‘r’: :param ‘i’: :param ‘z’: :param ‘y’]: :param component Required iff the object has subcomponents (i.e.: object type is ‘galaxy’) :param : object type is ‘galaxy’)

Returns: A string formatted like a line in an instance catalog

get_observer_sed_component(component, mjd=None)

Return the SED for the specified subcomponent of the SkyCatalog object, applying internal extinction, redshift, and Milky Way extinction.

For Milky Way extinction, the Fitzpatrick, et al. (2019) (F19) model, as implemented in the dust_extinction package, is used.

The SEDs are computed assuming exposure times of 1 second.

Must be implemented by subclass

get_observer_sed_components(mjd=None)

Return a dictionary of the SEDs, keyed by component name.

get_roman_fluxes(cache=True, as_dict=True, mjd=None)

Return a dict of fluxes for Roman bandpasses or, if as_dict is False, just a list in the same order as ROMAN_BANDS

get_sed_metadata(**kwargs)

E.g. list of wavelength or frequency intervals associated with sed values

get_total_observer_sed(mjd=None)

Return the SED summed over SEDs for the individual SkyCatalog components.

property native_columns

Return set of all columns stored in parquet file for this object. May not include quantities which are constant for all objects of this type

property subcomponents

Return list of all subcomponents (or None)

The ObjectList class is a container for instances of BaseObject. It subclasses Sequence.

class skycatalogs.objects.base_object.ObjectList

Keep track of a list of ObjectCollection objects, but from user perspective appears to be a list of objects. Make use of ObjectCollection implementation of Sequence until it’s time to move to the next ObjectCollection