LALPulsar  6.1.0.1-c9a8ef6
BinaryPulsarTiming.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007 Bernd Machenschalk, Jolien Creighton, Matt Pitkin
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19 
20 /**
21  * \author Matt Pitkin, Bernd Machenschalk
22  * \date 2007
23  * \file
24  * \ingroup lalpulsar_general
25  * \brief Functions to calculate binary system time delays and read TEMPO pulsar parameter files
26  *
27  * The main function in this code - <tt>XLALBinaryPulsarDeltaT</tt> - is for
28  * calculating the time delay on a pulsar signal caused by its orbit within a
29  * binary system. It tranforms a signal from the binary system barycentre to the
30  * pulsar proper time. It is equivalent to the <tt>LALBarycenter()</tt>
31  * functions for transforming the Earth reference frame to the solar system
32  * barycentre. It copies the functions from the standard pulsar timing software
33  * <tt>TEMPO</tt> and can use the various binary system models BT, BT1P, BT2P,
34  * BTX, ELL1, DD and MSS.
35  *
36  * Included is a function to read in a set of pulsar parameters from a
37  * standard <tt>TEMPO</tt> parameter (.par) file -
38  * <tt>XLALReadTEMPOParFile</tt>.
39  *
40  * Also included are function to convert times given in the TT, TDB or TCB
41  * frames (given as a modified Julian Date - MJD) into a GPS time.
42  */
43 
44 #ifndef _BINARYPULSARTIMING_H
45 #define _BINARYPULSARTIMING_H
46 
47 #include <ctype.h>
48 
49 #include <lal/LALStdlib.h>
50 #include <lal/StringVector.h>
51 #include <lal/LALBarycenter.h>
52 #include <lal/Date.h>
53 
54 #include <lal/ReadPulsarParFile.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 
61 /**\name Error Codes */ /** @{ */
62 #define BINARYPULSARTIMINGH_ENULLINPUT 1
63 #define BINARYPULSARTIMINGH_ENULLOUTPUT 2
64 #define BINARYPULSARTIMINGH_ENULLPARAMS 3
65 #define BINARYPULSARTIMINGH_ENULLBINARYMODEL 4
66 #define BINARYPULSARTIMINGH_EFAIL 5
67 #define BINARYPULSARTIMINGH_ENAN 6
68 
69 #define BINARYPULSARTIMINGH_MSGENULLINPUT "Input was Null"
70 #define BINARYPULSARTIMINGH_MSGENULLOUTPUT "Output was Null"
71 #define BINARYPULSARTIMINGH_MSGENULLPARAMS "Params was Null"
72 #define BINARYPULSARTIMINGH_MSGNULLBINARYMODEL "Binary model is Null or not specified - you should\
73 not be in the binary timing routine"
74 #define BINARYPULSARTIMINGH_MSGEFAIL "Time delay computation failed"
75 #define BINARYPULSARTIMINGH_MSGENAN "Output is NaN!"
76 
77 /** @} */
78 
79 
80 /** structure containing the Kopeikin terms */
81 typedef struct tagKopeikinTerms {
86 
91 
96 
101 } KopeikinTerms;
102 
103 /** structure containing the input parameters for the binary delay function */
104 typedef struct tagBinaryPulsarInput {
105  REAL8 tb; /**< Time of arrival (TOA) at the SSB */
106 
107  EarthState earth; /**< The current Earth state (for e.g. calculating
108  Kopeikin terms) */
110 
111 /** structure containing the output parameters for the binary delay function */
112 typedef struct tagBinaryPulsarOutput {
113  REAL8 deltaT; /**< deltaT to add to TDB in order to account for binary */
115 
116 /**** DEFINE FUNCTIONS ****/
117 /**
118  * \brief This function will iteratively calculate the eccentric anomaly from
119  * Kelper's equation
120  *
121  * The equation is solved using a Newton-Raphson technique and the S9
122  * starting value in Odell & Gooding 1986 CeMec 38 307. This is taken from the
123  * TEMPO2 code T2model.C
124  */
125 void
126 XLALComputeEccentricAnomaly( REAL8 phase, REAL8 ecc, REAL8 *u );
127 
128 /**
129  * \brief This function will compute the effect of binary parameters on the
130  * pulsar parallax
131  *
132  * This function is based on the terms given in Kopeikin, Ap. J. Lett, 439,
133  * 1995. The computation is copied from the KopeikinTerms function in the
134  * T2model.C file of TEMPO2.
135  */
138  BinaryPulsarInput *input );
139 
142  BinaryPulsarInput *input );
143 
144 /**
145  * function to calculate the binary system delay
146  */
147 void
149  BinaryPulsarInput *input,
151 
152 /**
153  * function to calculate the binary system delay using new parameter structure
154  */
155 void
157  BinaryPulsarInput *input,
159 
160 void
163  BinaryPulsarInput *input,
165 
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif /* _BINARYPULSARTIMING_H */
void XLALBinaryPulsarDeltaTNew(BinaryPulsarOutput *output, BinaryPulsarInput *input, PulsarParameters *params)
function to calculate the binary system delay using new parameter structure
void XLALComputeKopeikinTerms(KopeikinTerms *kop, BinaryPulsarParams *params, BinaryPulsarInput *input)
This function will compute the effect of binary parameters on the pulsar parallax.
void XLALComputeKopeikinTermsNew(KopeikinTerms *kop, PulsarParameters *params, BinaryPulsarInput *input)
void XLALComputeEccentricAnomaly(REAL8 phase, REAL8 ecc, REAL8 *u)
This function will iteratively calculate the eccentric anomaly from Kelper's equation.
void LALBinaryPulsarDeltaT(LALStatus *status, BinaryPulsarOutput *output, BinaryPulsarInput *input, BinaryPulsarParams *params)
Calculate the binary system time delay using the pulsar parameters in params.
void XLALBinaryPulsarDeltaT(BinaryPulsarOutput *output, BinaryPulsarInput *input, BinaryPulsarParams *params)
function to calculate the binary system delay
double REAL8
structure containing the input parameters for the binary delay function
REAL8 tb
Time of arrival (TOA) at the SSB.
EarthState earth
The current Earth state (for e.g.
structure containing the output parameters for the binary delay function
REAL8 deltaT
deltaT to add to TDB in order to account for binary
A structure to contain all pulsar parameters and associated errors.
Basic output structure of LALBarycenterEarth.c.
structure containing the Kopeikin terms
The PulsarParameters structure to contain a set of pulsar parameters.