SciPy

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_arrlist of Spectrum or ndarray

List of Spectrum to be stored together.

engndarray

The energy abscissa of each Spectrum.

in_engndarray

The injection energy abscissa.

rsndarray
dlnzfloat

d ln(1+z) associated with this transfer function.

spec_type{‘N’, ‘dNdE’}, optional

The type of spectrum saved.

rsfloat

Redshift of this transfer function.

rebin_engndarray, optional

New abscissa to rebin all of the Spectrum objects into.

with_interp_funcbool

If true, also returns an interpolation function of the grid.

Attributes:
spec_arrlist of Spectrum

List of Spectrum to be stored together.

dlnzfloat

d ln(1+z) associated with this transfer function.

rsfloat

Redshift of this transfer function.

interp_funcfunction

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.

to_dict()

Return hdf5 compatible dictionary.

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)

Methods

__add__(other)

Adds two Spectra instances together, or an array to the Spectra.

__delattr__(name, /)

Implement delattr(self, name).

__dir__(/)

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getitem__(key)

__getstate__(/)

Helper for pickle.

__gt__(value, /)

Return self>value.

__hash__(/)

Return hash(self).

__init__(spec_arr[, eng, in_eng, rs, dlnz, ...])

__init_subclass__

This method is called when a class is subclassed.

__iter__()

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__mul__(other)

Takes a product with the spectra with a Spectra object, array or number.

__ne__(value, /)

Return self!=value.

__neg__()

Negates the spectra.

__new__(*args, **kwargs)

__radd__(other)

Adds two Spectra instances together, or an array to the spectra.

__reduce__(/)

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__(/)

Return repr(self).

__rmul__(other)

Takes a product with the spectra with a Spectra object, array or number.

__rsub__(other)

Subtracts this Spectra from another or an array.

__rtruediv__(other)

Divides an object by the spectra.

__setattr__(name, value, /)

Implement setattr(self, name, value).

__setitem__(key, value)

__sizeof__(/)

Size of object in memory, in bytes.

__str__(/)

Return str(self).

__sub__(other)

Subtracts a Spectra or array from this Spectra.

__subclasshook__

Abstract classes can override this to customize issubclass().

__truediv__(other)

Divides the spectra by another object.

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.

to_dict()

Return hdf5 compatible dictionary.

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

__annotations__

__array_priority__

__dict__

__doc__

__module__

__weakref__

list of weak references to the object

eng

eng_underflow

grid_vals

in_eng

rs

spec_type