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: Optional[float] = None, dec: Optional[float] = None, mission: Optional[str] = None, instrument: Optional[str] = None, verbose: bool = True, edges=None)[source]¶
Bases:
object
- property bins¶
- 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:
- get_information_dict(use_poly: bool = False, extract: bool = False) → dict[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_intervals¶
- 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_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.”)
- Parameters
time_intervals – intervals to fit on
unbinned –
bayes –
kwargs –
- property time_intervals¶
the time intervals of the events
- Returns