Barycenter Correction and Phase Resolved SpectroscopyReturn to: Analysis Threads | Analysis Main Page
OverviewThe purpose of this tutorial is to guide users through the process of barycenter correcting their NICER data and then demonstrating how to calculate photon phases from the barycenter corrected arrival times. We will then select certain phases for spectral extraction. Read this thread if you want to: Barycenter correct your data and perform phase resolved spectroscopy Last update: 2024-01-30 IntroductionNICER is frequently used to observe sources with an X-ray periodicity (e.g. neutron stars, white dwarfs). It is often desirable to assign a phase to each photon arrival time based on the periodicity of the source, and then to construct a source pulse profile (i.e., phasogram). Once phases are assigned, phase-resolved spectroscopy can also be performed to search for spectral changes as a function of phase. Here we provide a short example of how such an analysis can be accomplished. In this analysis thread, we will walk through downloading a sample data set, assigning barycentric timestamps, assigning phases, and performing NICER analysis on this data, including phase-resolved spectroscopy. Prerequisites
To demonstrate this type of analysis we will use an observation of the
Crab pulsar. If you would like to follow along with this example, the
observation can be downloaded from the HEASARC data archive using the
following wget command:
We use a relatively short observation to keep the data volume small and processing time relatively short. See How to access NICER data for more information on how to access NICER data. For barycenter analysis of any target, you will need an accurate celestial position of the target. For microsecond timing accuracy, you will need a celestial position accurate to arcseconds or better.
Specifically, the timing error associated with a position error scales approximately as,
This discussion applies primarily to the most sensitive absolute timing accuracy applications, where long term pulsar phase connection is required, over weeks, months and years. For shorter term time baselines (<day), approximate frequency determination, and incoherent power estimation applications, a coarser target position may be tolerable. For accurate absolute timing analysis with barycentering, a precise celestial position is required. In our example, we use the Crab celestial position, as reported in the ATNF catalog . Analysis: Applying Barycenter CorrectionFirst the data should be reprocessed with the nicerl2 task in order to apply the latest filtering criteria and calibrations: nicerl2 3013010102 clobber=YES
For more discussion of the many options to nicerl2, please see the nicerl2 analysis thread. Next, we need to barycenter-correct the data. To do this we will use the following command: barycorr infile=ni3013010102_0mpu7_cl.evt outfile=ni3013010102_0mpu7_cl_barycorr.evt
orbitfiles=../../auxil/ni3013010102.orb.gz ra=83.63322 dec=22.014461 barytime=yes
where:
The RA and DEC are optional inputs, if they are not provided barycorr will use the nominal pointing RA and DEC of NICER. This is usually the desireable behavior, but if NICER has been offset-point, or if the target position in the input files is incorrect or inaccurate, this will lead to inaccurate barycenter results. For this reason, and for the reasons of documenting results for publication, users should always double-check the celestial coordinates of the target. If barytime is set to NO, (which is the default value) the original times in the output file will be overwritten with the barycenter corrected times. See below for a more in-depth discussion of the the barytime YES/NO question. barytime=YES or barytime=NO?Most tutorials for barycentering X-ray data recommend setting barytime=NO. Here we are recommending to set barytime=YES, and we describe why in this section. When barytime=NO, the barycorr tool will overwrite the existing TIME column with barycentered timestamps. The old TIME values are lost. Depending on the target declination and season of the year, the new barycentered timestamp values will have a difference of up to ~500 seconds from the original non-barycentered timestamp values. Downstream NICER software does not work properly with barycentered timestamps in the TIME column. Other auxiliary files such as the filter files and FPM selection information are NOT barycentered. As noted above, there is up to a 500 second difference in timestamp values. When calculating response matrices and background estimates, which use these auxiliary files for interpolation by time, this time offset leads to incorrect estimates of response and background. One approach might be to apply barycenter correction to all files, including the filter file and FPM selection information, etc. However there are some technical difficulties with this approach that are to detailed to describe here, and we cannot recommend this approach. When you set barytime=YES, barycorr keeps the original TIME column intact and unchanged, and it writes a new column called BARYTIME. The BARYTIME column has the new barycentered timestamp values. We will use this to our advantage with NICER software. NICER software will automatically use the TIME column for temporal filtering, background estimation, and response generation. Since the TIME column is unchanged when you set barytime=YES, the NICER tools will report accurate results. All of the new information is encoded in the BARYTIME column, which we can used to encode pulse phase information, as described further below. There are some disadvantages to using barytime=YES. The main one is that some downstream timing software packages rely upon barycentered timestamps being reported in the TIME (not BARYTIME) column. Also some metadata keywords such as TIMESYS are not modified when barytime=YES, and this may confuse some downstream software as well. Thus, our recommendation is to run barycorr with barytime=YES for NICER spectral and light curve analysis, including pulse phase spectroscopy as described below. If you plan on feeding barycentered NICER data to downstream tools, you should run barycorr again, with barytime=NO and a separate output file, and use that file only for the downstream tools (but not NICER products). Analysis: Applying PhasesOnce the data have been barycenter corrected, we need to assign phases. In order to do this an ephemeris is needed. The ephemeris can either be provided from external sources (e.g., the Crab is frequently monitored by Jodrell Bank Observatory and their ephemeris can be found here: https://www.jb.man.ac.uk/pulsar/crab/crab2.txt ) or from your own timing analysis if a periodicity is found in the data. Prior to calculating the phases, it may be easiest to create a new time column with the reference time (epoch) of the ephemeris subtracted from the barycenter corrected times. Alternatively, this can be folded into the phase calculation. The ephemeris reference for the crab data is MJD 58917 plus 0.025552 seconds. Using the HEASARC xtime tool, we can convert this MJD time to the NICER mission elapsed time of 195177602.000 seconds.
To subtract this reference time from the
barycenter corrected time, we use the command:
Phases can then be assigned using an ftcalc command like this:
phase = f * T + 0.5 * fdot * T^2
where f and fdot are the frequency (29.6095750017 Hz) and frequency
derivative (-368174.57e-15 Hz/s), as determined by your pulsar timing
analysis. T is the epoch time, which is BARY_REF_TIME in this case.
The frequency and frequency derivative are from the Crab ephemeris.
The "%" symbol is the CFITSIO calculator modulo operator. In this case, "modulo 1" means to take the fractional part of the value, after removing the whole number portion. Thus, we obtain the fractional phase, from 0.0 - 1.0. The approach described here computes PHASE using an a priori known frequency and frequency derivative, and results in a fractional spin frequency between 0 and 1. Once we have our phases, we can open and plot the phasogram using fv. This can be done using the command: fv ni3013010102_0mpu7_cl_barycorr_PHASE.evt
With the event file open, you can click "HIST", then select "PHASE" for the x-axis. Next click "Make" and you should see the following plot.
Here we can see the pulse profile of the Crab pulsar as observed by NICER. We can zoom in on the first pulse peak by clicking and dragging our cursor to form a box surrounding this segment. This will zoom in on the peak and it should look like the image shown below.
Analysis: Phase-Resolved SpectroscopyIn order to extract the spectrum of just the first X-ray peak, we need to select the start and stop phases of the peak. Since this is simply a demonstration, we select by eye the phases 0.45-0.55 to cover the first peak. In practice, the analyst will chose phase ranges that suit the particular source and pulse profile. Now that we have determined the start and stop phases, we are ready to create a custom Good Time Interval (GTI) file. To accomplish this task, we will use the maketime ftool, which can be used to create custom GTI files. The input to maketime is the event file containing the calculated phases and the output file directory/name. Then we add a statement to filter on the start and stop phases of the first puslar peak. The ".and." selects the times between the phases.
The expression looks like this:
Here, the (barycentered) PHASE column is used for selection of GTIs, but the (unbarycentered) TIME column is used to construct the GTI start and stop times. Thus, the GTIs are not barycentered and can be used to filter unbarycentered NICER event files, but the selection is based upon properly barycentered pulsar phases. Once we have made the GTI file, we can perform a few checks to make sure the file was created correctly. The first check is to simply open the file with fv, click "All" in the STDGTI extension and make sure there are GTIs in the file. Another, more rigorous check, is to check that the correct phases were selected by repeating the steps outlined above. To accomplish this, we first move the folder we were working in to a different name. Next, we rerun nicerl2 with the new GTI file as follows: nicerl2 3013010102 gtifiles=3013010102/xti/event_cl_full/peak_gti.fits clobber=yes
Once this is done, the phases can be recalculated by repeating the steps outlined above. You can then plot them again using fv to ensure that the correct phases were selected. You should see an image similar to Figure 3.
If you performed this check and verified the result, then you can simply run nicerl3-lc on the newly produced files that were created by running nicerl2 with the new GTI file in the standard way (i.e., you do not need to provide a GTI file to nicerl3). Since we are using an event file which has an unbarycentered TIME column, the nicer spectral response and background estimates will be correct. Alternatively, if you are confident that the phase selection worked properly and do not want to rerun everything again, the phase resolved spectrum can simply be extracted using (however see the caveats for the 3C50 model): nicerl3-spect 3013010102 suffix=peak
gtifile=3013010102/xti/event_cl/peak_gti.fits clobber=YES
where:
Analysis: Correcting EXPOSURE for Partial Phase CoverageWhen using maketime to create GTIs, the exposure will only be approximately correctly calculated for sufficiently bright sources, such as the Crab pulsar. However, if you are working with a fainter source, it is safest to update the exposure keyword in the header file of the spectrum. The correct exposure time can be calculated by multiplying the total exposure time by the size of the phase been used. For example, this observation has a total exposure time of 224 seconds, and we selected a phase bin of size 0.55-0.45=0.1. Therefore, the correct exposure time should be 0.1*224=22.4 s. This exposure time can be manually added to the header of the extracted spectrum using the following command: fthedit 'ni3013010102mpu7_srpeak.pha[1]' keyword=exposure operation=add
value=22.4 unit=s comment='updated exposure time'
where:
The NICER team recommends to adjust the exposure for spectra obtained with this approach, because the phase selection results in reduced effective livetime. Now the spectrum can be loaded into xspec and fit using the standard procedures. The correct exposure time will be automatically read into xspec. CaveatsNote that the 3C50 background model is currently not supported when using nicerl3-spect with a GTI file. A workaround to this is to run nicerl2 with the custom GTI file (shown above as a check on the GTI file), and then run nicerl3-spect on that output from nicerl2. In this case no GTI file needs to be passed to nicerl3-spect. No Orbit File?In some cases you may not have an orbit file. This may be because you have quicklook data products or only access to a subset of NICER data. It is still possible to perform barycentering, but with reduced accuracy. Given NICER's trajectory in low earth orbit, a typical maximum error incurred by not using an orbit file is about 40 light-milliseconds. For many objects, including slow pulsars or systems with timing noise, accuracy better than 40 msec may not be required. In that case, you may not need an orbit file to perform barycentering. You may not need an orbit file, if you can tolerate 40 msec timing uncertainty errors in the resulting barycentered timestamps. This will be specific to your source and timing application. If that is the case, you can run barycorr as follows, barycorr ... orbitfiles=GEOCENTER ...
where orbitfiles=GEOCENTER indicates a detailed orbit file is not
required. The "..." indicate that all other parameters to barycorr
can be entered unchanged as described further above.
Modifications
|