Catalog

class orpheus.catalog.Catalog(pos1, pos2, weight=None, zbins=None, isinner=None, units_pos1=None, units_pos2=None, geometry='flat2d', mask=None, zbins_mean=None, zbins_std=None)[source]

Bases: object

Class containing variables and methods of a catalog of tracers. .. attribute:: pos1

The \(x\)-positions of the tracer objects

type

numpy.ndarray

pos2

The \(y\)-positions of the tracer objects

Type

numpy.ndarray

weight

The weights of the tracer objects. If set to None all weights are assumed to be unity.

Type

numpy.ndarray, optional, defaults to None

zbins

The tomographic redshift bins of the tracer objects. If set to None all zbins are assumed to be zero.

Type

numpy.ndarray, optional, defaults to None

nbinsz

The number of tomographic bins

Type

int

isinner

A flag signaling whether a tracer is within the interior part of the footprint

Type

numpy.ndarray

units_pos1

The unit of the \(x\)-positions, should be in [None, ‘rad’, ‘deg’, ‘arcmin’]. For non-spherical catalogs we auto-set this to None. Spherical catalogs are internally transformed to units of degrees.

Type

string, defaults to None

units_pos2

The unit of the \(y\)-positions, should be in [None, ‘rad’, ‘deg’, ‘arcmin’]. For non-spherical catalogs we auto-set this to None. Spherical catalogs are internally transformed to units of degrees.

Type

string, defaults to None

geometry

Specifies the topology of the space the points are located in. Should be in [‘flat2d’, ‘spherical’].

Type

string, defaults to 'flat2d'

min1

The smallest \(x\)-value appearing in the catalog

Type

float

max1

The largest \(x\)-value appearing in the catalog

Type

float

min2

The smallest \(y\)-value appearing in the catalog

Type

float

max2

The largest \(y\)-value appearing in the catalog

Type

float

len1

The extent of the catalog in \(x\)-direction.

Type

float

len2

The extent of the catalog in \(y\)-direction.

Type

float

hasspatialhash

Flag on whether a spatial hash structure has been allocated for the catalog

Type

bool

index_matcher

Indicates on whether there is a tracer in each of the pixels in the spatial hash.

Type

numpy.ndarray

Note

The zbins parameter can also be used for other characteristics of the tracers (i.e. color cuts).

topatches(npatches=None, area_patch_deg2_target=None, patchextend_deg=2.0, other_cats=None, nside_hash=128, verbose=False, method='kmeans_healpix', kmeanshp_maxiter=1000, kmeanshp_tol=1e-10, kmeanshp_randomstate=42, healpix_nside=8)[source]

Decomposes a full-sky catalog into patches.

_patchind_preparerot(index, rotsignflip=False)[source]
_reduce(fields, dpix, dpix2=None, relative_to_hash=None, normed=True, shuffle=0, extent=[None, None, None, None], forcedivide=1, ret_inst=False)[source]

Paints a catalog onto a grid with equal-area cells

Parameters
  • fields (list) – The fields to be painted to the grid. Each field is given as a 1D array of float.

  • dpix (float) – The sidelength of a grid cell.

  • dpix2 (float, optional) – The sidelength of a grid cell in \(y\)-direction. Defaults to None. If set to None the pixels are assumed to be squares.

  • relative_to_hash (int, optional) – Forces the cell size to be an integer multiple of the cell size of the spatial hash. Defaults to None. If set to None the pixelsize is unrelated to the cell size of the spatial hash.

  • normed (bool, optional) – Decide on whether to average or to sum the field over pixels. Defaults to True.

  • shuffle (int, optional) – Choose a definition on how to set the central point of each pixel. Defaults to zero.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

  • ret_inst (bool, optional) – Decides on whether to return the output as a list of arrays containing the reduced catalog or on returning a new Catalog instance. Defaults to False.

_multihash(dpixs, fields, dpix_hash=None, normed=True, shuffle=0, extent=[None, None, None, None], forcedivide=1)[source]

Builds spatialhash for a base catalog and its reductions.

Parameters
  • dpixs (list) – The pixel sizes on which the hierarchy of reduced catalogs is constructed.

  • fields (list) – The fields for which the multihash is constructed. Each field is given as a 1D array of float.

  • dpix_hash (float, optional) – The size of the pixels used for the spatial hash of the hierarchy of catalogs. Defaults to None. If set to None uses the largest value of dpixs.

  • normed (bool, optional) – Decide on whether to average or to sum the field over pixels. Defaults to True.

  • shuffle (int, optional) – Choose a definition on how to set the central point of each pixel. Defaults to zero.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

Returns

  • ngals (list) – Contains the number of galaxies for each of the catalogs in the hierarchy.

  • pos1s (list) – Contains the \(x\)-positions for each of the catalogs in the hierarchy.

  • pos2s (list) – Contains the \(y\)-positions for each of the catalogs in the hierarchy.

  • weights (list) – Contains the tracer weights for each of the catalogs in the hierarchy.

  • zbins (list) – Contains the tomographic redshift bins for each of the catalogs in the hierarchy.

  • isinners (list) – Contains the flag on whether a tracer is within the interior part of the footprint for each of the catalogs in the hierarchy.

  • allfields (list) – Contains the tracer fields for each of the catalogs in the hierarchy.

  • index_matchers (list) – Contains the index_matchers arrays for each of the catalogs in the hierarchy. See the index_matcher attribute for more information.

  • pixs_galind_bounds (list) – Contains the pixs_galind_bounds arrays for each of the catalogs in the hierarchy. See the pixs_galind_bounds attribute for more information.

  • pix_gals (list) – Contains the pix_gals arrays for each of the catalogs in the hierarchy. See the pix_gals attribute for more information.

  • dpixs1_true (list) – Contains final values of the pixel sidelength along the \(x\)-direction for each of the catalogs in the hierarchy.

  • dpixs2_true (list) – Contains final values of the pixel sidelength along the \(y\)-direction for each of the catalogs in the hierarchy.

_jointextent(others, extend=0)[source]

Draws largest possible rectangle over set of catalogs.

Parameters
  • others (list) – Contains Catalog instances over which the joint extent will be drawn

  • extend (float, optional) – Include an additional boundary layer around the joint extent of the catalogs. Defaults to 0 (no extension).

Returns

  • xlo (float) – The lower x-boundary of the joint extent.

  • xhi (float) – The upper x-boundary of the joint extent.

  • ylo (float) – The lower y-boundary of the joint extent.

  • yhi (float) – The upper y-boundary of the joint extent.

create_mask(method='Basic', pixsize=1.0, apply=False, extend=0.0)[source]
__checkmask()
__applymask(method)
togrid(fields, dpix, normed=False, weighted=True, tomo=True, extent=[None, None, None, None], method='CIC', forcedivide=1, asgrid=None, nthreads=1, ret_inst=False)[source]

