darkhistory.spec.transferfunction.TransFuncAtRedshift¶
-
class
darkhistory.spec.transferfunction.
TransFuncAtRedshift
(spec_arr, eng=None, in_eng=None, rs=None, dlnz=-1, spec_type='dNdE', rebin_eng=None, with_interp_func=False)¶ Transfer function at a given redshift.
Collection of Spectrum objects, each at different injection energies.
Parameters: - spec_arr : list of Spectrum or ndarray
List of Spectrum to be stored together.
- eng : ndarray
The energy abscissa of each Spectrum.
- in_eng : ndarray
The injection energy abscissa.
- rs : ndarray
- dlnz : float
d ln(1+z) associated with this transfer function.
- spec_type : {‘N’, ‘dNdE’}, optional
The type of spectrum saved.
- rs : float
Redshift of this transfer function.
- rebin_eng : ndarray, optional
New abscissa to rebin all of the Spectrum objects into.
- with_interp_func : bool
If true, also returns an interpolation function of the grid.
Attributes: - spec_arr : list of Spectrum
List of Spectrum to be stored together.
- dlnz : float
d ln(1+z) associated with this transfer function.
- rs : float
Redshift of this transfer function.
- interp_func : function
The 2D interpolation function.
Methods
append
(spec)Appends a new Spectrum. at_eng
(new_eng[, interp_type, bounds_error, …])Interpolates the transfer function at a new energy abscissa. at_in_eng
(new_eng[, interp_type, …])Interpolates the transfer function at a new injection energy. at_rs
(new_rs[, interp_type, bounds_err, …])Interpolates the transfer function at a new redshift. at_val
(new_in_eng, new_eng[, interp_type, …])2D interpolation at specified abscissa. integrate_each_spec
([weight])Sums over each individual spectrum with some weight. plot
(ax[, ind, step, indtype, fac])Plots the contained Spectrum objects. rebin
(out_eng)Re-bins all Spectrum objects according to a new abscissa. redshift
(rs_arr)Redshifts the stored spectra. sum_specs
([weight])Sums the spectrum in each energy bin, weighted by weight. switch_spec_type
([target])Switches between the type of values to be stored. totN
([bound_type, bound_arr])Returns the total number of particles in part of the spectra. toteng
([bound_type, bound_arr])Returns the total energy of particles in part of the spectra. -
__init__
(spec_arr, eng=None, in_eng=None, rs=None, dlnz=-1, spec_type='dNdE', rebin_eng=None, with_interp_func=False)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(spec_arr[, eng, in_eng, rs, dlnz, …])Initialize self. append
(spec)Appends a new Spectrum. at_eng
(new_eng[, interp_type, bounds_error, …])Interpolates the transfer function at a new energy abscissa. at_in_eng
(new_eng[, interp_type, …])Interpolates the transfer function at a new injection energy. at_rs
(new_rs[, interp_type, bounds_err, …])Interpolates the transfer function at a new redshift. at_val
(new_in_eng, new_eng[, interp_type, …])2D interpolation at specified abscissa. integrate_each_spec
([weight])Sums over each individual spectrum with some weight. plot
(ax[, ind, step, indtype, fac])Plots the contained Spectrum objects. rebin
(out_eng)Re-bins all Spectrum objects according to a new abscissa. redshift
(rs_arr)Redshifts the stored spectra. sum_specs
([weight])Sums the spectrum in each energy bin, weighted by weight. switch_spec_type
([target])Switches between the type of values to be stored. totN
([bound_type, bound_arr])Returns the total number of particles in part of the spectra. toteng
([bound_type, bound_arr])Returns the total energy of particles in part of the spectra. Attributes
N_underflow
eng
eng_underflow
grid_vals
in_eng
rs
spec_type