NAME

ixpeeventviewer -- Displays images of raw event tracks with the event barycenter, absorption point, and initial electron direction overlaid.

USAGE

ixpeeventviewer.py evt1list [evt2list] [absorption] [barycenter] [direction] [pixpha] [indices] [cmap] [cmapoffset] [minaxside] [targetname] [timestamp] [batch] [autosave] [autostop] [outfolder] [imgformat] [imgdpi] [zsupthresh] [clustering] [numclusters] [clumindensity] [cluminsize] [emin] [emax] [resample] [seed]

DESCRIPTION

ixpeeventviewer can create a 2-dimensional image plot of any raw event derived from the data in the "PHAS" column of the IXPE Level1 event file evt1list, along with display of other event values read from other columns in the file. If the optional parameter evt2list is set to the name of a valid IXPE Level2 event file, and if the events in this file overlap in time the events in evt1list, then only events which are present in both evt2list and evt1list will be available for display. The additional information displayed with the image can be controlled through the absorption (which controls display of the “ABSX” and “ABSY” values from the event), barycenter (“BARX” and “BARY”), direction “DETPHI”, pixpha and indices (the value and indices of the “PIX_PHAS” pixel values) parameters. The color scheme and location of the output image can be controlled through the cmap, cmapoffset, and minaxside parameters, and the displayed name of the target can be set with targetname.

By default, the user can browse through all available events, starting with the first available, using the “Next” and “Previous” buttons on the display window. However, a user can display a single event and disable browsing by setting timestamp to a time value within the range of the available event start and stop times. The available event nearest in time to the value given will be displayed. To facilitate selection of specific events this way, the timestamp (“MET”) value of each event displayed in browsing mode is printed to the console. Setting batch=’yes’ will also disable the browsing mode; also setting autosave=’yes’ will produce a series of output image files whose number, output folder, and format are controlled by autostop, outfolder, imgformat, and imgdpi.

The optional parameters clustering, numclusters, clumindensity, and cluminsize define how the clusters within the image are calculated and how the clusters are used to display the data in the output image. Clustering is used in image display by default but can be disabled by setting clustering=’no’. The parameter zsupthresh defines the bin count threshold used for calculating the clusters, barycenter, absorption point, and initial electron direction, as well as the threshold for pixels displayed in the output image. By default, this value is read from the “ZSUPTHR” keyword in the “EVENTS” header of the Level1 event file, which, in turn, is derived from the telemetry-reported value used in the instrument when the data was taken. Thus, values of zsupthresh less than the default in the Level1 event will have no effect, because the instrument only reports values above this threshold.

If evt2list is a valid IXPE Level2 event file, then the values emin, emax, and resample can be used limit the available events by energy or spectrum. Available events are filtered such that emin <= event “PI” < emax. If resample is defined, then available events are selected from the file based on the probably of a generated random number being less than the probability for an event of energy “PI” belonging to the power-law spectrum population. The seed value defines the seed for the random number generator used in applying this selection.

This code is based on “xpobsdisplay”, originally written by Luca Baldini and others in the ixpeobssim team.

PARAMETERS

evt1list* (str)
Full path to a level 1 Event file.

evt2list (str)
(Optional) Full path to a level 2 Event file.

absorption
(Optional) Draw the reconstructed absorption point? (default: 'yes').

barycenter
(Optional) Draw the reconstructed barycenter? (default: 'yes').

direction
(Optional) Draw the reconstructed track direction? (default: 'yes').

pixpha
(Optional) Indicate the pixel PHA values? (default: 'no').

indices
(Optional) Draw the row and column indices of the readout matrix? (default: 'no').

cmap
(Optional) The color map for the pixel values. (default: 'Reds').

cmapoffset
(Optional) The PHA offset for the color map. (default: 10).

minaxside
(Optional) The axis side for the event display". (default: 2.0).

targetname (str)
(Optional) Name of the celestial target.

timestamp
(Optional) Timestamp, in ixpeseconds, of a single specific event to be displayed. ('-' if none).

batch
(Optional) Run in batch mode? (default: 'no').

autosave
(Optional) Save the event displays automatically? (default: 'no').

autostop
(Optional) Stop automatically after this number of events. ('-' if none).

outfolder
(Optional) Path to the output folder if autosave is 'yes'. (default: current directory).

imgformat
(Optional) The image format for the output files when autosave is 'yes'. (default: 'png').

imgdpi
(Optional) Resolution of the output image in dots per inch. (default: 250).

zsupthresh
(Optional) Zero suppression threshold for pixel masking (default: value of the ZSUPTHR keyword in the evt1list EVENTS header).

clustering
(Optional) Run the DBscan clustering on the events? (default: 'yes').

numclusters
(Optional) The number of clusters to be displayed for each event. (default: 2).

clumindensity
(Optional) The minimum density point for the DBscan clustering. (default: 5).

cluminsize
(Optional) The minimum cluster size for the DBscan clustering. (default: 6).

emin
(Optional) Minimum energy in keV for filtering events (default: 2.0).

emax
(Optional) Maximum energy in keV for filtering events (default: 8.0).

resample
(Optional) The power-law index for resampling events in energy. ('-' if none).

seed
(Optional) Random seed for the simulation (default: 1).

EXAMPLES

ixpeeventviewer evt1list=ixpe_event1_sample.fits
Simplest example. Displays the events from "ixpe_event1_sample.fits" Level1 event file using all defaults.

ixpeeventviewer evt1list=ixpe_event1_sample.fits evt2list=ixpe_event2_sample.fits emin=2.0
This example displays only the events from the Level2 event file "ixpe_event2_sample.fits" that have PI > 2.0 keV. The data for the event images is from the raw event data in the Level1 event file "ixpe_event1_sample.fits" that correspond in time to each Level2 event.

BUGS

SEE ALSO

LAST MODIFIED

Feb 2024