Paints a catalog of discrete tracers to a grid.

Parameters
  • fields (list) – The fields to be painted to the grid. Each field is given as a 1D array of float.

  • dpix (float) – The sidelength of a grid cell.

  • normed (bool, optional) – Decide on whether to average or to sum the field over pixels. Defaults to False.

  • weighted (bool, optional) – Whether to apply the tracer weights of the catalog. Defaults to True.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

  • method (str, optional) – The chosen mass assignment method applied to each of the fields. Currently supported methods are NGP, CIC and TSC assignment. Defaults to CIC.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

  • ret_inst (bool, optional) – Decides on whether to return the output as a list of arrays containing the reduced catalog or on returning a new Catalog instance. Defaults to False.

  • asgrid (bool, optional) – Deprecated.

  • nthreads (int, optional) – The number of openmp threads used for the reduction procedure. Defaults to 1.

Returns

  • projectedfields (list) – A list of the 2D arrays containing the reduced fields

  • start1 (float) – The \(x\)-position of the first columns’ left edge

  • start2 (float) – The \(y\)-position of the first rows’ lower edge

  • dpix (float) – The sidelength of each pixel in the grid. Note that this value might slightly differ from the one provided in the parameters.

  • normed (bool) – Same as the normed parameter

  • method (str) – Same as the method parameter

gen_weightgrid2d(dpix, extent=[None, None, None, None], method='CIC', forcedivide=1, nthreads=1)[source]
build_spatialhash(dpix=1.0, extent=[None, None, None, None])[source]

Adds a spatial hashing data structure to the catalog.

Parameters
  • dpix (float) – The sidelength of each cell of the hash. Defaults to 1.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

Note

Calling this method (re-)allocates the index_matcher, pixs_galind_bounds, pix_gals, pix1_start, pix2_start, pix1_n, pix2_n, pix1_d and pix2_d attributes of the instance.

_gengridprops(dpix, dpix2=None, forcedivide=1, extent=[None, None, None, None])[source]

Gives some basic properties of grids created from the discrete tracers.

Parameters
  • dpix (float) – The sidelength of a grid cell.

  • dpix2 (float, optional) – The sidelength of a grid cell in \(y\)-direction. Defaults to None. If set to None the pixels are assumed to be squares.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

Returns

  • start1 (float) – The \(x\)-position of the first column.

  • start2 (float) – The \(y\)-position of the first row.

  • n1 (int) – The number of pixels in the \(x\)-position.

  • n2 (int) – The number of pixels in the \(y\)-position.

class orpheus.catalog.ScalarTracerCatalog(pos1, pos2, tracer, **kwargs)[source]

Bases: Catalog

Class constructor.

pos1

The \(x\)-positions of the tracer objects

Type

numpy.ndarray

pos2

The \(y\)-positions of the tracer objects

Type

numpy.ndarray

tracer

The values of the scalar tracer field, i.e. galaxy weights or cosmic convergence.

Type

numpy.ndarray

Notes

Inherits all other parameters and attributes from Catalog. Additional child-specific parameters can be passed via kwargs.

reduce(dpix, dpix2=None, relative_to_hash=None, normed=True, shuffle=0, extent=[None, None, None, None], forcedivide=1, ret_inst=False)[source]

Paints the catalog onto a grid with equal-area cells

Parameters
  • dpix (float) – The sidelength of a grid cell.

  • dpix2 (float, optional) – The sidelength of a grid cell in \(y\)-direction. Defaults to None. If set to None the pixels are assumed to be squares.

  • relative_to_hash (int, optional) – Forces the cell size to be an integer multiple of the cell size of the spatial hash. Defaults to None. If set to None the pixelsize is unrelated to the cell size of the spatial hash.

  • normed (bool, optional) – Decide on whether to average or to sum the field over pixels. Defaults to True.

  • shuffle (int, optional) – Choose a definition on how to set the central point of each pixel. Defaults to zero.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

  • ret_inst (bool, optional) – Decides on whether to return the output as a list of arrays containing the reduced catalog or on returning a new Catalog instance. Defaults to False.

multihash(dpixs, dpix_hash=None, normed=True, shuffle=0, extent=[None, None, None, None], forcedivide=1)[source]

Builds spatialhash for a base catalog and its reductions.

Parameters
  • dpixs (list) – The pixel sizes on which the hierarchy of reduced catalogs is constructed.

  • dpix_hash (float, optional) – The size of the pixels used for the spatial hash of the hierarchy of catalogs. Defaults to None. If set to None uses the largest value of dpixs.

  • normed (bool, optional) – Decide on whether to average or to sum the field over pixels. Defaults to True.

  • shuffle (int, optional) – Choose a definition on how to set the central point of each pixel. Defaults to zero.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

Returns

res – Contains the output of the Catalog._multihash method

Return type

tuple

frompatchind(index)[source]
class orpheus.catalog.SpinTracerCatalog(spin, pos1, pos2, tracer_1, tracer_2, **kwargs)[source]

Bases: Catalog

Class constructor.

pos1

The \(x\)-positions of the tracer objects

Type

numpy.ndarray

pos2

The \(y\)-positions of the tracer objects

Type

numpy.ndarray

tracer_1

The values of the real part of the tracer field, i.e. galaxy ellipticities.

Type

numpy.ndarray

tracer_2

The values of the imaginary part of the tracer field, i.e. galaxy ellipticities.

Type

numpy.ndarray

Notes

Inherits all other parameters and attributes from Catalog. Additional child-specific parameters can be passed via kwargs.

reduce(dpix, dpix2=None, relative_to_hash=None, normed=True, shuffle=0, extent=[None, None, None, None], forcedivide=1, w2field=True, ret_inst=False)[source]

Paints the catalog onto a grid with equal-area cells

Parameters
  • dpix (float) – The sidelength of a grid cell.

  • dpix2 (float, optional) – The sidelength of a grid cell in \(y\)-direction. Defaults to None. If set to None the pixels are assumed to be squares.

  • relative_to_hash (int, optional) – Forces the cell size to be an integer multiple of the cell size of the spatial hash. Defaults to None. If set to None the pixelsize is unrelated to the cell size of the spatial hash.

  • normed (bool, optional) – Decide on whether to average or to sum the field over pixels. Defaults to True.

  • shuffle (int, optional) – Choose a definition on how to set the central point of each pixel. Defaults to zero.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

  • w2field (bool, optional) – Adds an additional field equivalent to the squared weight of the tracers to the reduced catalog. Defaults to True.

  • ret_inst (bool, optional) – Decides on whether to return the output as a list of arrays containing the reduced catalog or on returning a new Catalog instance. Defaults to False.

multihash(dpixs, dpix_hash=None, normed=True, shuffle=0, w2field=True, extent=[None, None, None, None], forcedivide=1)[source]

