srcmodel.roi¶
-
class
ximpol.srcmodel.roi.
xEphemeris
(t0, nu0, nudot=0.0, nuddot=0.0, min_validity_time=0.0, max_validity_time=10000000.0)[source]¶ Convenience class encapsulating a pulsar ephemeris.
-
class
ximpol.srcmodel.roi.
xExtendedSource
(name, img_file_path, energy_spectrum, polarization_degree, polarization_angle, column_density=0.0, redshift=0.0, min_validity_time=0.0, max_validity_time=10000000.0, identifier=None)[source]¶ Class representing an extended source. See
ximpol.srcmodel.roi.xModelComponentBase
for the signature of the base class.Parameters: img_file_path (string) – The path to the FITS file containing the image of the source.
-
class
ximpol.srcmodel.roi.
xGaussianDisk
(name, ra, dec, sigma, energy_spectrum, polarization_degree, polarization_angle, column_density=0.0, redshift=0.0, min_validity_time=0.0, max_validity_time=10000000.0, identifier=None)[source]¶ Class representing a (azimuthally simmetric) gaussian disk. See
ximpol.srcmodel.roi.xModelComponentBase
for the signature of the base class.Parameters: - ra (float) – The right ascension of the disk center (in decimal degrees).
- dec (float) – The declination of the disk center (in decimal degrees).
- sigma (float) – The root mean square of the disk (in degrees).
-
class
ximpol.srcmodel.roi.
xModelComponentBase
(name, energy_spectrum, polarization_degree, polarization_angle, column_density=0.0, redshift=0.0, min_validity_time=0.0, max_validity_time=10000000.0, identifier=None)[source]¶ Base class for the source object.
Note that the source identifier defaults to none and is typically assign after the fact when the source itself is added to a source model.
Parameters: - name (string) – The name of the source.
- energy_spectrum (function) – The function object representing the energy spectrum.
- polarization_degree (function) – The function object representing the polarization degree.
- polarization_angle (function) – The function object representing the polarization angle.
- column_density (float) – The value of the column density (in cm^-2) used to calculate the Galactic absorption. Defaults to 0.
- redshift (float) – The source redshift. Defaults to 0.
- min_validity_time (float) – The minimum validity time for the source model. Defaults to 0.
- max_validity_time (float) – The maximum validity time for the source model. Defaults to 10 Ms.
- identifier (int) – A unique identifier of the source within a ROI model. Defaults to None and is, generally, automatically assigned when building the ROI (i.e., you don’t have to worry about it, but it’s handy to have in the output event list).
-
integral_flux
(emin=2.0, emax=8.0, t=None, erg=True)[source]¶ Return the integral source flux at a generic time.
This is achieved by taking a “slice” of the source spectrum at that time and integrating between a minimum and maximum energy.
Parameters: - emin (float) – The minimum integration energy (default 2 keV).
- emax (float) – The maximum integration energy (default 2 keV).
- t (float) – The time (default is the minimum source validity time).
-
rvs_event_list
(aeff, psf, modf, edisp, **kwargs)[source]¶ Extract a random event list for the model component.
-
rvs_sky_coordinates
(size=1)[source]¶ Generate random coordinates for the model component.
This is a do-nothing function and should be re-implemented by each derived class.
Parameters: size (float) – The number of sky coordinate pairs to be generated.
-
classmethod
sampling_time
(tstart, tstop)[source]¶ Return the sampling time used for the lightcurve when generating events.
Warning
We have an issue open for this and at some point we should go back to it and make sure it is properly addressed.
-
set_energy_spectrum
(energy_spectrum)[source]¶ Set the energy spectrum for the model component.
Parameters: energy_spectrum (function) – The function object representing the energy spectrum.
-
set_polarization_angle
(polarization_angle)[source]¶ Set the polarization angle for the model component.
Parameters: polarization_angle (function) – The function object representing the polarization angle.
-
class
ximpol.srcmodel.roi.
xPeriodicPointSource
(name, ra, dec, energy_spectrum, polarization_degree, polarization_angle, ephemeris, column_density=0.0, redshift=0.0, min_validity_time=None, max_validity_time=None, identifier=None)[source]¶ Class representing a periodic point source (e.g., a pulsar). See
ximpol.srcmodel.roi.xModelComponentBase
for the signature of the base class.Parameters: - ra (float) – The right ascension of the source (in decimal degrees).
- dec (float) – The declination of the source (in decimal degrees).
- ephemeris (:py:class:`ximpol.srcmodel.roi.xEphemeris object) – The source ephemeris.
-
class
ximpol.srcmodel.roi.
xPointSource
(name, ra, dec, energy_spectrum, polarization_degree, polarization_angle, column_density=0.0, redshift=0.0, min_validity_time=0.0, max_validity_time=10000000.0, identifier=None)[source]¶ Class representing a steady point source. See
ximpol.srcmodel.roi.xModelComponentBase
for the signature of the base class.Parameters: - ra (float) – The right ascension of the source (in decimal degrees).
- dec (float) – The declination of the source (in decimal degrees).
-
class
ximpol.srcmodel.roi.
xROIModel
(ra_center, dec_center)[source]¶ Class describing a full ROI (region of interest) model.
This is essentially an (ordered) collection of component objects (i.e., instances of classes inheriting from xModelComponentBase) than can be accessed by source name.
Parameters: - ra_center (float) – The right ascension of the center of the ROI (in decimal degrees).
- dec_center (float) – The declination of the center of the ROI (in decimal degrees).
-
build_hdu
()[source]¶ Build a FITS HDU for the source model.
This can be used to be written in the output file.
-
rvs_event_list
(aeff, psf, modf, edisp, **kwargs)[source]¶ Extract an event list for the full ROI.
Parameters: - aeff (
ximpol.irf.arf.xEffectiveArea
object.) – The effective area to be used. - psf (
ximpol.irf.psf.xPointSpreadFunction
object.) – The PSF to be used. - modf (
ximpol.irf.mrf.xModulationFactor
object.) – The modulation factor to the used. - edisp (
ximpol.irf.rmf.xEnergyDispersion
object.) – The energy dispersion to be used. - sampling_time (array) – The array to sample the source light curve.
Warning
The sampling_time should not be the same for all sources, and each source should be able to decide its own in a sensible way. (See issue #44.)
- aeff (
-
class
ximpol.srcmodel.roi.
xUniformDisk
(name, ra, dec, radius, energy_spectrum, polarization_degree, polarization_angle, column_density=0.0, redshift=0.0, min_validity_time=0.0, max_validity_time=10000000.0, identifier=None)[source]¶ Class representing a uniform disk. See
ximpol.srcmodel.roi.xModelComponentBase
for the signature of the base class.Parameters: - ra (float) – The right ascension of the disk center (in decimal degrees).
- dec (float) – The declination of the disk center (in decimal degrees).
- radius (float) – The radius of the disk (in degrees).
-
rvs_sky_coordinates
(size=1)[source]¶ Generate random coordinates for the model component.
This is returning an array of the proper length with identical values.
The algorithm is taken from http://mathworld.wolfram.com/DiskPointPicking.html
Parameters: size (float) – The number of sky coordinate pairs to be generated.