BatsePhaiiMulti¶
- class gdt.missions.cgro.batse.phaii.BatsePhaiiMulti[source]¶
Bases:
FitsFileContextManager,SpacecraftFrameModelMixinBATSE data containing PHAII from multiple detectors. This is typically either CONT or DISCLA data. In addition to the PHAII data, these files also contain spacecraft orbit and attitude information.
Attributes Summary
The detectors in the file
The filename
The list of Header Data Units
The headers
Number of detectors in the file
The number of HDUs
Methods Summary
close()Close the file
column(hdu_num, col_name)Return a column from an HDU as an array.
columns_as_array(hdu_num, col_names[, dtype])Return a list of columns from an HDU as an array.
get_column_names(hdu_num)Get the column names in a HDU.
get_detector(det_var)Retrieve the Phaii object for the given detector.
Retrieves the spacecraft frame(s) from the file.
open(file_path, **kwargs)Open a BATSE file containing PHA time series from multiple detectors.
set_spacecraft_frame(frame)Saves the spacecraft frame to the model.
sum_detectors([det_var_list])Sum data over multiple detectors and return a Phaii object.
write(directory[, filename])Write the file to disk.
Attributes Documentation
- detectors¶
The detectors in the file
- Type:
(list)
- filename¶
The filename
- Type:
(str)
- hdulist¶
The list of Header Data Units
- Type:
(astropy.io.fits.hdu.HDUList)
- headers¶
The headers
- Type:
- num_dets¶
Number of detectors in the file
- Type:
(int)
- num_hdus¶
The number of HDUs
- Type:
(int)
Methods Documentation
- close()¶
Close the file
- column(hdu_num: int, col_name: str) array¶
Return a column from an HDU as an array.
- Parameters:
hdu_num (int) – The HDU number
col_name (str) – The name of the column
- Returns:
(np.array)
- columns_as_array(hdu_num: int, col_names: List[str], dtype: dtype = None) array¶
Return a list of columns from an HDU as an array.
- Parameters:
hdu_num (int) – The HDU number
col_names (list of str) – The names of the columns
dtype (np.dtype, optional) – The custom dtype of the output array
- Returns:
(np.array)
- get_column_names(hdu_num: int)¶
Get the column names in a HDU. Returns empty if there is no data extension in the HDU.
- Parameters:
hdu_num (int) – The HDU number
- Returns:
(tuple)
- get_detector(det_var)[source]¶
Retrieve the Phaii object for the given detector.
- Parameters:
det_var (str, int, or
BatseDetectors) –- Returns:
(
BatsePhaii`)
- get_spacecraft_frame()[source]¶
Retrieves the spacecraft frame(s) from the file.
- Returns:
(
CgroFrame)
- classmethod open(file_path, **kwargs)[source]¶
Open a BATSE file containing PHA time series from multiple detectors.
- Parameters:
file_path (str) – The file path
- Returns:
- set_spacecraft_frame(frame: SpacecraftFrame)¶
Saves the spacecraft frame to the model.
- Parameters:
frame (
SpacecraftFrame) – The object to be saved to the model.
- sum_detectors(det_var_list=None)[source]¶
Sum data over multiple detectors and return a Phaii object.
- Note::
The exposures are averaged between multiple detectors and the energy edges are taken to be the geometric mean.
- Parameters:
det_var_list (list of str, int, or
BatseDetectors, optional) – If not set, will sum all available detectors.- Returns:
(
BatsePhaii`)
- write(directory: Union[str, Path], filename: str = None, **kwargs)¶
Write the file to disk.
- Parameters:
directory (str) – The directory to write the file.
filename (str, optional) – The filename. If omitted, attempts to use the
filenameif set.