TimeDelay.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Alexander Dietz, Drew Keppel, Duncan Brown, David Chin, Jolien Creighton, Kipp Cannon, Stephen Fairhurst
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /*
00021 <lalVerbatim file="TimeDelayHV">
00022 
00023 Author: David Chin <dwchin@umich.edu> 1-734-709-9119
00024 $Id: TimeDelay.h,v 1.21 2007/07/11 16:42:11 jolien Exp $
00025    
00026 </lalVerbatim> */
00027 
00028 /* 
00029 <lalLaTeX>
00030 
00031 \section{Header \texttt{TimeDelay.h}}
00032 \label{s:TimeDelay.h}
00033 
00034 Provides routine to compute time delay between two detectors.
00035 
00036 \subsection*{Synopsis}
00037 \begin{verbatim}
00038 #include <lal/TimeDelay.h>
00039 \end{verbatim}
00040 
00041 This header provides prototypes of routines to compute the difference in
00042 time for a signal to arrive at two detectors.  The routine is a direct
00043 translation of the Maple worksheet by Anderson, \emph{et al.}, available at
00044 \verb+http://dirac.utb.edu/~warren/unprot/beam_patterns.tar.gz+.
00045 
00046 </lalLaTeX> */
00047 
00048 
00049 #ifndef _TIMEDELAY_H
00050 #define _TIMEDELAY_H
00051 
00052 #include <lal/LALStdlib.h>
00053 #include <lal/Date.h>
00054 #include <lal/DetectorSite.h>
00055 #include <lal/SkyCoordinates.h>
00056 
00057 #ifdef __cplusplus
00058 extern "C"
00059 {
00060 #endif
00061 
00062 NRCSID( TIMEDELAYH, "$Id: TimeDelay.h,v 1.21 2007/07/11 16:42:11 jolien Exp $" );
00063 
00064 /* <lalLaTeX>
00065 
00066 \subsection*{Error conditions}
00067 
00068 </lalLaTeX> */
00069 
00070 /* <lalErrTable> */
00071 #define TIMEDELAYH_ENUL 1
00072 
00073 #define TIMEDELAYH_MSGENUL "Unexpected null pointer in arguments"
00074 /* </lalErrTable> */
00075 
00076 /* <lalLaTeX>
00077 
00078 \subsection*{Structures}
00079 \begin{verbatim}
00080 TwoDetsTimeAndASource
00081 \end{verbatim}
00082 \idx[Type]{TwoDetsTimeAndASource}
00083 
00084 \noindent This structure stores two pointers to \verb+LALPlaceAndGPS+
00085 structures, and a pointer to a \verb+SkyPosition+ structure.  The
00086 fields are:
00087 
00088 \begin{description}
00089 \item{\verb+LALPlaceAndGPS *p_det_and_time1+} The first detector and GPS
00090 \item{\verb+LALPlaceAndGPS *p_det_and_time2+} The second detector and GPS
00091 \item{\verb+SkyPosition *p_source+} The source location (equatorial
00092     co\"{o}dinates in decimal radians)
00093 \end{description}
00094 
00095 </lalLaTeX> */
00096 
00097 typedef struct
00098 tagTwoDetsTimeAndASource
00099 {
00100   LALPlaceAndGPS *p_det_and_time1; /* the first detector and detection time */
00101   LALPlaceAndGPS *p_det_and_time2; /* the second detector and detection time */
00102   SkyPosition    *p_source;        /* source Equatorial location
00103                                     * (lon=RA, lat=dec) in decimal
00104                                     * radians */ 
00105 }
00106 TwoDetsTimeAndASource;
00107 
00108 
00109 /* <lalLaTeX>
00110 
00111 \begin{verbatim}
00112 DetTimeAndASource
00113 \end{verbatim}
00114 \idx[Type]{DetTimeAndASource}
00115 
00116 \noindent This structure stores one pointer to a \verb+LALPlaceAndGPS+
00117 structure, and a pointer to a \verb+SkyPosition+ structure.  The
00118 fields are:
00119 
00120 \begin{description}
00121 \item{\verb+LALPlaceAndGPS *p_det_and_time+} The detector and GPS
00122 \item{\verb+SkyPosition *p_source+}  The source location (equatorial
00123     co\"{o}dinates in decimal radians)
00124 \end{description}
00125 
00126 </lalLaTeX> */
00127   
00128 typedef struct
00129 tagDetTimeAndASource
00130 {
00131   LALPlaceAndGPS *p_det_and_time; /* detector and detection time */
00132   SkyPosition    *p_source;       /* source Equatorial location
00133                                    * (lon=RA, lat=dec) in decimal
00134                                    * radians */ 
00135 }
00136 DetTimeAndASource;
00137     
00138 
00139 /* <lalLaTeX>
00140 \vfill{\footnotesize\input{TimeDelayHV}}
00141 </lalLaTeX> */
00142 
00143 /*
00144  * Function prototypes
00145  */
00146 
00147 /* <lalLaTeX>
00148 \newpage\input{TimeDelayC}
00149 </lalLaTeX> */
00150 
00151 double
00152 XLALArrivalTimeDiff(
00153         const double detector1_earthfixed_xyz_metres[3],
00154         const double detector2_earthfixed_xyz_metres[3],
00155         const double source_right_ascension_radians,
00156         const double source_declination_radians,
00157         const LIGOTimeGPS *gpstime
00158 );
00159 
00160 void
00161 LALTimeDelay( LALStatus                   *status,
00162               REAL8                       *p_delay,
00163               const TwoDetsTimeAndASource *p_two_detectors_time_and_source );
00164 
00165 INT8
00166 XLALLightTravelTime ( const LALDetector *aDet,
00167                       const LALDetector *bDet 
00168                      );
00169 
00170 
00171 REAL8
00172 XLALTimeDelayFromEarthCenter(
00173         const double detector_earthfixed_xyz_metres[3],
00174         double source_right_ascension_radians,
00175         double source_declination_radians,
00176         const LIGOTimeGPS *gpstime
00177 );
00178 
00179 void
00180 LALTimeDelayFromEarthCenter( LALStatus               *status,
00181                              REAL8                   *p_delay,
00182                              const DetTimeAndASource *p_det_time_and_source );
00183 
00184 #ifdef __cplusplus
00185 }
00186 #endif
00187 
00188 #endif /* !defined _TIMEDELAY_H */

Generated on Sat Aug 30 03:13:26 2008 for LAL by  doxygen 1.5.2