firecrown.likelihood.gauss_family.statistic.two_point.TwoPoint#
- class firecrown.likelihood.gauss_family.statistic.two_point.TwoPoint(sacc_data_type, source0, source1, ell_for_xi=None, ell_or_theta=None, ell_or_theta_min=None, ell_or_theta_max=None)[source]#
Bases:
StatisticA two-point statistic.
For example, shear correlation function, galaxy-shear correlation function, etc.
- Parameters:
sacc_data_type (str) –
The kind of two-point statistic. This must be a valid SACC data type that maps to one of the CCL correlation function kinds or a power spectra. Possible options are
galaxy_density_cl : maps to ‘cl’ (a CCL angular power spectrum)
galaxy_density_xi : maps to ‘gg’ (a CCL angular position corr. function)
galaxy_shearDensity_cl_e : maps to ‘cl’ (a CCL angular power spectrum)
galaxy_shearDensity_xi_t : maps to ‘gl’ (a CCL angular cross-correlation between position and shear)
galaxy_shear_cl_ee : maps to ‘cl’ (a CCL angular power spectrum)
galaxy_shear_xi_minus : maps to ‘l-’ (a CCL angular shear corr. function xi-)
galaxy_shear_xi_plus : maps to ‘l+’ (a CCL angular shear corr. function xi-)
cmbGalaxy_convergenceDensity_xi : maps to ‘gg’ (a CCL angular position corr. function)
cmbGalaxy_convergenceShear_xi_t : maps to ‘gl’ (a CCL angular cross- correlation between position and shear)
source0 (Source) – The first sources needed to compute this statistic.
source1 (Source) – The second sources needed to compute this statistic.
ell_or_theta (dict, optional) –
A dictionary of options for generating the ell or theta values at which to compute the statistics. This option can be used to have firecrown generate data without the corresponding 2pt data in the input SACC file. The options are:
min : float - The start of the binning.
max : float - The end of the binning.
n : int - The number of bins. Note that the edges of the bins start at min and end at max. The actual bin locations will be at the (possibly geometric) midpoint of the bin.
binning : str, optional - Pass ‘log’ to get logarithmic spaced bins and ‘lin’ to get linearly spaced bins. Default is ‘log’.
ell_or_theta_min (float, optional) – The minimum ell or theta value to keep. This minimum is applied after the ell or theta values are read and/or generated.
ell_or_theta_max (float, optional) – The maximum ell or theta value to keep. This maximum is applied after the ell or theta values are read and/or generated.
ell_for_xi (dict, optional) –
A dictionary of options for making the ell values at which to compute Cls for use in real-space integrations. The possible keys are:
minimum : int, optional - The minimum angular wavenumber to use for real-space integrations. Default is 2.
midpoint : int, optional - The midpoint angular wavenumber to use for real-space integrations. The angular wavenumber samples are linearly spaced at integers between minimum and midpoint. Default is 50.
maximum : int, optional - The maximum angular wavenumber to use for real-space integrations. The angular wavenumber samples are logarithmically spaced between midpoint and maximum. Default is 60,000.
n_log : int, optional - The number of logarithmically spaced angular wavenumber samples between mid and max. Default is 200.
- Variables:
ccl_kind (str) – The CCL correlation function kind or ‘cl’ for power spectra corresponding to the SACC data type.
sacc_tracers (2-tuple of str) – A tuple of the SACC tracer names for this 2pt statistic. Set after a call to read.
ell_or_theta (npt.NDArray[np.float64]) – The final array of ell/theta values for the statistic. Set after compute is called.
measured_statistic (npt.NDArray[np.float64]) – The measured value for the statistic.
predicted_statistic (npt.NDArray[np.float64]) – The final prediction for the statistic. Set after compute is called.
Public Methods:
__init__(sacc_data_type, source0, source1[, ...])Updatable initialization.
read(sacc_data)Read the data for this statistic from the SACC file.
See _ell_for_xi.
Return this statistic's data vector.
calculate_pk(pk_name, tools, tracer0, tracer1)Return the power spectrum named by pk_name.
Inherited from
Statistic__init__([parameter_prefix])Updatable initialization.
read(_)Read the data for this statistic and mark it as ready for use.
Gets the statistic data vector.
compute_theory_vector(tools)Compute a statistic from sources, applying any systematics.
Returns the last computed theory vector.
Inherited from
Updatable__init__([parameter_prefix])Updatable initialization.
__setattr__(key, value)Set the attribute named
keyto the supplied value.set_parameter(key, value)Sets the parameter to the given value.
set_internal_parameter(key, value)Assure this InternalParameter has not already been set, and then set it.
set_sampler_parameter(key, value)Assure this SamplerParameter has not already been set, and then set it.
update(params)Update self by calling to prepare for the next MCMC sample.
Determine if the object has been updated.
reset()Reset the updatable.
Returns a RequiredParameters object.
Returns a collection of derived parameters.
Private Methods:
_compute_theory_vector(tools)Compute a two-point statistic from sources.
Inherited from
Statistic_reset()Reset this statistic.
_compute_theory_vector(tools)Compute a statistic from sources, concrete implementation.
Inherited from
Updatable_update(params)Method for auxiliary updates to be made to an updatable.
_reset()Abstract method implemented by all concrete classes to update self.
Return a RequiredParameters object containing the information for this class.
Returns the derived parameters of an implementation.
- _compute_theory_vector(tools)[source]#
Compute a two-point statistic from sources.
- Parameters:
tools (
ModelingTools) –- Return type:
- calculate_ell_or_theta()[source]#
See _ell_for_xi.
- This method mixes together:
the default parameters in ELL_FOR_XI_DEFAULTS
the first and last values in self.theory_window_function.values
and then calls _ell_for_xi with those arguments, returning whatever it returns.
It is an error to call this function if self.theory_window_function has not been set. That is done in read, but might result in the value being re-set to None.:w
- calculate_pk(pk_name, tools, tracer0, tracer1)[source]#
Return the power spectrum named by pk_name.
- Parameters:
pk_name (
str) –tools (
ModelingTools) –tracer0 (
Tracer) –tracer1 (
Tracer) –