Builds spatialhash for a base catalog and its reductions.

Parameters
  • dpixs (list) – The pixel sizes on which the hierarchy of reduced catalogs is constructed.

  • dpix_hash (float, optional) – The size of the pixels used for the spatial hash of the hierarchy of catalogs. Defaults to None. If set to None uses the largest value of dpixs.

  • normed (bool, optional) – Decide on whether to average or to sum the field over pixels. Defaults to True.

  • shuffle (int, optional) – Choose a definition on how to set the central point of each pixel. Defaults to zero.

  • extent (list, optional) – Sets custom boundaries [xmin, xmax, ymin, ymax] for the grid. Each element defaults to None. Each element equal to None sets the grid boundary as the smallest value fully containing the discrete field tracers.

  • forcedivide (int, optional) – Forces the number of cells in each dimensions to be divisible by some number. Defaults to 1.

  • w2field (bool, optional) – Adds an additional field equivalent to the squared weight of the tracers to the reduced catalog. Defaults to True.

Returns

res – Contains the output of the Catalog._multihash method

Return type

tuple

frompatchind(index, rotsignflip=False)[source]

NPCF

class orpheus.npcf_base.BinnedNPCF(order, spins, n_cfs, min_sep, max_sep, nbinsr=None, binsize=None, nbinsphi=100, nmaxs=30, method='DoubleTree', multicountcorr=True, shuffle_pix=0, tree_alpha=None, tree_mincellsize=0.1, tree_maxcellsize=4.0, tree_resos=[0, 0.25, 0.5, 1.0, 2.0], tree_redges=None, rmin_pixsize=20, resoshift_leafs=0, minresoind_leaf=None, maxresoind_leaf=None, methods_avail=['Discrete', 'Tree', 'BaseTree', 'DoubleTree'], verbosity=0, nthreads=16)[source]

Bases: object

Class of a binned N-point correlation function of various arbitrary tracer catalogs. This class contains attributes and methods that can be used across any of its children.

order

The order of the correlation function.

Type

int

spins

The spins of the tracer fields of which the NPCF is computed.

Type

list

n_cfs

The number of independent components of the NPCF.

Type

int

min_sep

The smallest distance of each vertex for which the NPCF is computed.

Type

float

max_sep

The largest distance of each vertex for which the NPCF is computed.

Type

float

nbinsr

The number of radial bins for each vertex of the NPCF. If set to None this attribute is inferred from the binsize attribute.

Type

int, optional

binsize

The logarithmic size of the radial bins for each vertex of the NPCF. If set to None this attribute is inferred from the nbinsr attribute.

Type

float, optional

nbinsphi

The number of angular bins for the NPCF in the real-space basis. Defaults to 100.

Type

float, optional

nmaxs

The largest multipole component considered for the NPCF in the multipole basis. Defaults to 30.

Type

list, optional

method

The method to be employed for the estimator. Defaults to DoubleTree.

Type

str, optional

multicountcorr

Flag on whether to subtract multiplets in which the same tracer appears more than once. Defaults to True.

Type

bool, optional

shuffle_pix

Choice of how to define centers of the cells in the spatial hash structure. Defaults to 0, i.e. position at pixel center of mass.

Type

int, optional

tree_alpha

Parameter used for autosetting tree resolutions given a catalog.

Type

float, optional

tree_mincellsize

Smallest allowed sidelength for cell in tree. Defaults to 0.1.

Type

float

tree_maxcellsize

Largest allowed sidelength for cell in tree. Defaults to 4.

Type

float

tree_resos

The cell sizes of the hierarchical spatial hash structure

Type

list, optional

tree_redges

List of radii where the tree changes resolution.

Type

list, optional

rmin_pixsize

The limiting radial distance relative to the cell of the spatial hash after which one switches to the next hash in the hierarchy. Defaults to 20.

Type

int, optional

resoshift_leafs

Allows for a difference in how the hierarchical spatial hash is traversed for pixels at the base of the NPCF and pixels at leafs. I.e. positive values indicate that leafs will be evaluated at coarser resolutions than the base. Defaults to 0.

Type

int, optional

minresoind_leaf

Sets the smallest resolution in the spatial hash hierarchy which can be used to access tracers at leaf positions. If set to None uses the smallest specified cell size. Defaults to None.

Type

int, optional

maxresoind_leaf

Sets the largest resolution in the spatial hash hierarchy which can be used to access tracers at leaf positions. If set to None uses the largest specified cell size. Defaults to None.

Type

int, optional

verbosity

The level of verbosity during the computation. Level 0: No verbosity, 1: Progress verbosity on python layer, 2: Progress verbosity also on C level, 3: Debug verbosity. Defaults to 0.

Type

int, optional

nthreads

The number of openmp threads used for the reduction procedure. Defaults to 16.

Type

int, optional

bin_centers

The centers of the radial bins for each combination of tomographic redshifts.

Type

numpy.ndarray

bin_centers_mean

The centers of the radial bins averaged over all combination of tomographic redshifts.

Type

numpy.ndarray

phis

The bin centers for the N-2 angles describing the NPCF in the real-space basis.

Type

list

npcf

The natural components of the NPCF in the real space basis. The different axes are specified as follows: (component, zcombi, rbin_1, ..., rbin_N-1, phibin_1, phibin_N-2).

Type

numpy.ndarray

npcf_norm

The normalization of the natural components of the NPCF in the real space basis. The different axes are specified as follows: (zcombi, rbin_1, ..., rbin_N-1, phiin_1, phibin_N-2).

Type

numpy.ndarray

npcf_multipoles

The natural components of the NPCF in the multipole basis. The different axes are specified as follows: (component, zcombi, multipole_1, ..., multipole_N-2, rbin_1, ..., rbin_N-1).

Type

numpy.ndarray

npcf_multipoles_norm

The normalization of the natural components of the NPCF in the multipole basis. The different axes are specified as follows: (zcombi, multipole_1, ..., multipole_N-2, rbin_1, ..., rbin_N-1).

Type

numpy.ndarray

is_edge_corrected

Flag signifying on whether the NPCF multipoles have been edge-corrected. Defaults to False.

Type

bool

autoset_tree(cat, dpix_grid=2.0, nside_grid=2048)[source]
_initprojections(child)[source]
_projectnpcf(child, projection)[source]

Projects npcf to a new basis.

_print_npcfprojections_avail(child)[source]
_checkcats(cats, spins)[source]
_updatetree(new_resos, include_shifts=True)[source]
class orpheus.npcf_second.NNCorrelation(min_sep, max_sep, shuffle_pix=1, **kwargs)[source]

Bases: BinnedNPCF

Compute pair counts and (optionally) the projected angular clustering two-point correlation function.

