threeML.utils.time_series.time_series module
- class threeML.utils.time_series.time_series.TimeSeries(start_time: float, stop_time: float, n_channels: int, native_quality=None, first_channel: int = 1, ra: float | None = None, dec: float | None = None, mission: str | None = None, instrument: str | None = None, verbose: bool = True, edges=None)[source]
Bases:
object
- property bins
- property bkg_intervals
- counts_over_interval(start, stop) int [source]
return the number of counts in the selected interval :param start: start of interval :param stop: stop of interval :return:
- fit_polynomial(**kwargs)[source]
Fit the polynominals to the selected time intervals :param kwargs: :returns:
- get_information_dict(use_poly: bool = False, extract: bool = False) _OutputContainer [source]
Return a PHAContainer that can be read by different builders
- Parameters:
use_poly – (bool) choose to build from the polynomial fits
- get_poly_info() dict [source]
Return a pandas panel frame with the polynomial coeffcients and errors :returns: a DataFrame
- get_total_poly_count(start: float, stop: float, mask=None) int [source]
Get the total poly counts
- Parameters:
start
stop
- Returns:
- get_total_poly_error(start: float, stop: float, mask=None) float [source]
Get the total poly error
- Parameters:
start
stop
- Returns:
- property n_channels: int
- property poly_fit_exists: bool
- property poly_order
Get or set the polynomial order
- property polynomials
Returns polynomial is they exist
- save_background(filename, overwrite=False)[source]
save the background to an HD5F
- Parameters:
filename
- Returns:
- set_background_interval(*time_intervals, **options)[source]
Set the time interval for the background observation. Multiple intervals can be input as separate arguments Specified as ‘tmin-tmax’. Intervals are in seconds. Example:
set_polynomial_fit_interval(“-10.0-0.0”,”10.-15.”)
- Parameters:
time_intervals – intervals to fit on
options
- set_polynomial_fit_interval(*time_intervals, **kwargs) None [source]
Set the time interval to fit the background. Multiple intervals can be input as separate arguments Specified as ‘tmin-tmax’. Intervals are in seconds. Example: set_polynomial_fit_interval(“-10.0-0.0”,”10.-15.”) :param time_intervals: intervals to fit on :param unbinned: :param bayes: :param kwargs:
- property time_intervals
the time intervals of the events
- Returns: