LALPulsar  6.1.0.1-c9a8ef6
SSBtimes.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Chris Messenger
3  * Copyright (C) 2005 Reinhard Prix
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with with program; see the file COPYING. If not, write to the
17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  * MA 02110-1301 USA
19  */
20 #ifndef _SSBTIMES_H /* Double-include protection. */
21 #define _SSBTIMES_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /**
28  * \defgroup SSBtimes_h Header SSBtimes.h
29  * \ingroup lalpulsar_coh
30  * \author Reinhard Prix
31  * \date 2005
32  * \brief Functions for working with SSB times.
33  */
34 /** @{ */
35 
36 /*---------- exported INCLUDES ----------*/
37 #include <lal/LALStdlib.h>
38 #include <lal/UserInputParse.h>
39 #include <lal/PulsarDataTypes.h>
40 #include <lal/DetectorStates.h>
41 
42 /*---------- exported types ----------*/
43 
44 /** The precision in calculating the barycentric transformation */
45 typedef enum tagSSBprecision {
46  SSBPREC_NEWTONIAN, /**< simple Newtonian: \f$ \tau = t + \vec{r}\cdot\vec{n}/c \f$ */
47  SSBPREC_RELATIVISTIC, /**< detailed relativistic: \f$ \tau=\tau(t; \vec{n}, \vec{r}) \f$ */
48  SSBPREC_RELATIVISTICOPT, /**< optimized relativistic, numerically equivalent to #SSBPREC_RELATIVISTIC, but faster */
49  SSBPREC_DMOFF, /**< switch off all demodulatoin terms */
50  SSBPREC_LAST /**< end marker */
52 
53 /** Static array of all \c SSBprecision choices, for use by the UserInput module parsing routines */
54 extern const UserChoices SSBprecisionChoices;
55 
56 /** Simple container for two REAL8-vectors, namely the SSB-timings DeltaT_alpha and Tdot_alpha,
57  * with one entry per SFT-timestamp. These are required input for XLALNewDemod().
58  * We also store the SSB reference-time tau0.
59  */
60 typedef struct tagSSBtimes {
61  LIGOTimeGPS refTime; /**< reference-time 'tau0' */
62  REAL8Vector *DeltaT; /**< Time-difference of SFT-alpha - tau0 in SSB-frame */
63  REAL8Vector *Tdot; /**< dT/dt : time-derivative of SSB-time wrt local time for SFT-alpha */
64 } SSBtimes;
65 
66 /** Multi-IFO container for SSB timings */
67 typedef struct tagMultiSSBtimes {
68  UINT4 length; /**< number of IFOs */
69  SSBtimes **data; /**< array of SSBtimes (pointers) */
71 
72 /*---------- exported Global variables ----------*/
73 
74 /*---------- exported prototypes [API] ----------*/
75 int XLALAddBinaryTimes( SSBtimes **tSSBOut, const SSBtimes *tSSBIn, const PulsarDopplerParams *Doppler );
76 int XLALAddMultiBinaryTimes( MultiSSBtimes **multiSSBOut, const MultiSSBtimes *multiSSBIn, const PulsarDopplerParams *Doppler );
79 
80 SSBtimes *XLALGetSSBtimes( const DetectorStateSeries *DetectorStates, SkyPosition pos, LIGOTimeGPS refTime, SSBprecision precision );
81 MultiSSBtimes *XLALGetMultiSSBtimes( const MultiDetectorStateSeries *multiDetStates, SkyPosition skypos, LIGOTimeGPS refTime, SSBprecision precision );
82 
83 int XLALEarliestMultiSSBtime( LIGOTimeGPS *out, const MultiSSBtimes *multiSSB, const REAL8 Tsft );
84 int XLALLatestMultiSSBtime( LIGOTimeGPS *out, const MultiSSBtimes *multiSSB, const REAL8 Tsft );
85 
86 /* destructors */
87 void XLALDestroySSBtimes( SSBtimes *multiSSB );
88 void XLALDestroyMultiSSBtimes( MultiSSBtimes *multiSSB );
89 
90 /** @} */
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 /* C++ protection. */
96 
97 #endif /* Double-include protection. */
double REAL8
uint32_t UINT4
SSBprecision
The precision in calculating the barycentric transformation.
Definition: SSBtimes.h:45
int XLALEarliestMultiSSBtime(LIGOTimeGPS *out, const MultiSSBtimes *multiSSB, const REAL8 Tsft)
Find the earliest timestamp in a multi-SSB data structure.
Definition: SSBtimes.c:691
MultiSSBtimes * XLALGetMultiSSBtimes(const MultiDetectorStateSeries *multiDetStates, SkyPosition skypos, LIGOTimeGPS refTime, SSBprecision precision)
Multi-IFO version of XLALGetSSBtimes().
Definition: SSBtimes.c:657
const UserChoices SSBprecisionChoices
Static array of all SSBprecision choices, for use by the UserInput module parsing routines.
Definition: SSBtimes.c:41
void XLALDestroyMultiSSBtimes(MultiSSBtimes *multiSSB)
Destroy a MultiSSBtimes structure.
Definition: SSBtimes.c:845
void XLALDestroySSBtimes(SSBtimes *tSSB)
Destroy a SSBtimes structure.
Definition: SSBtimes.c:822
SSBtimes * XLALGetSSBtimes(const DetectorStateSeries *DetectorStates, SkyPosition pos, LIGOTimeGPS refTime, SSBprecision precision)
For a given DetectorStateSeries, calculate the time-differences , and their derivatives .
Definition: SSBtimes.c:518
int XLALAddMultiBinaryTimes(MultiSSBtimes **multiSSBOut, const MultiSSBtimes *multiSSBIn, const PulsarDopplerParams *Doppler)
Multi-IFO version of XLALAddBinaryTimes().
Definition: SSBtimes.c:413
int XLALLatestMultiSSBtime(LIGOTimeGPS *out, const MultiSSBtimes *multiSSB, const REAL8 Tsft)
Find the latest timestamp in a multi-SSB data structure.
Definition: SSBtimes.c:754
MultiSSBtimes * XLALDuplicateMultiSSBtimes(const MultiSSBtimes *multiSSB)
Duplicate (ie allocate + copy) an input MultiSSBtimes structure.
Definition: SSBtimes.c:487
int XLALAddBinaryTimes(SSBtimes **tSSBOut, const SSBtimes *tSSBIn, const PulsarDopplerParams *Doppler)
Compute extra time-delays for a CW source in a (Keplerian) binary orbital system.
Definition: SSBtimes.c:259
SSBtimes * XLALDuplicateSSBtimes(const SSBtimes *tSSB)
Duplicate (ie allocate + copy) an input SSBtimes structure.
Definition: SSBtimes.c:454
@ SSBPREC_LAST
end marker
Definition: SSBtimes.h:50
@ SSBPREC_RELATIVISTIC
detailed relativistic:
Definition: SSBtimes.h:47
@ SSBPREC_RELATIVISTICOPT
optimized relativistic, numerically equivalent to SSBPREC_RELATIVISTIC, but faster
Definition: SSBtimes.h:48
@ SSBPREC_NEWTONIAN
simple Newtonian:
Definition: SSBtimes.h:46
@ SSBPREC_DMOFF
switch off all demodulatoin terms
Definition: SSBtimes.h:49
Timeseries of DetectorState's, representing the detector-info at different timestamps.
Multi-IFO time-series of DetectorStates.
Multi-IFO container for SSB timings.
Definition: SSBtimes.h:67
SSBtimes ** data
array of SSBtimes (pointers)
Definition: SSBtimes.h:69
UINT4 length
number of IFOs
Definition: SSBtimes.h:68
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
Simple container for two REAL8-vectors, namely the SSB-timings DeltaT_alpha and Tdot_alpha,...
Definition: SSBtimes.h:60
REAL8Vector * Tdot
dT/dt : time-derivative of SSB-time wrt local time for SFT-alpha
Definition: SSBtimes.h:63
REAL8Vector * DeltaT
Time-difference of SFT-alpha - tau0 in SSB-frame.
Definition: SSBtimes.h:62
LIGOTimeGPS refTime
reference-time 'tau0'
Definition: SSBtimes.h:61