Parameters
  • min_sep (float) – The smallest distance of each vertex for which the NPCF is computed.

  • max_sep (float) – The largest distance of each vertex for which the NPCF is computed.

  • shuffle_pix (int, optional) – Choice of how to define centers of the cells in the spatial hash structure. Defaults to 1, i.e. random positioning.

  • **kwargs – Passed to BinnedNPCF.

npair

The number of unweighted pairs.

Type

numpy.ndarray

npair_cell

The number cell-pairs.

Type

numpy.ndarray

xi

The scalar two-point correlation function.

Type

numpy.ndarray

Notes

  • Inherits all other parameters and attributes from BinnedNPCF.

  • Additional child-specific parameters can be passed via kwargs.

  • Binning: - Either nbinsr or binsize must be provided to fix the binning scheme. - If both are provided, the parent class rules determine which takes precedence.

  • Pixel hashing / grid setup: - shuffle_pix=1 is the default (random cell centers). - This differs from shear-based correlation functions where another default may be used.

  • Estimator: The scalar correlation function xi is formed from the pair counts via the Landy-Szalay estimator

    \[\xi(r) = \frac{DD(r) - 2\,DR(r) + RR(r)}{RR(r)}.\]
saveinst(path_save, fname)[source]
__process_patches(cat, dotomo=True, do_dc=True, adjust_tree=False, save_patchres=False, save_filebase='', keep_patchres=False)
process(cat, cat_random=None, dotomo=True, do_dc=True, adjust_tree=False, save_patchres=False, save_filebase='', keep_patchres=False)[source]

Compute NN pair counts for a catalog, and optionally the clustering 2PCF xi.

If cat_random is provided, xi is computed using the Landy–Szalay estimator. Otherwise only pair counts are computed.

Parameters
  • cat (orpheus.ScalarTracerCatalog) – The (clustered) catalog for which the pair counts are computed

  • cat_random (orpheus.ScalarTracerCatalog, optional) – A random catalog. If this is set, the clustering correlation function xi is computed.

  • dotomo (bool) – Flag that decides whether the tomographic information in the catalog should be used. Defaults to True.

  • do_dc (bool) – Flag that decides whether to double-count the pair counts. This will be required when looking at data-random pairs. within a tomographic catalog. Defaults to True. In case xi is computed, this argument is internally set to True.

  • adjust_tree (bool) – Overrides the original setup of the tree-approximations in the instance based on the nbar of the catalog. Not implemented yet; has no effect. Defaults to False.

  • save_patchres (bool or str) – If the catalog has been decomposed in patches, flag whether to save the NN measurements on the individual patches. Note that the path needs to exist, otherwise a ValueError is raised. For a flat-sky catalog this parameter has no effect. Defaults to False.

  • save_filebase (str) – Base of the filenames in which the patches are saved. The full filename will be <save_patchres>/<save_filebase>_patchxx.npz. Only has an effect if the catalog consists of multiple patches and save_patchres is not False.

  • keep_patchres (bool) – If the catalog consists of multiple patches, returns all measurements on the patches. Defaults to False.

__compute_xi(cat_data, cat_rand, dotomo=True, adjust_tree=False, save_patchres=False, keep_patchres=False, estimator='LS')
computeNap2(radii, tofile=False)[source]

Computes second-order aperture statistics given the projected angular clustering correlation function. Uses the Crittenden 2002 filter.

class orpheus.npcf_second.GGCorrelation(min_sep, max_sep, **kwargs)[source]

Bases: BinnedNPCF

Compute second-order correlation functions of spin-2 fields.

Parameters
  • min_sep (float) – The smallest distance of each vertex for which the NPCF is computed.

  • max_sep (float) – The largest distance of each vertex for which the NPCF is computed.

xip

The ξ₊ correlation function.

Type

numpy.ndarray

xim

The ξ₋ correlation function.

Type

numpy.ndarray

norm

The number of weighted pairs.

Type

numpy.ndarray

npair

The number of unweighted pairs.

Type

numpy.ndarray

Notes

Inherits all other parameters and attributes from BinnedNPCF. Additional child-specific parameters can be passed via kwargs. Either nbinsr or binsize has to be provided to fix the binning scheme.

saveinst(path_save, fname)[source]
__process_patches(cat, dotomo=True, do_dc=False, rotsignflip=False, apply_edge_correction=False, adjust_tree=False, save_patchres=False, save_filebase='', keep_patchres=False)
process(cat, dotomo=True, do_dc=False, rotsignflip=False, adjust_tree=False, save_patchres=False, save_filebase='', keep_patchres=False)[source]

Compute a shear 2PCF given a shape catalog

Parameters
  • cat (orpheus.SpinTracerCatalog) – The shape catalog to process.

  • dotomo (bool) – Flag that decides whether the tomographic information in the shape catalog should be used. Defaults to True.

  • do_dc (bool) – Whether to double-count pair counts. This will have no impact on \(\xi_\pm\), but can significantly reduce the amplitude of \(\xi_\times\). Defaults to False.

  • rotsignflip (bool) – If the shape catalog has been decomposed in patches, choose whether the rotation angle should be flipped. For simulated data this was always ok to set to False. Defaults to False.

  • adjust_tree (bool) – Overrides the original setup of the tree-approximations in the instance based on the nbar of the shape catalog. Not implemented yet; has no effect. Defaults to False.

  • save_patchres (bool or str) – If the shape catalog has been decomposed in patches, flag whether to save the GG measurements on the individual patches. Note that the path needs to exist, otherwise a ValueError is raised. For a flat-sky catalog this parameter has no effect. Defaults to False.

  • save_filebase (str) – Base of the filenames in which the patches are saved. The full filename will be <save_patchres>/<save_filebase>_patchxx.npz. Only has an effect if the shape catalog consists of multiple patches and save_patchres is not False.

  • keep_patchres (bool) – If the catalog consists of multiple patches, returns all measurements on the patches. Defaults to False.

computeMap2(radii, tofile=False)[source]

Computes second-order aperture mass statistics given the shear correlation functions. Uses the Crittenden 2002 filter.

class orpheus.npcf_third.GGGCorrelation(n_cfs, min_sep, max_sep, **kwargs)[source]

Bases: BinnedNPCF

Class containing methods to measure and obtain statistics that are built from third-order shear correlation functions.

n_cfs

The number of independent components of the NPCF.

Type

int

min_sep

The smallest distance of each vertex for which the NPCF is computed.

Type

float

max_sep

The largest distance of each vertex for which the NPCF is computed.

Type

float

Notes

Inherits all other parameters and attributes from BinnedNPCF. Additional child-specific parameters can be passed via kwargs. Either nbinsr or binsize has to be provided to fix the binning scheme.

