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:
objectClass 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
- weight
The weights of the tracer objects. If set to
Noneall 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
Noneall zbins are assumed to be zero.- Type
numpy.ndarray, optional, defaults to
None
- isinner
A flag signaling whether a tracer is within the interior part of the footprint
- Type
- 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'
- hasspatialhash
Flag on whether a spatial hash structure has been allocated for the catalog
- Type
- index_matcher
Indicates on whether there is a tracer in each of the pixels in the spatial hash.
- Type
Note
The
zbinsparameter 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.
- _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 toNonethe 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 toNonethe 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 toNone. Each element equal toNonesets 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
Cataloginstance. Defaults toFalse.
- _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 toNoneuses the largest value ofdpixs.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 toNone. Each element equal toNonesets 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_matchersarrays for each of the catalogs in the hierarchy. See theindex_matcherattribute for more information.pixs_galind_bounds (list) – Contains the
pixs_galind_boundsarrays for each of the catalogs in the hierarchy. See thepixs_galind_boundsattribute for more information.pix_gals (list) – Contains the
pix_galsarrays for each of the catalogs in the hierarchy. See thepix_galsattribute 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
- 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.
- __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 toNone. Each element equal toNonesets 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,CICandTSCassignment. Defaults toCIC.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
Cataloginstance. Defaults toFalse.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
normedparametermethod (str) – Same as the
methodparameter
- 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 toNone. Each element equal toNonesets 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_dandpix2_dattributes 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 toNonethe 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 toNone. Each element equal toNonesets 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:
CatalogClass constructor.
- pos1
The \(x\)-positions of the tracer objects
- Type
- pos2
The \(y\)-positions of the tracer objects
- Type
- tracer
The values of the scalar tracer field, i.e. galaxy weights or cosmic convergence.
- Type
Notes
Inherits all other parameters and attributes from
Catalog. Additional child-specific parameters can be passed viakwargs.- 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 toNonethe 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 toNonethe 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 toNone. Each element equal toNonesets 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
Cataloginstance. Defaults toFalse.
- 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 toNoneuses the largest value ofdpixs.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 toNone. Each element equal toNonesets 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._multihashmethod- Return type
- class orpheus.catalog.SpinTracerCatalog(spin, pos1, pos2, tracer_1, tracer_2, **kwargs)[source]
Bases:
CatalogClass constructor.
- pos1
The \(x\)-positions of the tracer objects
- Type
- pos2
The \(y\)-positions of the tracer objects
- Type
- tracer_1
The values of the real part of the tracer field, i.e. galaxy ellipticities.
- Type
- tracer_2
The values of the imaginary part of the tracer field, i.e. galaxy ellipticities.
- Type
Notes
Inherits all other parameters and attributes from
Catalog. Additional child-specific parameters can be passed viakwargs.- 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 toNonethe 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 toNonethe 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 toNone. Each element equal toNonesets 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
Cataloginstance. Defaults toFalse.
- 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 toNoneuses the largest value ofdpixs.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 toNone. Each element equal toNonesets 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._multihashmethod- Return type
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:
objectClass 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.
- nbinsr
The number of radial bins for each vertex of the NPCF. If set to
Nonethis attribute is inferred from thebinsizeattribute.- Type
int, optional
- binsize
The logarithmic size of the radial bins for each vertex of the NPCF. If set to
Nonethis attribute is inferred from thenbinsrattribute.- 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
- 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
- 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
Noneuses the smallest specified cell size. Defaults toNone.- 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
Noneuses the largest specified cell size. Defaults toNone.- 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
- bin_centers_mean
The centers of the radial bins averaged over all combination of tomographic redshifts.
- Type
- 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
- 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
- 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
- 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
- is_edge_corrected
Flag signifying on whether the NPCF multipoles have been edge-corrected. Defaults to
False.- Type
- class orpheus.npcf_second.NNCorrelation(min_sep, max_sep, shuffle_pix=1, **kwargs)[source]
Bases:
BinnedNPCFCompute 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
- npair_cell
The number cell-pairs.
- Type
- xi
The scalar two-point correlation function.
- Type
Notes
Inherits all other parameters and attributes from
BinnedNPCF.Additional child-specific parameters can be passed via
kwargs.Binning: - Either
nbinsrorbinsizemust 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=1is the default (random cell centers). - This differs from shear-based correlation functions where another default may be used.Estimator: The scalar correlation function
xiis formed from the pair counts via the Landy-Szalay estimator\[\xi(r) = \frac{DD(r) - 2\,DR(r) + RR(r)}{RR(r)}.\]
- __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_randomis provided,xiis 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
xiis 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
xiis 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')
- class orpheus.npcf_second.GGCorrelation(min_sep, max_sep, **kwargs)[source]
Bases:
BinnedNPCFCompute second-order correlation functions of spin-2 fields.
- Parameters
- xip
The ξ₊ correlation function.
- Type
- xim
The ξ₋ correlation function.
- Type
- norm
The number of weighted pairs.
- Type
- npair
The number of unweighted pairs.
- Type
Notes
Inherits all other parameters and attributes from
BinnedNPCF. Additional child-specific parameters can be passed viakwargs. Eithernbinsrorbinsizehas to be provided to fix the binning scheme.- __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 toFalse.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
ValueErroris raised. For a flat-sky catalog this parameter has no effect. Defaults toFalse.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.
- class orpheus.npcf_third.GGGCorrelation(n_cfs, min_sep, max_sep, **kwargs)[source]
Bases:
BinnedNPCFClass containing methods to measure and obtain statistics that are built from third-order shear correlation functions.
Notes
Inherits all other parameters and attributes from
BinnedNPCF. Additional child-specific parameters can be passed viakwargs. Eithernbinsrorbinsizehas to be provided to fix the binning scheme.- __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 toFalse.apply_edge_correction (bool) – Flag that decides how the NPCF in the real space basis is computed. * If set to
Truethe computation is done via edge-correcting the GGG-multipoles * If set toFalseboth GGG and NNN are transformed separately and the ratio is done in the real-space basis Defaults toFalse.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
ValueErroris raised. For a flat-sky catalog this parameter has no effect. Defaults toFalse.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.
- 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.
- computeMap3(radii, do_multiscale=False, tofile=False, filtercache=None)[source]
Compute third-order aperture statistics using the polynomial filter.
- __map3_filtergrid_singleR(R2, R3, normys_edges, normys_centers, phis)
- __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:
BinnedNPCFClass containing methods to measure and obtain statistics that are built from third-order source-lens-lens (G3L) correlation functions.
Notes
Inherits all other parameters and attributes from
BinnedNPCF. Additional child-specific parameters can be passed viakwargs. Eithernbinsrorbinsizehas 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 toFalse.apply_edge_correction (bool) – Flag that decides how the NPCF in the real space basis is computed. * If set to
Truethe computation is done via edge-correcting the GNN-multipoles * If set toFalseboth GNN and NNN are transformed separately and the ratio is done in the real-space basis Defaults toFalse.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
ValueErroris raised. For a flat-sky catalog this parameter has no effect. Defaults toFalse.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 andsave_patchresis notFalse.keep_patchres (bool) – If the catalog consists of multiple patches, returns all measurements on the patches. Defaults to
False.
- 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 whichN <= 0are set to zero.
- 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(R2, R3, edges, centers, phis)
- class orpheus.npcf_third.NGGCorrelation(min_sep, max_sep, **kwargs)[source]
Bases:
BinnedNPCFClass containing methods to measure and obtain statistics that are built from third-order lens-shear-shear correlation functions.
Notes
Inherits all other parameters and attributes from
BinnedNPCF. Additional child-specific parameters can be passed viakwargs. Eithernbinsrorbinsizehas 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 toFalse.apply_edge_correction (bool) – Flag that decides how the NPCF in the real space basis is computed. * If set to
Truethe computation is done via edge-correcting the NGG-multipoles * If set toFalseboth NGG and NNN are transformed separately and the ratio is done in the real-space basis Defaults toFalse.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
ValueErroris raised. For a flat-sky catalog this parameter has no effect. Defaults toFalse.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 andsave_patchresis notFalse.keep_patchres (bool) – If the catalog consists of multiple patches, returns all measurements on the patches. Defaults to
False.
- multipoles2npcf(integrated=False)[source]
Notes
When dividing by the (weighted) counts
N, all contributions for whichN <= 0are set to zero.
- computeNMM(radii, do_multiscale=False, tofile=False, filtercache=None)[source]
Compute third-order aperture statistics
- __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:
BinnedNPCFClass containing methods to measure and obtain statistics that are built from nontomographic fourth-order scalar correlation functions.
- 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 viakwargs. Eithernbinsrorbinsizehas 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
- class orpheus.npcf_fourth.GGGGCorrelation_NoTomo(min_sep, max_sep, thetabatchsize_max=10000, method='Tree', **kwargs)[source]
Bases:
BinnedNPCFClass containing methods to measure and obtain statistics that are built from nontomographic fourth-order shear correlation functions.
- 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 viakwargs. Eithernbinsrorbinsizehas 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.
- 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.
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:
objectClass 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.
- nbinsr
The number of radial bins for the aperture radii. If set to
Nonethis attribute is inferred from thebinsizeattribute.- Type
int, optional
- binsize
The logarithmic size of the radial bins for the aperture radii. If set to
Nonethis attribute is inferred from thenbinsrattribute.- Type
int, optional
- accuracies
The sampling density of aperture centers.
If
aperture_centersis set to'grid', settingaccuracy == xplaces the apertures on a regular grid with pixel sizeR_ap / x.If
aperture_centersis 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 betweenfrac_covs[i]andfrac_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
- 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
- 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
Noneuses the smallest specified cell size. At the moment has no effect. Defaults toNone.- 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
Noneuses the largest specified cell size. At the moment has no effect. Defaults toNone.- 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
- 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:
DirectEstimatorCompute direct estimator for equal-scale aperture mass statistics.
- filter_form
Filter type used in the aperture function (
"S98","C02","Sch04", etc.).- Type
str, optional
- \*\*kwargs
Additional keyword arguments passed to
DirectEstimator.- Type
Notes
Inherits all other parameters and attributes from
DirectEstimator. Additional child-specific parameters can be passed viakwargs.- 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
- genzcombi(zs, nbinsz=None)[source]
Returns index of tomographic bin combination of Map^n output.
- Parameters
- Returns
zind_flat – Index of flattened Map^k(z1,…,zk) datavector in global output.
- Return type
- class orpheus.direct.Direct_NapnEqual(order_max, Rmin, Rmax, field='scalar', filter_form='C02', ap_weights='Identity', **kwargs)[source]
Bases:
DirectEstimatorCompute direct estimator for equal-scale aperture counts statistics.
- filter_form
Filter type used in the aperture function (
"S98","C02","Sch04", etc.).- Type
str, optional
- \*\*kwargs
Additional keyword arguments passed to
DirectEstimator.- Type
Notes
Inherits all other parameters and attributes from
DirectEstimator. Additional child-specific parameters can be passed viakwargs.- 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
- 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.
- class orpheus.direct.Direct_Map3Unequal(Rmin, Rmax, field='polar', filter_form='C02', ap_weights='InvShot', **kwargs)[source]
Bases:
DirectEstimator