evt.event

Module encapsulating the event structure and related facilities.

class ximpol.evt.event.xBinTableHDUEvents(data=None, keywords=[], comments=[])[source]

Binary table description for the EVENTS extension of the observation output files.

This is partially modeled based on the XMM-Newton data format.

A recap of the basic FITS data types is here.

This bit is separated from the additional Monte Carlo event fields, as in the future the “real” part of the data format might be stored elsewhere.

class ximpol.evt.event.xBinTableHDUGTI(data=None, keywords=[], comments=[])[source]

Binary tablefor the good time intervals (GTI).

class ximpol.evt.event.xBinTableHDUMonteCarloEvents(data=None, keywords=[], comments=[])[source]

Binary table description for the EVENTS extension of the observation output files, including the additional Monte Carlo fields.

class ximpol.evt.event.xBinTableHDURoiTable(data=None, keywords=[], comments=[])[source]

Binary tablefor the good time intervals (GTI).

class ximpol.evt.event.xEventFile(file_path)[source]

Read-mode interface to event files.

build_roi_table()[source]

Rebuild the ROI table based in the information in the ROITABLE extension of the event file.

close()[source]

Close the HDU list.

file_path()[source]

Return the path to the underlying file.

irf_name()[source]

Return the name of the IRF set used to run the simulation.

max_good_time()[source]

Return the largest STOP time for the GTIs in the event file.

min_good_time()[source]

Return the smaller START time for the GTIs in the event file.

num_events()[source]

Return the total number of events in the event file.

primary_keywords()[source]

Return a list of all the relevant keywords in the PRIMARY header.

This is used, e.g., to propagate all the necessary information (such as the ROI and the IRFs used) from the event files to the binned data files that are created from them.

roi_center()[source]

Return the righ ascension and declination of the center of the ROI, as written in the header of the primary extension.

source_id(source_name)[source]

Return the source identifier for a given source name in the ROI.

total_good_time()[source]

Return the sum of all the GTIs in the event file.

class ximpol.evt.event.xMonteCarloEventList[source]

Class describing a Monte Carlo event list.

apply_vignetting(aeff, ra_pointing, dec_pointing)[source]

Apply the effective area vignetting to the event list.

set_column(name, data)[source]

Set a column array.

Parameters:
  • name (string) – The name of the column
  • data (array or number) – The actual data to put in the column. (If data is a number, an array of the proper length is automatically created, assuming that the lenght class member is defined.)
sort()[source]

Sort the event list based on the event time.

trim(mask)[source]

Trim all the data columns according to a generic input mask.

write_fits(file_path, simulation_info)[source]

Write the event list and associated ancillary information to file.

Parameters:
  • file_path (str) – The path to the output file.
  • simulation_info – A generic container with all the relevant information about the simulation.

Warning

The information about the detector and telescope should be in the primary header of the IRF tables, and that’s where we should be retrieving it from. (See issue #49.)