saveinst(path_save, fname)[source]
__process_patches(cat, dotomo=True, rotsignflip=False, apply_edge_correction=False, adjust_tree=False, save_patchres=False, save_filebase='', keep_patchres=False)
process(cat, dotomo=True, rotsignflip=False, apply_edge_correction=False, adjust_tree=False, save_patchres=False, save_filebase='', keep_patchres=False)[source]

Compute a shear 3PCF provided a shape catalog

Parameters
  • cat (orpheus.SpinTracerCatalog) – The shape catalog which is processed

  • dotomo (bool) – Flag that decides whether the tomographic information in the shape catalog should be used. Defaults to True.

  • rotsignflip (bool) – If the shape catalog has been decomposed in patches, choose whether the rotation angle should be flipped. For simulated data this was always ok to set to False. Defaults to False.

  • apply_edge_correction (bool) – Flag that decides how the NPCF in the real space basis is computed. * If set to True the computation is done via edge-correcting the GGG-multipoles * If set to False both GGG and NNN are transformed separately and the ratio is done in the real-space basis Defaults to False.

  • adjust_tree (bool) – Overrides the original setup of the tree-approximations in the instance based on the nbar of the shape catalog. Not implemented yet; has no effect. Defaults to False.

  • save_patchres (bool or str) – If the shape catalog has been decomposed in patches, flag whether to save the GGG measurements on the individual patches. Note that the path needs to exist, otherwise a ValueError is raised. For a flat-sky catalog this parameter has no effect. Defaults to False.

  • save_filebase (str) – Base of the filenames in which the patches are saved. The full filename will be <save_patchres>/<save_filebase>_patchxx.npz. Only has an effect if the shape catalog consists of multiple patches and save_patchres is not False.

  • keep_patchres (bool) – If the catalog consists of multiple patches, returns all measurements on the patches. Defaults to False.

edge_correction(ret_matrices=False)[source]
_multipoles2npcf_py()[source]
multipoles2npcf(projection='Centroid')[source]

Notes

The Upsilon and Norms are only computed for the n>0 multipoles. The n<0 multipoles are recovered by symmetry considerations given in Eq A.6 in Porth+23.

projectnpcf(projection)[source]
_x2centroid()[source]
computeMap3(radii, do_multiscale=False, tofile=False, filtercache=None)[source]

Compute third-order aperture statistics using the polynomial filter.

_map3_filtergrid_singleR(R1, R2, R3)[source]
__map3_filtergrid_singleR(R2, R3, normys_edges, normys_centers, phis)
_map3_filtergrid_multiR(R1, R2, R3)[source]
__map3_filtergrid_multiR(R2, R3, normys_edges, normys_centers, phis, include_measure=True)
class orpheus.npcf_third.GNNCorrelation(min_sep, max_sep, zweighting=False, zweighting_sigma=None, **kwargs)[source]

Bases: BinnedNPCF

Class containing methods to measure and obtain statistics that are built from third-order source-lens-lens (G3L) correlation functions.

min_sep

The smallest distance of each vertex for which the NPCF is computed.

Type

float

max_sep

The largest distance of each vertex for which the NPCF is computed.

Type

float

zweighting

Has no effect at the moment.

Type

bool

zweighting_sigma

Has no effect at the moment.

Type

float or None

Notes

Inherits all other parameters and attributes from BinnedNPCF. Additional child-specific parameters can be passed via kwargs. Either nbinsr or binsize has to be provided to fix the binning scheme.

__process_patches(cat_source, cat_lens, dotomo_source=True, dotomo_lens=True, rotsignflip=False, apply_edge_correction=False, save_patchres=False, save_filebase='', keep_patchres=False)
process(cat_source, cat_lens, dotomo_source=True, dotomo_lens=True, rotsignflip=False, apply_edge_correction=False, save_patchres=False, save_filebase='', keep_patchres=False)[source]

Compute a shear-lens-lens correlation provided a source and a lens catalog.

Parameters
  • cat_source (orpheus.SpinTracerCatalog) – The source catalog which is processed

  • cat_lens (orpheus.ScalarTracerCatalog) – The lens catalog which is processed

  • dotomo_source (bool) – Flag that decides whether the tomographic information in the source catalog should be used. Defaults to True.

  • dotomo_lens (bool) – Flag that decides whether the tomographic information in the lens catalog should be used. Defaults to True.

  • rotsignflip (bool) – If the shape catalog has been decomposed in patches, choose whether the rotation angle should be flipped. For simulated data this was always ok to set to False. Defaults to False.

  • apply_edge_correction (bool) – Flag that decides how the NPCF in the real space basis is computed. * If set to True the computation is done via edge-correcting the GNN-multipoles * If set to False both GNN and NNN are transformed separately and the ratio is done in the real-space basis Defaults to False.

  • save_patchres (bool or str) – If the shape catalog has been decomposed in patches, flag whether to save the GNN measurements on the individual patches. Note that the path needs to exist, otherwise a ValueError is raised. For a flat-sky catalog this parameter has no effect. Defaults to False.

  • save_filebase (str) – Base of the filenames in which the patches are saved. The full filename will be <save_patchres>/<save_filebase>_patchxx.npz. Only has an effect if the shape catalog consists of multiple patches and save_patchres is not False.

  • keep_patchres (bool) – If the catalog consists of multiple patches, returns all measurements on the patches. Defaults to False.

edge_correction(ret_matrices=False)[source]
multipoles2npcf(xi=None)[source]

Notes

  • The Upsilon and Norms are only computed for the n>0 multipoles. The n<0 multipoles are recovered by symmetry considerations, i.e.:

\[\Upsilon_{-n}(\theta_1, \theta_2, z_1, z_2, z_3) = \Upsilon_{n}(\theta_2, \theta_1, z_1, z_3, z_2)\]

As the tomographic bin combinations are interpreted as a flat list, they need to be appropriately shuffled. This is handled by ztiler.

  • When dividing by the (weighted) counts N, all contributions for which N <= 0 are set to zero.

projectnpcf(projection)[source]
computeNNM(radii, do_multiscale=False, xi=None, tofile=False, filtercache=None)[source]

Compute third-order aperture statistics using the polyonomial filter of Crittenden 2002.

_NNM_filtergrid(R1, R2, R3)[source]
__NNM_filtergrid(R2, R3, edges, centers, phis)
class orpheus.npcf_third.NGGCorrelation(min_sep, max_sep, **kwargs)[source]

Bases: BinnedNPCF

Class containing methods to measure and obtain statistics that are built from third-order lens-shear-shear correlation functions.

min_sep

The smallest distance of each vertex for which the NPCF is computed.

Type

float

max_sep

The largest distance of each vertex for which the NPCF is computed.

Type

float

Notes

Inherits all other parameters and attributes from BinnedNPCF. Additional child-specific parameters can be passed via kwargs. Either nbinsr or binsize has to be provided to fix the binning scheme.

