Compute the lensing kernel for a given redshift distribution.
nz – list of redshift distributions
nz_tot – total redshift distribution
cosmo – PyCosmo cosmology instance
list of lensing kernels for each redshift distribution and total lensing kernel
Find the bin threshold when splitting the data into equally populated bins. Lower and upper cuts can be defined which are then used as an additional bin between -inf and lower cut and upper cut and inf. This can e.g. be used to have a bin which you exclude from the analysis.
x – data to bin
n_bins – number of bins
lower_cut – lower cut
upper_cut – upper cut
bin thresholds
Creates redshift bins following an overall Smail-type distribution
bins – number of bins
sigma_z – array with the photometric_scatter per bin
max_z – maximum redshift
min_z – minimum redshift
num_z – size of the returned redshift array
redshift_dep – boolean if the photometric scatter has a redshift dependence sigma_z*(1+z)
z_t – thresholds for the different bins. If None, the thresholds are computed
normalize_bins – If returned bins should be normalized
distribution – type of the overall redshift distribution, options are “smail” or “fu”
distribution_parameters – paramters that specify the Smail-type or Fu-type distribution
list with num_zx2 arrays with redshift on [:,0] and n(z) on [:,1]
ValueError – if distribution is not “smail” or “fu”
find redshift thresholds given the overall redshift distribution to split the redshift distribution in equally populated bins
distribution – function of redshift for the overall redshift distribution
n_bins – number of bins in which the overall redshift distribution is cut
z_max – maximum redshift
num_z – number of points used for the interpolation
dist_params – parameters of the distribution
list with the threshold values starting including start value (0) and final value (z_max)
Convolve a redshift distribution with a Gaussian kernel with no redshift dependence.
n – redshift distribution
z – redshift array
sigma – width of the Gaussian kernel
convolved redshift distribution
Fu-type function for the overall redshift distribution. (z**a + a**(a*b)) / (z**b + c) * A Default values are taken from Fu et al. arXiv:0712.0884
z – redshift
a – parameter of the Fu-type distribution
b – parameter of the Fu-type distribution
c – parameter of the Fu-type distribution
A – normalization of the Fu-type distribution
Fu-type redshift distribution
Normalize a function to 1
y – function values
x – x values
normalized function
Saves redshift bins separetely in .txt files
nz – list of redshift bins with z and n(z)
path – path where to save the file
Smail-type function for the overall redshift distribution z**alpha * np.exp( -(z/z0)**beta) * normalization
z – redshift
alpha – parameter of the Smail-type distribution
beta – parameter of the Smail-type distribution
z0 – parameter of the Smail-type distribution
normalization – normalization of the Smail-type distribution
Smail-type redshift distribution
Compute the total redshift distribution from a set of redshift distributions.
nz – list of redshift distributions
total redshift distribution
Normalize a set of redshift distributions.
nz – list of redshift distributions
list of normalized redshift distributions
Compute the overlap between two redshift distributions.
bin1 – first redshift distribution
bin2 – second redshift distribution
overlap
Compute the overlap between all redshift distributions.
nz – list of redshift distributions
overlap matrix
Resample a distribution with a given set of bins.
xp – new bins
x – old bins
y – old distribution
interp_kind – interpolation method
resampled distribution
Shift a set of redshift distributions by a given set of shift factors.
nz_fid – list of redshift distributions
delta_z – list of shift factors
list of shifted redshift distributions
Shift and stretch a set of redshift distributions.
nz – list of redshift distributions
z_bias – list of shift factors
z_sigma – list of stretch factors
list of shifted and stretched redshift distributions
Stretch a set of redshift distributions by a given set of stretch factors.
NZ – list of redshift distributions
sigma_z – list of stretch factors
normalize – normalize the stretched distributions
list of stretched redshift distributions
Get the maximum number of bins.
nz – list of redshift distributions
maximum number of bins
Plot the redshift bins.
nz – list of redshift distributions
nz_tot – total redshift distribution
nz_is_path – if True, the redshift distributions are loaded from the given paths
colors – list of colors
linestyle – list of linestyles
figsize – figure size
subplots_args – arguments for the subplots (dict)
plot_args – arguments for the plot (dict)
Plot the redshift bins in two panels.
nz_up – list of redshift distributions for the upper panel
nz_down – list of redshift distributions for the lower panel
nz_tot_up – total redshift distribution for the upper panel
nz_tot_down – total redshift distribution for the lower panel
nz_up_is_path – if True, the redshift distributions are loaded from the given paths
nz_down_is_path – if True, the redshift distributions are loaded from the given paths
y_labels – list of y labels
colors – list of colors for the different bins of the redshift distributions
linestyle – list of linestyles for the different bins of the redshift distributions
figsize – figure size