Fermi Gamma-ray Space Telescope

Pulse Phase Calculation (gtpphase) Tutorial

The gtpphase tool's purpose is to assign a pulse phase to each record in an event file, based on one or more known pulsar ephemerides.


  • Event data file (See Extract LAT Data).
  • Orbit file to use for the barycentric correction
  • Ephemeris information of suspected pulsation provided in one of the following forms:
    • Manually input the source (pulsar) location (for the barycentric correction), pulse frequency or period, and related information
    • Automatically extracted from a pulsar ephemerides database, available online.

Sample Files. To try the examples in this section, you can download the following simulated data files. The simulated data is for demonstration purposes and the simulated pulsar is slightly brighter than the Vela pulsar. For more information, see the parameters used for the simulation.

Note: Like gtophase, this tool operates on files in place. The examples below are designed to produce the same result from an identical input event file and, in all cases, the event file processed by gtpphase will be identical to:

Also see:

Tutorial SciTools References
Pulsar Analysis Tutorial: Calculate Pulse Phase for Each Photon gtpsearch
Period Search Tutorial gtpphase
Binary Orbital Phase Calculation gtophase

» SciTools References

How To Assign Pulse Phases

There are several ways to input pulsar ephemeris information to the gtpphase tool; it can:

  • Extract a series of ephemerides from an existing pulsar ephemerides database file, or
  • Accept a single ephemeris entered manually by the user.

    In each case, the tool does not produce a separate output file, but operates directly on the input file in place.

    Note: If execution is successful, the tool produces no textual output.

  • The tool applies the barycentric time correction on the fly using the JPL DE405 solar system ephemeris by default. You should know which solar system ephemeris the timing solution for your pulsar uses. In the event that the timing solution uses JPL DE200, simply specify solareph="JPL DE200" on the command line when invoking the tool.

    The timing solution(s) for your pulsar must cover the entire dataset or gtpphase will not successfully run with the DB option. The best way to check the validity of the timing solution(s) is to inspect the D4 manually, either using something like fdump or fv, and to check the 'Valid From' and 'Valid Until' entries for the timing solution(s) corresponding to your pulsar. If the entire dataset is not covered, one may divide the dataset, using a tool like gtselect, and apply the phase with the DB option in gtpphase for the files corresponding to valid time periods and then use the FREQ or PER option to input the timing solution manually for those periods outside the valid range using either the output from gtephem (gtephem tutorial link here) or an ephemeris from the literature. Then, the files can be remerged using a tool like gtselect or the FTOOL fmerge.

Using A Pulsar Ephemerides Database File

The simplest way to run the gtpphase tool, which may suffice for most applications, is for the tool to extract the information from a pulsar database. The exact process the tool uses for choosing ephemerides will be described below.

The following plot of the modified events file was produced using the Ftools fhisto and fplot, and shows the distribution of counts in the PULSE_PHASE column in the events file following the phase assignment performed above.

gtpphase example 3 (graphical output)

The plot shows a sinusoidal folded-light curve, which is consistent with a pulse profile of the simulated pulsar.

Inputing A Pulsar Ephemeris Manually

Another option is to supply the essential ephemeris information manually. For example, this may be useful when an ephemeris is not available in a database, but the necessary information is available in the literature. In the example shown below, the same values which were extracted from the database in the previous example were entered manually.

The result of this run is identical to that of the previous example.

Getting More Information on Computation

If gtpphase is invoked with chatter parameter set to 4 or larger, it will display brief summaries of loaded ephemerides, arrival time corrections, and time systems being used. This feature shows you additional information on computations being performed, which may help you understand the tool. Also, the extra information printed may contain a clue to diagnose certain types of problem. So, try a high chatter when you are unsure on the tool's behavior.

Last updated by: Elizabeth Ferrara 04/05/2012