srcmodel.spectrum¶
-
ximpol.srcmodel.spectrum.
int_eflux2pl_norm
(integral, emin, emax, index, erg=True)[source]¶ Convert an integral energy flux into the corresponding power-law normalization.
-
ximpol.srcmodel.spectrum.
pl_norm
(integral, emin, emax, index, energy_power=0.0)[source]¶ Return the power-law normalization resulting in a given integral flux (or integral energy flux, or more in general integral of the flux multiplied by a generic power of the energy) between the minimum and maximum energies assuming a given spectral index.
More specifically, given a power law of the form
(where ) we define and calculate
Hence
Parameters: - integral (float or array) – The value of the integral flux or energy-to-some-power flux
- emin (float) – The minimum energy for the integral flux
- emax (float) – The maximum energy for the integral flux
- index (float) – The power-law index
- energy_power (float) – The power of the energy in the integral
- erg (bool) – if True, convert erg to keV in the calculation.
-
ximpol.srcmodel.spectrum.
power_law
(C, Gamma)[source]¶ Photon energy spectrum as a function of energy and time.
If C and Gamma are callable, we assume that the argument of the __call__ function is the time, and this is how we treat them internally.
-
class
ximpol.srcmodel.spectrum.
xCountSpectrum
(source_spectrum, aeff, t, column_density=0.0, redshift=0.0, scale_factor=1.0)[source]¶ Class representing a count spectrum, i.e., the convolution of the source photon spectrum and the detector effective area
This is a subclass of xUnivariateAuxGenerator, providing all the facilities implemented in a bivariate spline, along with the capability of extracting random numbers.
Note that the light curve corresponding to the count spectrum is calculated when a class object is instantiated.
-
build_energy_integral
(emin=None, emax=None)[source]¶ Build the energy-integrated count spectrum, i.e.
The output is stored in the form of a xUnivariateGenerator, featuring all the spline facilities, along with the capability of extracting random numbers.
-
build_light_curve
()[source]¶ Build the light curve, i.e., the count spectrum, integrated over the entire energy range, as a function of time.
-
build_mdp_table
(energy_binning, modulation_factor)[source]¶ Calculate the MDP values in energy bins, given the modulation factor of the instrument as a function of the energy.
Parameters: - energy_binning (array) – The energy binning
- modulation_factor (ximpol.irf.mrf.xModulationFactor instance) – The instrument modulation factor as a function of the energy.
-