Note that the different components of the NGG correlator are ordered as

\[\left[ \tilde{G}_-, \tilde{G}_+, \right] \ ,\]

which is different to the usual conventions, but matches orpheus’ conventions to always start with a correlator in which no polar field is complex conjugated.

__process_patches(cat_source, cat_lens, dotomo_source=True, dotomo_lens=True, rotsignflip=False, apply_edge_correction=False, save_patchres=False, save_filebase='', keep_patchres=False)
process(cat_source, cat_lens, dotomo_source=True, dotomo_lens=True, rotsignflip=False, apply_edge_correction=False, save_patchres=False, save_filebase='', keep_patchres=False)[source]

Compute a lens-shear-shear correlation provided a source and a lens catalog.

Parameters
  • cat_source (orpheus.SpinTracerCatalog) – The source catalog which is processed

  • cat_lens (orpheus.ScalarTracerCatalog) – The lens catalog which is processed

  • dotomo_source (bool) – Flag that decides whether the tomographic information in the source catalog should be used. Defaults to True.

  • dotomo_lens (bool) – Flag that decides whether the tomographic information in the lens catalog should be used. Defaults to True.

  • rotsignflip (bool) – If the shape catalog has been decomposed in patches, choose whether the rotation angle should be flipped. For simulated data this was always ok to set to False. Defaults to False.

  • apply_edge_correction (bool) – Flag that decides how the NPCF in the real space basis is computed. * If set to True the computation is done via edge-correcting the NGG-multipoles * If set to False both NGG and NNN are transformed separately and the ratio is done in the real-space basis Defaults to False.

  • save_patchres (bool or str) – If the shape catalog has been decomposed in patches, flag whether to save the NGG measurements on the individual patches. Note that the path needs to exist, otherwise a ValueError is raised. For a flat-sky catalog this parameter has no effect. Defaults to False.

  • save_filebase (str) – Base of the filenames in which the patches are saved. The full filename will be <save_patchres>/<save_filebase>_patchxx.npz. Only has an effect if the shape catalog consists of multiple patches and save_patchres is not False.

  • keep_patchres (bool) – If the catalog consists of multiple patches, returns all measurements on the patches. Defaults to False.

edge_correction(ret_matrices=False)[source]
multipoles2npcf(integrated=False)[source]

Notes

  • When dividing by the (weighted) counts N, all contributions for which N <= 0 are set to zero.

projectnpcf(projection)[source]
computeNMM(radii, do_multiscale=False, tofile=False, filtercache=None)[source]

Compute third-order aperture statistics

_NMM_filtergrid(R1, R2, R3)[source]
__NMM_filtergrid(R2, R3, edges, centers, phis)
class orpheus.npcf_fourth.NNNNCorrelation_NoTomo(min_sep, max_sep, verbose=False, thetabatchsize_max=10000, method='Tree', **kwargs)[source]

Bases: BinnedNPCF

Class containing methods to measure and obtain statistics that are built from nontomographic fourth-order scalar correlation functions.

min_sep

The smallest distance of each vertex for which the NPCF is computed.

Type

float

max_sep

The largest distance of each vertex for which the NPCF is computed.

Type

float

thetabatchsize_max

The largest number of radial bin combinations that are processed in parallel. Defaults to 10 000.

Type

int, optional

Notes

Inherits all other parameters and attributes from BinnedNPCF. Additional child-specific parameters can be passed via kwargs. Either nbinsr or binsize has to be provided to fix the binning scheme.

process(cat, statistics='all', tofile=False, apply_edge_correction=False, lowmem=True, mapradii=None, batchsize=None, custom_thetacombis=None, cutlen=2147483647)[source]

Arguments:

Logic works as follows: * Keyword ‘statistics’ in [4pcf_real, 4pcf_multipoles, N4, Nap4, Nap4, Nap4c, allNap, all4pcf, all] * - If 4pcf_multipoles in statistics –> save 4pcf_multipoles * - If 4pcf_real in statistics –> save 4pcf_real * - If only N4 in statistics –> Do not save any 4pcf. This is really the lowmem case. * - allNap, all4pcf, all are abbreviations as expected * If lowmem=True, uses the inefficient, but lowmem function for computation and output statistics from there as wanted. * If lowmem=False, use the fast functions to do the 4pcf multipole computation and do the potential conversions lateron. * Default lowmem to None and * - Set to true if any aperture statistics is in stats or we will run into mem error * - Set to false otherwise * - Raise error if lowmem=False and we will have more than 2^31-1 elements at any stage of the computation

custom_thetacombis: array of inds which theta combis will be selected

multipoles2npcf_singlethetcombi(elthet1, elthet2, elthet3)[source]

Converts a 4PCF from the multipole basis to the real-space basis for a fixed combination of radial bins.

class orpheus.npcf_fourth.GGGGCorrelation_NoTomo(min_sep, max_sep, thetabatchsize_max=10000, method='Tree', **kwargs)[source]

Bases: BinnedNPCF

Class containing methods to measure and obtain statistics that are built from nontomographic fourth-order shear correlation functions.

min_sep

The smallest distance of each vertex for which the NPCF is computed.

Type

float

max_sep

The largest distance of each vertex for which the NPCF is computed.

Type

float

thetabatchsize_max

The largest number of radial bin combinations that are processed in parallel. Defaults to 10 000.

Type

int, optional

Notes

Inherits all other parameters and attributes from BinnedNPCF. Additional child-specific parameters can be passed via kwargs. Either nbinsr or binsize has to be provided to fix the binning scheme.

process(cat, statistics='all', tofile=False, apply_edge_correction=False, projection='X', lowmem=None, mapradii=None, batchsize=None, custom_thetacombis=None, cutlen=2147483647)[source]

Arguments:

Logic works as follows: * Keyword ‘statistics’ in [4pcf_real, 4pcf_multipoles, M4, Map4, M4c, Map4c, allMap, all4pcf, all] * - If 4pcf_multipoles in statistics –> save 4pcf_multipoles * - If 4pcf_real in statistics –> save 4pcf_real * - If only M4 in statistics –> Do not save any 4pcf. This is really the lowmem case. * - allMap, all4pcf, all are abbreviations as expected * If lowmem=True, uses the inefficient, but lowmem function for computation and output statistics from there as wanted. * If lowmem=False, use the fast functions to do the 4pcf multipole computation and do the potential conversions lateron. * Default lowmem to None and * - Set to true if any aperture statistics is in stats or we will run into mem error * - Set to false otherwise * - Raise error if lowmem=False and we will have more than 2^31-1 elements at any stage of the computation

custom_thetacombis: array of inds which theta combis will be selected

multipoles2npcf_c(projection='X')[source]

Converts a 4PCF in the multipole basis in the real space basis.

multipoles2npcf_singlethetcombi(elthet1, elthet2, elthet3, projection='X')[source]

