nicer.fitsutils

Helpers that run FTOOLS to merge and filter event files.

All of these need HEASoft to be installed and initialized.

Functions

filtallandmerge_ftools(evfiles[, workdir])

Merge event files with ftmerge, keeping only standard science events.

get_badratioevents_ftools(evfiles[, workdir])

Merge event files with ftmerge, keeping only events above the slow/fast ratio "trumpet".

get_eventbothshoots_ftools(evfiles[, workdir])

Merge event files with ftmerge, keeping only events flagged as both overshoot and undershoot.

get_eventovershoots_ftools(evfiles[, workdir])

Merge event files with ftmerge, keeping only overshoot-only events.

get_eventundershoots_ftools(evfiles[, workdir])

Merge event files with ftmerge, keeping only undershoot-only events.

runcmd(cmd)

Run a command, logging it first.

nicer.fitsutils.runcmd(cmd)[source]

Run a command, logging it first.

Parameters:

cmd (list of str) -- The command and its arguments. It is not passed through a shell.

Raises:
nicer.fitsutils.filtallandmerge_ftools(evfiles, workdir=None)[source]

Merge event files with ftmerge, keeping only standard science events.

Events are selected with EVENT_FLAGS==bx1x000.

Parameters:
  • evfiles (list of str) -- Event files to merge.

  • workdir (str, optional) -- Directory in which to make the temporary working directory.

Returns:

astropy.table.Table -- The selected events, with TIMEZERO added to TIME.

nicer.fitsutils.get_eventovershoots_ftools(evfiles, workdir=None)[source]

Merge event files with ftmerge, keeping only overshoot-only events.

Events are selected with EVENT_FLAGS==bxxx010.

Parameters:
  • evfiles (list of str) -- Event files to merge.

  • workdir (str, optional) -- Directory in which to make the temporary working directory.

Returns:

astropy.table.Table -- The selected events, with TIMEZERO added to TIME.

nicer.fitsutils.get_eventundershoots_ftools(evfiles, workdir=None)[source]

Merge event files with ftmerge, keeping only undershoot-only events.

Events are selected with EVENT_FLAGS==bxxx001.

Parameters:
  • evfiles (list of str) -- Event files to merge.

  • workdir (str, optional) -- Directory in which to make the temporary working directory.

Returns:

astropy.table.Table -- The selected events, with TIMEZERO added to TIME.

nicer.fitsutils.get_eventbothshoots_ftools(evfiles, workdir=None)[source]

Merge event files with ftmerge, keeping only events flagged as both overshoot and undershoot.

Events are selected with EVENT_FLAGS==bxxx011.

Parameters:
  • evfiles (list of str) -- Event files to merge.

  • workdir (str, optional) -- Directory in which to make the temporary working directory.

Returns:

astropy.table.Table -- The selected events, with TIMEZERO added to TIME.

nicer.fitsutils.get_badratioevents_ftools(evfiles, workdir=None)[source]

Merge event files with ftmerge, keeping only events above the slow/fast ratio “trumpet”.

Events are selected with EVENT_FLAGS==bx11000 and PI/PI_FAST > 1.1 + 120/PI.

Parameters:
  • evfiles (list of str) -- Event files to merge.

  • workdir (str, optional) -- Directory in which to make the temporary working directory.

Returns:

astropy.table.Table -- The selected events, with TIMEZERO added to TIME.