RPP spectral analysis
The RPP-*.py scripts are the spectral analysis pipeline for the NICER
catalog of rotation-powered pulsars (RPPs). They fit the total and pulsed
spectra of a pulsar with blackbody and power-law models. They need HEASoft and
PyXspec.
Preparing the data
RPP-prep.py does all of the preparation, starting from a directory of ObsIDs and a timing model. Run it in the directory where you want the output:
RPP-prep.py --srcname J0030 J0030+0451.par /data/j0030
It:
Runs psrpipe.py on every ObsID, with the cuts used for the catalog (
--nomap --emin 0.22 --emax 15.01 --tidy --cormin 1.5 --kpmax 5 --mingti 100 --maxovershoot 1.5 --maxundershoot 600 --medianundershoot=100), to make phase-tagged event files.Merges the event files (
merged.evt) and makes a 2–10 keV light curve.Removes background flares with cr_cut.py, cutting at a percentile of the count-rate distribution (
--cps_cut_percentile, default 95%), to makemerged_cut.evt.Plots a phaseogram with niphaseogram.py.
Makes a spectrum and a SCORPEON background model with
nicerl3-spect, writing XSPEC and PyXspec load scripts (load_pulsedspec.xcmandload_pulsedspec.py, respectively).Finds the energy range with the most significant pulsations, with nioptcuts.py, unless
--eminand--emaxare given.Analyzes the pulse profile with RPP-profile.py, which finds the off-pulse phase range with Bayesian blocks and writes the results to a YAML file (
<psr name>_profinfo.yml). It also estimates the TOA accuracy for a 5 ks observation: the Cramér–Rao lower bound computed from the measured profile (including background and unpulsed emission), in the H-test band (toa_*keys inoptres) and in the energy band that minimizes it (toares). Values are in phase units; multiply by the period for time.--toa-mcadds a Monte Carlo check of the bound, which fails for faint pulsars and double-peaked profiles.Makes on-pulse and off-pulse spectra with RPP-pulsedspec.py, for fitting the pulsed spectrum.
Fitting the total spectrum
RPP-driver.py runs RPP-spec.py for each
of the standard models (absorbed blackbody, power law, two blackbodies,
blackbody plus power law, and two blackbodies plus power law), with the
SCORPEON background model. RPP-spec.py can also add Gaussian emission or
absorption lines. Each fit makes a plot and a YAML file of results, including
fluxes.
If you would rather do a fit by hand in XSPEC, save it with save all mymodel.xcm and use RPP-spec-from-xcm.py to refit the spectrum and plot or RPP-xcm-plot.py to plot only, to make the same products.
Fitting the pulsed spectrum
The pulsed spectrum is the on-pulse spectrum with the off-pulse spectrum as background. RPP-driver-onoff.py fits the standard models to it with RPP-spec-onoff.py, and RPP-xcm-plot-onoff.py handles a fit saved from XSPEC.
Errors and fluxes from XSPEC logs
For fits done by hand in XSPEC:
RPP-scorpeon_errorsfluxes.py and RPP-pulsed_errorsfluxes.py read the log of a best fit and write an XSPEC script that computes parameter errors,
stepparscans and fluxes.RPP-scorpeon_yml.py and RPP-pulsed_yml.py collect the results from the log of that script into a YAML file.