evt.binning¶
Module encapsulating the FITS spectra structure and related facilities.
-
class
ximpol.evt.binning.
xBinTableHDULC
(data=None, keywords=[], comments=[])[source]¶ Binary table for binned LC data.
-
class
ximpol.evt.binning.
xBinTableHDUMCUBE
(data=None, keywords=[], comments=[])[source]¶ Binary table for binned MCUBE data.
Mind the field for the actual phi distribution depends on the binning, which is specified at run time, and therefore the corresponding data specs must be set dinamically.
-
class
ximpol.evt.binning.
xBinTableHDUPHA1
(data=None, keywords=[], comments=[])[source]¶ Binary table for binned PHA1 data.
-
class
ximpol.evt.binning.
xBinTableHDUPHASG
(data=None, keywords=[], comments=[])[source]¶ Binary table for binned PHASG data.
-
class
ximpol.evt.binning.
xBinTableHDUSCUBE
(data=None, keywords=[], comments=[])[source]¶ Binary table for binned SCUBE data.
-
class
ximpol.evt.binning.
xBinnedAreaRateMap
(file_path)[source]¶ Display interface to binned ARATE files.
-
class
ximpol.evt.binning.
xBinnedModulationCube
(file_path)[source]¶ Read-mode interface to a MCUBE FITS file.
-
plot
(show=True, fit=True, analyze=True, xsubplot=0, full_range=True, simple_stat=False)[source]¶ Plot the azimuthal distributions for all the energy bins.
-
plot_bin
(i, show=True, fit=True)[source]¶ Plot the azimuthal distribution for the i-th energy slice.
-
-
class
ximpol.evt.binning.
xBinnedStokesCube
(file_path)[source]¶ Read-mode interface to a SCUBE FITS file.
-
plot
(ebin=0, slice=0, show=True, zlabel=None, subplot=(1, 1, 1))[source]¶ Plot the Stokes parameters (I, Q or U) map in the selected ebin.
-
plot_polarization_degree_angle
(pol_list, show=True)[source]¶ Plot the polarization degree and angle maps.
-
-
class
ximpol.evt.binning.
xEventBinningARATE
(file_path, **kwargs)[source]¶ Class for ARATE binning.
-
class
ximpol.evt.binning.
xEventBinningBase
(file_path, **kwargs)[source]¶ Base class for the event binning.
-
classmethod
bin_centers
(bin_edges)[source]¶ Return an array of bin centers given an array of bin edges.
Parameters: bin_edges (1-d array of length (n + 1)) – The array with the bin edges. Returns: The array with the values of the bin centers. Return type: 1-d array of length n.
-
classmethod
bin_edge_pairs
(bin_edges, uber=False)[source]¶ Return a list of (min, max) tuples of length 2 given an array of bin edges. This is handy when one needs to loop explicitly over the intervals defined by the array bounds, e.g., when running xpselect in specific energy, time or phase intervals.
Parameters: - bin_edges (1-d array of length (n + 1)) – The array with the bin edges.
- uber (bool) – If true, add the overall interval (i.e., a tuple with the absolute minimum and maximum in the binning) at the end.
Example
>>> import numpy >>> from ximpol.evt.binning import xEventBinningBase >>> >>> energy_binning = numpy.array([2., 4., 8.]) >>> print(xEventBinningBase.bin_edge_pairs(energy_binning)) >>> [(2.0, 4.0), (4.0, 8.0)] >>> print(xEventBinningBase.bin_edge_pairs(energy_binning, uber=True)) >>> [(2.0, 4.0), (4.0, 8.0), (2.0, 8.0)]
-
classmethod
bin_widths
(bin_edges)[source]¶ Return an array of bin widths given an array of bin edges.
Parameters: bin_edges (1-d array of length (n + 1)) – The array with the bin edges. Returns: The array with the values of the bin widths. Return type: 1-d array of length n.
-
classmethod