LALPulsar  6.1.0.1-fe68b98
Velocity.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005 Badri Krishnan, Alicia Sintes
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 /* double inclusion protection */
21 #ifndef _VELOCITY_H
22 #define _VELOCITY_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /**
29  * \author Krishnan, B., Sintes, A.M.
30  * \defgroup Velocity_h Header Velocity.h
31  * \ingroup lalpulsar_hough
32  * \brief Computation of instant and averaged velocities for a given detector and the like.
33  *
34  * ### Synopsis ###
35  *
36  * \code
37  * #include <lal/Velocity.h>
38  * \endcode
39  *
40  * To find the velocity of a given detetector at a given time, or the averaged
41  * velocity of a detector in a certain time interval.
42  *
43  */
44 /** @{ */
45 
46 
47 /* *************
48  * Includes. This header may include others; if so, they go immediately
49  * after include-loop protection. Includes should appear in the following
50  * order:
51  * a. Standard library includes
52  * b. LDAS includes
53  * c. LAL includes
54  */
55 #include<lal/Date.h>
56 #include<lal/LALDatatypes.h>
57 #include<lal/ComputeSky.h>
58 #include<lal/LALInitBarycenter.h>
59 #include<lal/LALBarycenter.h>
60 #include<lal/LALStdlib.h>
61 #include<lal/LALConstants.h>
62 
63 
64 /* ***************************************
65  * Error codes and messages. This must be auto-extracted for
66  * inclusion in the documentation.
67  */
68 /**\name Error Codes */
69 /** @{ */
70 #define VELOCITYH_ENULL 1
71 #define VELOCITYH_EVAL 2
72 #define VELOCITYH_MSGENULL "Null Pointer"
73 #define VELOCITYH_MSGEVAL "Invalid Value"
74 /** @} */
75 
76 /* *****************************************************
77  * Structure, enum, union, etc., typdefs.
78  */
79 
80 /**
81  * This structure stores the parameters required by XLALBarycenter() to calculate
82  * Earth velocity at a given detector location.
83  */
84 typedef struct tagVelocityPar {
85  LALDetector detector; /**< the detector */
86  EphemerisData *edat; /**< ephemeris data pointer from XLALInitBarycenter() */
87  LIGOTimeGPS startTime; /**< start of time interval */
88  REAL8 tBase; /**< duration of interval */
89  REAL8 vTol; /**< fractional accuracy required for velocity (redundant for average velocity calculation) */
90 } VelocityPar;
91 
92 /* ***************************************************
93  * Functions Declarations (i.e., prototypes).
94  */
95 #ifdef SWIG // SWIG interface directives
96 SWIGLAL( OUTPUT_ARRAY_1D( REAL8, v[3], x[3] ) );
97 #endif // SWIG
99  REAL8 v[3], /* output vector representing average velocity */
100  VelocityPar *in ); /* parameters required to calculate V */
101 
103  REAL8 x[3], /* output vector representing average position */
104  VelocityPar *in ); /* parameters required to calculate position */
105 
107  REAL8 v[3], /* output velocity vector */
108  LIGOTimeGPS *time0, /* time at which velocity is calculated */
109  LALDetector detector, /* detector */
110  EphemerisData *edat );
111 
113  REAL8 x[3], /* output position vector */
114  LIGOTimeGPS *time0, /* time at which position is calculated */
115  LALDetector detector, /* detector*/
116  EphemerisData *edat );
117 
118 /* ****************************************************** */
119 
120 /** @} */
121 
122 #ifdef __cplusplus
123 } /* Close C++ protection */
124 #endif
125 
126 #endif /* end of double inclusion protection */
127 
double REAL8
void LALDetectorVel(LALStatus *status, REAL8 v[3], LIGOTimeGPS *time0, LALDetector detector, EphemerisData *edat)
This function finds the velocity of a given detector at a given time.
Definition: Velocity.c:200
void LALDetectorPos(LALStatus *status, REAL8 x[3], LIGOTimeGPS *time0, LALDetector detector, EphemerisData *edat)
This finds velocity of a given detector at a given time.
Definition: Velocity.c:258
void LALAvgDetectorVel(LALStatus *status, REAL8 v[3], VelocityPar *in)
This function outputs the average velocity REAL8 v[3] of the detector during a time interval.
Definition: Velocity.c:34
void LALAvgDetectorPos(LALStatus *status, REAL8 x[3], VelocityPar *in)
Given a detector and a time interval, this function outputs the average position of the detector duri...
Definition: Velocity.c:95
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
This structure stores the parameters required by XLALBarycenter() to calculate Earth velocity at a gi...
Definition: Velocity.h:84
EphemerisData * edat
ephemeris data pointer from XLALInitBarycenter()
Definition: Velocity.h:86
LALDetector detector
the detector
Definition: Velocity.h:85
REAL8 tBase
duration of interval
Definition: Velocity.h:88
LIGOTimeGPS startTime
start of time interval
Definition: Velocity.h:87
REAL8 vTol
fractional accuracy required for velocity (redundant for average velocity calculation)
Definition: Velocity.h:89