Converts a 4PCF from the multipole basis to the real-space basis for a fixed combination of radial bins.

multipoles2npcf_gggg_singletheta_nconvergence(elthet1, elthet2, elthet3, projection='X')[source]

Checks convergence of the conversion between multipole-space and real space for a combination of radial bins.

computeMap4(radii, nmax_trafo=None, basis='MapMx')[source]

Computes the fourth-order aperture mass statistics using the polynomial filter of Crittenden 2002.

projectnpcf(projection)[source]
_x2centroid()[source]
static fourpcf_gauss_x(theta1, theta2, theta3, phi12, phi13, xipspl, ximspl)[source]

Computes disconnected part of the 4pcf in the ‘x’-projection given a splined 2pcf

__gauss4pcf_analytic(theta1, theta2, theta3, xip_arr, xim_arr, thetamin_xi, thetamax_xi, dtheta_xi)
gauss4pcf_analytic(itheta1, itheta2, itheta3, nsubr, xip_arr, xim_arr, thetamin_xi, thetamax_xi, dtheta_xi)[source]
gauss4pcf_multipolebasis(itheta1, itheta2, itheta3, nsubr, xip_arr, xim_arr, thetamin_xi, thetamax_xi, dtheta_xi)[source]
estimateMap4disc(cat, radii, basis='MapMx', fac_minsep=0.05, fac_maxsep=2.0, binsize=0.1, nsubr=3, nsubsample_filter=1)[source]

Estimate disconnected part of fourth-order aperture statistics on a shape catalog.

Map4analytic(mapradii, xip_spl, xim_spl, thetamin_xi, thetamax_xi, ntheta_xi, nsubr=1, nsubsample_filter=1, batchsize=None, basis='MapMx')[source]
getMultipolesFromSymm(nmax_rec, itheta1, itheta2, itheta3, eltrafo)[source]
static MMStar2MapMx_fourth(res_MMStar)[source]

Transforms fourth-order aperture correlators to fourth-order aperture mass. See i.e. Eqs (32)-(36) in Silvestre-Rosello+ 2025 (arxiv.org/pdf/2509.07973).

Direct

class orpheus.direct.DirectEstimator(Rmin, Rmax, nbinsr=None, binsize=None, aperture_centers='grid', accuracies=2.0, frac_covs=[0.0, 0.1, 0.3, 0.5, 1.0], dpix_hash=1.0, weight_outer=1.0, weight_inpainted=0.0, method='Discrete', multicountcorr=True, shuffle_pix=1, tree_resos=[0, 0.25, 0.5, 1.0, 2.0], tree_redges=None, rmin_pixsize=20, resoshift_leafs=0, minresoind_leaf=None, maxresoind_leaf=None, nthreads=16)[source]

Bases: object

Class of aperture statistics up to nth order for various arbitrary tracer catalogs. This class contains attributes and methods that can be used across any of its children.

Rmin

The smallest aperture radius for which the cumulants are computed.

Type

float

Rmax

The largest aperture radius for which the cumulants are computed.

Type

float

nbinsr

The number of radial bins for the aperture radii. If set to None this attribute is inferred from the binsize attribute.

Type

int, optional

binsize

The logarithmic size of the radial bins for the aperture radii. If set to None this attribute is inferred from the nbinsr attribute.

Type

int, optional

aperture_centers

How to sample the apertures. Can be 'grid' or 'density'.

Type

str, optional

accuracies

The sampling density of aperture centers.

  • If aperture_centers is set to 'grid', setting accuracy == x places the apertures on a regular grid with pixel size R_ap / x.

  • If aperture_centers is set to 'density', randomly selects as many galaxies as there would be aperture centers on the regular grid.

Type

int or numpy.ndarray, optional

frac_covs

The different aperture coverage bins for which the statistics are evaluated. The first bin only includes apertures with coverage <= frac_covs[0] while the other coverage bins include the intervals between frac_covs[i] and frac_covs[i+1]. Coverage is defined as the percentage of the aperture area that is not within the survey area.

Type

numpy.ndarray, optional

dpix_hash

The pixel size of the spatial hash used to search through the catalog.

Type

float, optional

weight_outer

The fractional weight applied to galaxies not contained within the interior of the catalog. This only affects catalogs which are overlapping patches of a full-sky catalog.

Type

float, optional

weight_inpainted

The fractional weight applied to virtual galaxies inpainted into the catalog. This only affects catalogs which have objects in them that are labeled as inpainted.

Type

float, optional

method

The method to be employed for the estimator. Defaults to Discrete.

Type

str, optional

multicountcorr

Flag on whether to subtract multiplets in which the same tracer appears more than once. Defaults to True.

Type

bool, optional

shuffle_pix

Choice of how to define centers of the cells in the spatial hash structure. Defaults to 1, i.e. random positioning.

Type

int, optional

tree_resos

The cell sizes of the hierarchical spatial hash structure.

Type

list, optional

tree_redges

Deprecated (possibly).

Type

list, optional

rmin_pixsize

The limiting radial distance relative to the cell of the spatial hash after which one switches to the next hash in the hierarchy. At the moment has no effect. Defaults to 20.

Type

int, optional

resoshift_leafs

Allows for a difference in how the hierarchical spatial hash is traversed for pixels at the base of the NPCF and pixels at leafs. Positive values indicate that leafs will be evaluated at coarser resolutions than the base. At the moment does have no effect. Defaults to 0.

Type

int, optional

minresoind_leaf

Sets the smallest resolution in the spatial hash hierarchy which can be used to access tracers at leaf positions. If set to None uses the smallest specified cell size. At the moment has no effect. Defaults to None.

Type

int, optional

maxresoind_leafint, optional

Sets the largest resolution in the spatial hash hierarchy which can be used to access tracers at leaf positions. If set to None uses the largest specified cell size. At the moment has no effect. Defaults to None.

nthreadsint, optional

The number of OpenMP threads used for the reduction procedure. Defaults to 16.

get_pixelization(cat, R_ap, accuracy, R_crop=None, mgrid=True)[source]

Computes pixel grid on inner region of survey field.

Parameters
  • R_ap (float) – The radius of the aperture in pixel scale.

  • accuracy (float) – Accuracy parameter for the pixel grid. A value of 0.5 results in a grid in which the apertures are only touching each other - hence minimizing correlations.

Returns

  • grid_x (array of floats) – The grid cell centers for the x-coordinate.

  • grid_y (array of floats) – The grid cell centers for the y-coordinate.

  • Notes

  • ——

  • The grid covers the rectangle between the extremal x/y coordinates of

  • the galaxy catalogue.

__getmap(R, cat, dotomo, field, filter_form)

This simply computes an aperture mass map together with weights and coverages

