threeML.utils.time_series.time_series module

exception threeML.utils.time_series.time_series.OverLappingIntervals[source]

Bases: RuntimeError

exception threeML.utils.time_series.time_series.ReducingNumberOfSteps[source]

Bases: Warning

exception threeML.utils.time_series.time_series.ReducingNumberOfThreads[source]

Bases: Warning

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
count_per_channel_over_interval(start, stop)[source]
Parameters
  • start

  • stop

Returns

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:

exposure_over_interval(tmin, tmax)float[source]

calculate the exposure over a given interval

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
property poly_fit_exists
property poly_intervals
property poly_order

Get or set the polynomial order

property polynomials

Returns polynomial is they exist

restore_fit(filename)[source]
save_background(filename, overwrite=False)[source]

save the background to an HD5F

Parameters

filename

Returns

set_active_time_intervals(*args)[source]
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

view_lightcurve(start=- 10, stop=20.0, dt=1.0, use_binner=False)[source]
threeML.utils.time_series.time_series.ceildiv(a, b)[source]