Catalogue maker (catalogue_maker)

Make discrete catalogues from observed or simulated realisations.

SourceCatalogue(*args, **kwargs)

Catalogue from external sources.

RandomCatalogue(*args, **kwargs)

Uniform random catalogue.

SphericalFKPCatalogue(radius[, ...])

FKP-style paired catalogues in a spherical domain.

spherical_indicator(cartesian_position, ...)

Indicate whether an object lies within the a spherical domain centred at the origin.


harmonia.mapper.catalogue_maker.spherical_indicator(cartesian_position, bounding_radius)[source]

Indicate whether an object lies within the a spherical domain centred at the origin.

Parameters:
  • cartesian_position (float, array_like) – Object position in Cartesian coordinates.

  • bounding_radius (float) – Bounding radius of the spherical domain.

Returns:

True if the objection position lies within the spherical domain.

Return type:

bool numpy.ndarray

class harmonia.mapper.catalogue_maker.RandomCatalogue(*args: Any, **kwargs: Any)[source]

Uniform random catalogue.

Notes

Origin of the catalogue is at a corner of the catalogue box.

Parameters:
  • mean_density (float) – Desired mean particle number density (in cubic \(h\)/Mpc).

  • boxsize (float, array_like) – Catalogue boxsize (in Mpc/\(h\)) as a scalar or a triple of scalars.

  • seed (int or None, optional) – Random seed of the catalogue (default is None).

class harmonia.mapper.catalogue_maker.SourceCatalogue(*args: Any, **kwargs: Any)[source]

Catalogue from external sources.

Notes

This assumes the external catalogue has a Cartesian coordinate system with the origin at a corner of the Cartesian box.

Parameters:
  • source_file (str) – Catalogue source file.

  • headings (list of str) – Column headings of the catalogue file. This must contain three columns ‘x’, ‘y’ and ‘z’ for holding the Cartesian coordinates.

  • mean_density (float or None, optional) – If not None (default), this overrides default catalogue mean number density (in cubic \(h\)/Mpc) (e.g. to evade integral constraint).

  • boxsize (float or None, optional) – If not None (default), this overrides default catalogue boxsize (in Mpc/\(h\)) in case of unit upscaling.

  • upscale (float, optional) – Scaling factor for converting any length unit to Mpc/\(h\) (default is 1.), e.g. upscale=1.e-3 for converting Kpc/\(h\) to Mpc/\(h\).

  • offset (bool, optional) – If True (default is False), add the velocity columns to position columns (for e.g. redshift-space distortions).

  • offset_upscale (float, optional) – Scaling factor for converting the velocity offset length unit to Mpc/\(h\) (default is 1.e-3), e.g. offset_upscale=1.e-3 for converting Kpc/\(h\) to Mpc/\(h\). The velocity offset should include the redshift conversion factor (the conformal Hubble parameter).

  • **kwargs – Parameters (other than path and names) to be passed to nbodykit.source.catalog.CSVCatalog.

Notes

The use of offset=True assumes the source catalogue contains velocity data columns labelled by, for instance, ‘vx’, for each of the position data columns, for instance, ‘x’.

class harmonia.mapper.catalogue_maker.SphericalFKPCatalogue(radius, data_catalogue=None, source_file=None, source_kwargs=None, random_catalogue=None, contrast=None, mask=None, selection=None, weight=None, random_seed=None, apply_selection_as_veto=False)[source]

FKP-style paired catalogues in a spherical domain.

Parameters:
  • data_catalogue (SourceCatalogue or None, optional) – Data catalogue. Cannot be None (default) unless source_file and source_kwargs are provided as an alternative to read the catalogue source file.

  • source_file (str or None, optional) – Catalogue source file path. This can only be None (default) if data_catalogue is already provided.

  • source_kwargs (dict or None, optional) – Parameters to pass to SourceCatalogue. This can only be None (default) if data_catalogue is already provided.

  • random_catalogue (nbodykit.base.catalog.CatalogSource or None, optional) – Random catalogue (default is None).

  • contrast (float or None, optional) – Mean density contrast compared to the data catalogue used to generate a random catalogue (default is None). Ignored if random_catalogue is provided.

  • mask (callable or None, optional) – Any veto mask function to be applied to both the data and random catalogues. Must be a function of 3-d Cartesian coordinates only, assuming the origin is at the centre of the catalogues.

  • selection (callable or None, optional) – Any selection function (normalised to unity) to be applied to both the data and random catalogues. Must be a function of 3-d Cartesian coordinates only, assuming the origin is at the centre of the catalogues.

  • weight (callable or None, optional) – Any weight function to be applied to both the data and random catalogues. Must be a function of 3-d Cartesian coordinates only, assuming the origin is at the centre of the catalogues.

  • random_seed (int or None, optional) – Random seed of the random catalogue (default is None).

  • apply_selection_as_veto (bool, optional) – If True (default is False), selection returning boolean values is applied to the ‘Selection’ column of the catalogues instead of the ‘NZ’ column (see nbodykit documentation for this peculiarity.)

Variables:

Notes

If selection is provided, it must be normalised to the overall mean number density of the data catalogue.