class orpheus.direct.Direct_MapnEqual(order_max, Rmin, Rmax, field='polar', filter_form='C02', ap_weights='InvShot', **kwargs)[source]

Bases: DirectEstimator

Compute direct estimator for equal-scale aperture mass statistics.

order_max

Maximum order of the statistics to be computed.

Type

int

Rmin

Minimum aperture radius.

Type

float

Rmax

Maximum aperture radius.

Type

float

field

Type of input field ("scalar" or "polar").

Type

str, optional

filter_form

Filter type used in the aperture function ("S98", "C02", "Sch04", etc.).

Type

str, optional

ap_weights

Aperture weighting strategy ("Identity", "InvShot").

Type

str, optional

\*\*kwargs

Additional keyword arguments passed to DirectEstimator.

Type

dict

Notes

Inherits all other parameters and attributes from DirectEstimator. Additional child-specific parameters can be passed via kwargs.

process(cat, dotomo=True, Emodeonly=True, connected=True, dpix_innergrid=2.0)[source]

Computes aperture statistics on a catalog.

Parameters
  • cat (orpheus.SpinTracerCatalog) – The catalog instance to be processed.

  • dotomo (bool, optional) – Whether to compute the statistics for all tomographic bin combinations. Default is True.

  • Emodeonly (bool, optional) – Currently does not have an impact. Default is True.

  • connected (bool, optional) – Whether to output only the connected part of the aperture mass statistics. Does not have an impact at the moment. Default is True.

  • dpix_innergrid (float, optional) – Pixel size for a rough reconstruction of the angular mask. Used to preselect aperture centers in the interior of the survey. Default is 2.

Returns

Currently does not return any value.

Return type

None

_getindex(order, mode, zcombi)[source]
_buildargs(cat, args_innergrid, dotomo, indR, forfunc='Equal')[source]
_nzcombis_tot(nbinsz, dotomo)[source]
_nzcombis_order(order, nbinsz, dotomo)[source]
_cumnzcombis_order(order, nbinsz, dotomo)[source]
genzcombi(zs, nbinsz=None)[source]

Returns index of tomographic bin combination of Map^n output.

Parameters
  • zs (list of integers) – Target combination of tomographic redshifts ([z1, …, zk]).

  • nbinsz (int, optional) – The number of tomographic bins in the computation of Map^n. If not set, reverts to corresponding class attribute.

Returns

zind_flat – Index of flattened Map^k(z1,…,zk) datavector in global output.

Return type

int

getmap(indR, cat, dotomo=True)[source]

Computes various maps that are part of the basis of the Map^n estimator.

Parameters
  • indR (int) – Index of aperture radius for which maps are computed.

  • cat (orpheus.SpinTracerCatalog) – The catalog instance to be processed.

  • dotomo (bool, optional) – Whether the tomographic information in cat should be used for the map construction.

Returns

counts – Aperture number counts.

Return type

ndarray

class orpheus.direct.Direct_NapnEqual(order_max, Rmin, Rmax, field='scalar', filter_form='C02', ap_weights='Identity', **kwargs)[source]

Bases: DirectEstimator

Compute direct estimator for equal-scale aperture counts statistics.

order_max

Maximum order of the statistics to be computed.

Type

int

Rmin

Minimum aperture radius.

Type

float

Rmax

Maximum aperture radius.

Type

float

field

Type of input field ("scalar" or "polar").

Type

str, optional

filter_form

Filter type used in the aperture function ("S98", "C02", "Sch04", etc.).

Type

str, optional

ap_weights

Aperture weighting strategy ("Identity", "InvShot").

Type

str, optional

\*\*kwargs

Additional keyword arguments passed to DirectEstimator.

Type

dict

Notes

Inherits all other parameters and attributes from DirectEstimator. Additional child-specific parameters can be passed via kwargs.

process(cat, dotomo=True, Nbar_policy=1, connected=True, dpix_innergrid=2.0)[source]

Computes aperture statistics on a catalog.

Parameters
  • cat (orpheus.SpinTracerCatalog) – The catalog instance to be processed.

  • dotomo (bool, optional) – Whether to compute the statistics for all tomographic bin combinations. Default is True.

  • Nbar_policy (int, optional) –

    What normalization to use:

    0 : Use local Nbar for normalization 1 : Use global Nbar for normalization 2 : No Nbar for normalization

    Default is 1.

  • connected (bool, optional) – Whether to output only the connected part of the aperture mass statistics. Does not have an impact at the moment.

  • dpix_innergrid (float, optional) – Pixel size for a rough reconstruction of the angular mask. Used to preselect aperture centers in the interior of the survey. Default is 2.

Returns

Currently does not return any value.

Return type

None

_getindex(order, mode, zcombi)[source]
_buildargs(cat, args_innergrid, dotomo, Nbar_policy, indR, forfunc='Equal')[source]
_nzcombis_tot(nbinsz, dotomo)[source]
_nzcombis_order(order, nbinsz, dotomo)[source]
_cumnzcombis_order(order, nbinsz, dotomo)[source]
genzcombi(zs, nbinsz=None)[source]
getnap(indR, cat, dotomo=True)[source]

This simply computes an aperture mass map together with weights and coverages

class orpheus.direct.MapCombinatorics(nradii, order_max)[source]

Bases: object

psumtot(n, m)[source]

Calls to (n-1)-fold nested loop over m indicices where i1 <= i2 <= … <= in. This is equivalent to the number of independent Map^i components over a range of m radii (0<i<=n) as well as to the size of the multivariate power sum set generating those multivariate cumulants.

It can alternatively be used do count through the flattened redshift indices for a single-scale computation up until a maximum order.

Example: psumtot(m=10,n=4) gives the same result as the code >>> res = 0 >>> for i1 in range(10): >>> for i2 in range(i1,10): >>> for i3 in range(i2,10): >>> res += 1 >>> print(res)

Notes: * The recursion reads as follows:

s(m,0) = 1 s(m,n) = sum_{i=1}^{m-1} s(m-1,n-1) [Have not formally proved that but checked with pen and paper up until n=3 on examples and the underlying geometry does make sense. Testing against nested loops also works as long as the loops can be computed in a sensible amount of time]

  • As the solution is recusive and therefore might take long to compute we use a memoization technique to get rid of all of the unneccessary nested calls.

sel2ind(sel)[source]

Assignes unique index to given selection in powr sum set Note that sel[0] <= sel[1] <= … <= sel[self.nradii-1] is required!

ind2sel(ind)[source]

Inverse of sel2ind…NOT WORKING YET

class orpheus.direct.Direct_Map3Unequal(Rmin, Rmax, field='polar', filter_form='C02', ap_weights='InvShot', **kwargs)[source]

Bases: DirectEstimator

process_discrete(cat, dotomo=True, Emodeonly=True, connected=True, dpix_innergrid=2.0)[source]