pyspi.utils.data_builder package
Submodules
Module contents
- class pyspi.utils.data_builder.SPISWFileGRB(det, ebounds, time_of_grb, sgl_type=None)[source]
Bases:
object- __init__(det, ebounds, time_of_grb, sgl_type=None)[source]
Class to read in all the data needed from a SCW file for a given grbtime
- Parameters
det – For which detector?
ebounds – Ebounds for the Analysis.
time_of_grb – Time of the GRB as “YYMMDD HHMMSS”
sgl_type – Which type of single events?
Only normal sgl, psd or both?
- Returns
Object
- property deadtime_bin_starts
Start time of time bins which have the deadtime information
- Type
returns
- property deadtime_bin_stops
Stop time of time bins which have the deadtime information
- Type
returns
- property deadtimes_per_interval
Deadtime per time bin which have the deadtime information
- Type
returns
- property det
detector ID
- Type
returns
- property det_name
Name det
- Type
returns
- property ebounds
ebounds of analysis
- Type
returns
- property energies
energies of detected events
- Type
returns
- property energy_bins
energy bin number of every event
- Type
returns
- property geometry_file_path
Path to the spacecraft geometry file
- Type
returns
- property livetimes_per_interval
Livetime per time bin which have the deadtime information
- Type
returns
- property mission
Name Mission
- Type
returns
- property n_channels
number energy channels
- Type
returns
- property time_start
start time of lightcurve
- Type
returns
- property time_stop
stop time of lightcurve
- Type
returns
- property times
times of detected events
- Type
returns
- class pyspi.utils.data_builder.TimeSeriesBuilderSPI(name, time_series, response=None, poly_order=-1, verbose=True, restore_poly_fit=None, container_type=<class 'threeML.utils.spectrum.binned_spectrum.BinnedSpectrumWithDispersion'>, **kwargs)[source]
Bases:
threeML.utils.data_builders.time_series_builder.TimeSeriesBuilder- __init__(name, time_series, response=None, poly_order=-1, verbose=True, restore_poly_fit=None, container_type=<class 'threeML.utils.spectrum.binned_spectrum.BinnedSpectrumWithDispersion'>, **kwargs)[source]
Class to build the time_series for SPI. Inherited from the 3ML TimeSeriesBuilder with added class methods to build the object for SPI datafiles. :param name: Name of the tsb :param time_series: Timeseries with the data :param response: Response object :param poly_order: poly order for the polynominal fitting :param verbose: Verbose? :param restore_poly_fit: Path to a file with the poly bkg fits :param containter_type: ContainerType for spectrum :returns: Object
- classmethod from_spi_constant_pointing(det=0, pointing_id='118900570010', ebounds=None, response=None)[source]
Class method to build the time_series_builder for a given pointing id
- Parameters
det – Which det?
ebounds – Output ebounds for analysis.
pointing_id – Pointing ID
response – InstrumenResponse Object
- Returns
Initalized TimeSeriesBuilder object
- classmethod from_spi_grb(name, det, time_of_grb, ebounds=None, response=None, sgl_type=None, restore_background=None, poly_order=0, verbose=True)[source]
Class method to build the time_series_builder for a given GRB time
- Parameters
name – Name of object
det – Which det?
ebounds – Output ebounds for analysis.
time_of_grb – Astropy time object with the time of the GRB (t0)
response – InstrumenResponse Object
sgl_type – What kind of sinlge events? Standard single events? PSD events? Or both?
restore_background – File to restore bkg
poly_order – Which poly_order? -1 gives automatic determination
verbose – Verbose?
- Returns
Initalized TimeSeriesBuilder object