TEMPO2 tutorial George Hobbs (饺子), Research Scientist CSIRO Australia Telescope National Facility, International Young Scientist of NTSC george.hobbs@csiro.au Content • TEMPO2 is a software package. It implements “pulsar timing” algorithms. • Section 1: What TEMPO2 has been used for. Overview of TEMPO2 • Section 2: How to use TEMPO2 • Section 3: How to develop TEMPO2 • Major TEMPO2 developers (software and algorithms): G. Hobbs, R. Edwards, R. Manchester, W. Coles, X. You, M. Keith, F. Jenet, D. Yardley, J. Verbiest, … CSIRO. TEMPO2 What has tempo2 been used for in 2010/2011? • Searching for gravitational wave signals (e.g., Yardley et al. 2011, Yardley et al. 2010, Abbott et al. 2010, van Haasteren et al. 2010) • Using pulsars as navigational aids (Ruggiero 2011) • Statistical analysis of timing residuals (e.g., Na, X. S. et al., 2011, Hobbs et al. 2010) • Studying emission geometry (e.g., Noutsos et al., 2011) • Searching for gamma-ray pulsars (Ray et al., 2010) • Determining pulsar masses (Demorest et al. 2010) • Studying pulsations from main-sequence stars (Ravi et al. 2010) • Tests of relativity (Weisberg et al. 2010) • Measuring Jupiter’s mass (Champion et al. 2010) • Observations of glitches (Chukwude et al. 2010) • Analysis of accreting millisecond X-ray pulsar (Patruno et al. 2010) • Relativistic spin precession (Manchester et al. 2010) CSIRO. TEMPO2 What does tempo2 do? • USAGE 1: • Start with file of pulse arrival times • Start with model of a pulsar’s spin, astrometric and orbital parameters • -> pulsar timing residuals • USAGE 2: • Start with pulsar timing model -> predict the pulse phase and frequency at a given observatory at a given time CSIRO. TEMPO2 A parameter file (.par) Pulsar name, astrometric, rotational, dispersion measure and orbital parameters Fit for this parameter? Realisation of terrestrial time Solar system ephemeris Weighted fit? CSIRO. TEMPO2 An arrival time file (.tim) States that this is a tempo2 format file Filename or identifier CSIRO. TEMPO2 Observing frequency (MHz) Site arrival time (MJD) Telescope code Uncertainty on arrival time (us) User defined flags How does tempo2 work? • The algorithms are based on those implemented in TEMPO1 • Details in Hobbs, Edwards & Manchester (2006) and Edwards, Hobbs & Manchester (2006) Clock corrections Einstein delay Shapiro delay Roemer delay Conversion of site-arrivaltime to pulse emission time CSIRO. TEMPO2 Atmospheric delays Dispersive delay Secular motion (e.g., radial velocity) Orbital motion Details: clock correction • Must convert from the observatory time standard to a realisation of terrestrial time TT. Use set of text files containing the difference between two time standards: pks2gps.clk, gps2utc.clk, utc2tai.clk, tai2tt_bipm2011. You’ll find these files in $TEMPO2/clock directory CSIRO. TEMPO2 Details: Einstein delay • Pulse arrival times (in terrestrial time) must be converted to the frame of the Solar System Barycentre. • TEMPO2 uses the tabulated results of Irwin & Fukushima (1999) CSIRO. TEMPO2 Details: Roemer delay • The Roemer delay is the vacuum light travel time between the pulse arriving at the observatory and the equivalent arrival time at the SSB. pulsar R kˆ K = Unit vector pointing at pulsar. Obtained from RA, DEC, PMRA, PMDEC CSIRO. TEMPO2 Use observatory coordinate file to know position of observatory k Earth R R is vector from observatory to SSB. Use JPL ephemeris, observatory coordinates and earth orientation parameters SSB Roemer delay Pulsar in ecliptic Ecliptic latitude = 90 deg CSIRO. Gravitational wave detection Details: Shapiro delay • Time delay caused by the passage of the pulse through large gravitational fields. Tempo2 includes delay caused by Sun (< 110us), Jupiter (<180ns), Saturn (<58ns), Neptune (<12ns) and Uranus (<10ns) CSIRO. TEMPO2 Details: dispersive delay • D is the dispersion constant. DM (cm-3pc) = 2.410 x 10-16 D • f is the frequency of the radiation at the Solar System barycentre CSIRO. TEMPO2 Details: binary system • For pulsars in binary systems, tempo2 includes parameters describing the orbital motion. • Various binary models exist. Suggest using “T2” model that combines most earlier binary models CSIRO. TEMPO2 Using the pulsar timing model • Have pulse emission time in the pulsar frame. • Predict using the pulsar timing model Pulse frequency (and time derivatives) Phase of pulse sequence Pulse emission time Reference phase Time at which df/dt = n • Can also include simple model of glitch events CSIRO. TEMPO2 Timing residuals Pulse phase Timing residual for i’th observation CSIRO. TEMPO2 Nearest integer to fi Pulse frequency Example Time 1 2 3 Measured arrival time with observatory clock Measured arrival time in terrestrial time (Dc) Measured arrival time in pulsar frame Predicted arrival times in pulsar frame 4 5 CSIRO. TEMPO2 Timing residual Pulsar timing residuals • If pulsar model predicts the observations perfectly (and the conversion from the observatory to pulsar frame is perfect) then R = 0 (within measurement uncertainty). • If R != 0 then the pulsar model is (1) not accurate or (2) does not include a physical process that affects the measured arrival times or (3) the correction from the observatory to pulsar frame is not correct. CSIRO. TEMPO2 Pulsar timing residuals: incorrect F0 Pmodel > Ptrue CSIRO. TEMPO2 Pulsar timing residuals: incorrect F1 Pmodel < Ptrue CSIRO. TEMPO2 Pmodel > Ptrue Pulsar timing residuals: incorrect position CSIRO. TEMPO2 Pulsar timing residuals: incorrect proper motion CSIRO. TEMPO2 Pulsar timing residuals Good parameters Do not have a phase connected solution CSIRO. TEMPO2 Phase wraps Induced timing residuals from ISM and from gravitational waves 10cm (~3000MHz) 20cm (~1400MHz) Induced residuals from gravitational wave background CSIRO. TEMPO2 50cm (~600MHz) Incorrect conversion to pulsar frame Champion et al. (2010): induced timing residuals from error in mass of Jupiter of 5x10-10 Mo CSIRO. TEMPO2 Predictive mode • TEMPO2 can provide a polynomial approximation of the phase and pulse frequency at the observatory for a specified time interval. • TEMPO1 creates polycos. TEMPO2 can create polycos, but we recommend predictors. • Predictors model the phase as a function of time using Chebyshev polynomials. • Tempo2 provides a ‘C library’ to read predictors Observing frequency range (MHz) • tempo2 –f mypar.par –pred "sitename mjd1 mjd2 freq1 freq2 ntimecoeff nfreqcoeff seg_length" Segment length (s) CSIRO. TEMPO2 Time range Part 2 • Usage of tempo2 and example of pulsar timing • TEMPO2 is written in C/C++ (with a little Fortran) and runs on linux and MacOS. • Main tempo2 website: http://www.atnf.csiro.au/research/pulsar/tempo2 (see “tutorials” and “Documentation”) • Main tempo2 download site: • http://sourceforge.net/projects/tempo2 • Tempo2 email distribution list: • Sign up at http://pulsarastronomy.net (click on “Mailing Lists”) • Contact: george.hobbs@csiro.au, use feedback form CSIRO. TEMPO2 Running tempo2 • Need a pulsar model (use the ATNF pulsar catalogue – http://www.atnf.csiro.au/research/pulsar/psrcat - type in pulsar name and click ‘Get Ephemeris’) • Get some pulse arrival times (use Parkes data archive – see Jonathan’s talk and ‘pat’ in psrchive – see Willem’s talk) • tempo2 –f psrname.par psrname.tim CSIRO. TEMPO2 Using the “plk” graphical interface • tempo2 –gr plk –f mypar.par mytim.tim Which parameters to fit Re-do the fit What to plot The residuals Press ‘h’ to get help CSIRO. TEMPO2 Other useful graphical interfaces: spectrum CSIRO. TEMPO2 Other useful graphical interfaces: plotMany tempo2 –gr plotMany –f par1.par tim1.tim –f par2.par tim2.tim –f par3.par par3.tim … CSIRO. TEMPO2 The glitch plugin Yu Meng (in preparation) Pulse frequency Pulse frequency with mean removed Pulse frequency derivative CSIRO. TEMPO2 Glitch events Using “output” interfaces • tempo2 –output general –s “Hello f0 = {f0_v} {f0_e}\n f1 = {f1_v} {f1_e}\n” –f mypar.par mytim.tim • tempo2 –output general2 –s “freq = {freq}, sat = {sat}, bat = {bat}, res = {pre}\n” –f mypar.par mytim.tim • tempo2 –output matrix –f mypar.par mytim.tim CSIRO. TEMPO2 Part 3: Developing the software • You should never need to modify the main tempo2 source code. (Please report any bugs to george.hobbs@csiro.au) • You should create new “plug-in packages”. These can be for text output, a graphical interface, methods to select data or new fitting algorithms. CSIRO. TEMPO2 Creating a new text output format • Print out the pulsar model parameters and the timing residuals in your format Must include tempo2.h Must have this function Pulsar number Parameter of interest Time derivative Number of observations CSIRO. TEMPO2 Observation number Observation parameter Creating a new graphical interface Must include this function Must define how many pulsars to process Must process the command line arguments Read parameter and observation file(s) Form barycentric arrival times, residuals and fit. Repeat with postfit parameters CSIRO. TEMPO2 Do your plotting/analysis Output format versus graphical interface • Output format: tempo2 runs as usual then gives control to your plugin to display the output (easy, but no control over fitting etc.) • Graphical interface: tempo2 provides control to your plugin from the beginning (your plugin must call all the functions to read data files, do the fit etc., but you have more control) CSIRO. TEMPO2 The tempo2 toolkits • To aid development the following toolkits are available: • T2toolkit.h: find minimum and maximum values in array, find RMS, mean, range, sort data array, create random numbers • TKspectrum.h: routines for spectral estimation • TKfit.h: fitting routines (e.g., SVD, Cholesky decomposition …) • tempo2Util.h: calculate dot products, turns hh:mm:ss/dd:mm:ss into degrees • gwsim.h: gravitational wave simulation routines. • (NOTE: Many people use “numerical recipes” routines in plugins – these are copyright and the source code cannot be made publically available – use the tempo2 toolkits instead) CSIRO. TEMPO2 Debugging your installation • Sometimes things don’t work! • If it doesn’t compile: check that your version of gfortran, gcc and g++ are the same! Check that pgplot has been correctly installed. • It compiles and runs, but doesn’t do anything: run your code with > tempo2 …. –f mypar.par mytim.tim –debug –displayVersion > outfile and then send your .par, .tim and outfile to george.hobbs@csiro.au (or any tempo2 developer) • Your plugin does not work. Check that you have installed the plugin in $TEMPO2/plugins/ CSIRO. TEMPO2 Publishing results from tempo2 • For general usage, please cite: Hobbs, Edwards & Manchester (2006) • For details of the algorithms: Edwards, Hobbs & Manchester (2006) • For gravitational wave implementation: Hobbs et al. (2009) • To enable complete reproducibility of results should include an appendix including output of –displayVersion. • Important: publish the clock reference (e.g., TT(TAI)) and Solar System ephemeris model (e.g., DE405) CSIRO. TEMPO2 Topics not covered in this presentation • • • • • • • • Simulating data (use fake, GWbkgrd … plugins) Use of ‘flags’ (use –select, -pass, -filter options) Atmospheric corrections Xiaopeng’s Solar Wind model FERMI gamma-ray plugin Use of –fitfunc and –splug interfaces Use of region files Measuring dispersion measure variations • Look at the tempo2 tutorials on http://www.atnf.csiro.au/research/pulsar/tempo2 CSIRO. Gravitational wave detection The future of tempo2 • Improved binary models • Plugin to determine irregularities in terrestrial time standards (see Ding Chen’s talk) • In-built algorithms to model gravitational waves • Methods to determine dispersion measure variations • Improved methods for simulating data • Algorithms to enable pulsar navigation • Web-based access tools (so you do not need to install your own version of tempo2) •… CSIRO. TEMPO2 Conclusions • Tempo2 is a publically available software package for pulsar timing: http://www.atnf.csiro.au/research/pulsar/tempo2 • Plugin-packages can be developed for specific research topics • Tempo2 is suitable for all current high-precision pulsar timing applications • Tempo2 can process multiple pulsars simultaneously • Download TEMPO2 and try it out! • TEMPO2 真的是一个好东西,希望大家都来试试,你 会爱上它的! • Supported by the Chinese Academy of Sciences #CAS KJCX2-YWT09 and NSFC 10803006. Australian Research Council QEII Fellowship CSIRO. TEMPO2