clmm.gcdata module

Define the custom data type

class clmm.gcdata.GCData(*args, **kwargs)[source]

Bases: Table

GCData: A data objetc for gcdata. Right now it behaves as an astropy table, with the following modifications: __getitem__ is case independent; The attribute .meta['cosmo'] is protected and can only be changed via update_cosmo or update_cosmo_ext_valid methods;

Parameters:
  • meta (dict) -- Dictionary with metadata for this object

  • tables (Same as astropy) --

get_pzpdfs()[source]

Get pzbins and pzpdfs of galaxies

Returns:

  • pzbins (array) -- zbins of PDF. 1D if shared_bins, zbins of each object in data if individual_bins.

  • pzpdfs (array) -- PDF of each object in data

has_pzpdfs()[source]

Get pzbins and pzpdfs of galaxies

Returns:

  • pzbins (array) -- zbins of each object in data

  • pzpdfs (array) -- PDF of each object in data

update_cosmo(cosmo, overwrite=False)[source]

Updates cosmo metadata if not present

Parameters:
  • cosmo (clmm.Cosmology) -- Cosmology

  • overwrite (bool) -- Overwrites the current cosmo metadata. If false raises Error when cosmologies are different.

Return type:

None

update_cosmo_ext_valid(gcdata, cosmo, overwrite=False)[source]

Updates cosmo metadata if the same as in gcdata

Parameters:
  • gcdata (GCData) -- Table to check if same cosmology

  • cosmo (clmm.Cosmology) -- Cosmology

  • overwrite (bool) -- Overwrites the current cosmo metadata. If false raises Error when cosmologies are different.

Return type:

None

update_info_ext_valid(key, gcdata, ext_value, overwrite=False)[source]

Updates cosmo metadata if the same as in gcdata

Parameters:
  • key (str) -- Name of key to compare and update.

  • gcdata (GCData) -- Table to check if same cosmology.

  • ext_value -- Value to be compared to.

  • overwrite (bool) -- Overwrites the current metadata. If false raises Error when values are different.

Return type:

None

class clmm.gcdata.GCMetaData(*args, **kwargs)[source]

Bases: OrderedDict

Object to store metadata, it always has a cosmo key with protective changes

Variables:
  • protected (bool) -- Protect cosmo key

  • attributes (OrderedDict) --