DetectorStates.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Reinhard Prix
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  * \author Reinhard Prix
00022  * \date 2005
00023  * \file
00024  * \ingroup pulsar
00025  * \brief API for the DetectorStates.c functions.
00026  *
00027  * $Id: DetectorStates.h,v 1.11 2008/06/06 08:28:41 whelan Exp $
00028  *
00029  */
00030 
00031 #ifndef _DETECTORSTATES_H  /* Double-include protection. */
00032 #define _DETECTORSTATES_H
00033 
00034 /* C++ protection. */
00035 #ifdef  __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 #include <lal/LALRCSID.h>
00040 NRCSID( DETECTORSTATESH, "$Id: DetectorStates.h,v 1.11 2008/06/06 08:28:41 whelan Exp $" );
00041 
00042 /*---------- exported INCLUDES ----------*/
00043 #include <lal/LALComputeAM.h>
00044 #include <lal/PulsarDataTypes.h>
00045 #include <lal/SeqFactories.h>
00046 
00047 /*---------- exported DEFINES ----------*/
00048 
00049 /*----- Error-codes -----*/
00050 #define DETECTORSTATES_ENULL            1
00051 #define DETECTORSTATES_ENONULL          2
00052 #define DETECTORSTATES_EINPUT           3
00053 #define DETECTORSTATES_EMEM             4
00054 #define DETECTORSTATES_EXLAL            5
00055 #define DETECTORSTATES_EIEEE            6
00056 
00057 #define DETECTORSTATES_MSGENULL         "Arguments contained an unexpected null pointer"
00058 #define DETECTORSTATES_MSGENONULL       "Output pointer is non-NULL"
00059 #define DETECTORSTATES_MSGEINPUT        "Invalid input"
00060 #define DETECTORSTATES_MSGEMEM          "Out of memory. Bad."
00061 #define DETECTORSTATES_MSGEXLAL         "XLAL function call failed"
00062 #define DETECTORSTATES_MSGEIEEE         "Floating point failure"
00063 
00064 /*---------- exported types ----------*/
00065 
00066 /** A symmetric 3x3 tensor (such as detector-tensors), storing only the upper triangle.
00067  */
00068 typedef struct
00069 {
00070   REAL4 d11;   REAL4 d12;   REAL4 d13;
00071                REAL4 d22;   REAL4 d23;
00072                             REAL4 d33;
00073 } SymmTensor3;
00074 
00075 /** Struct containing pre-computed quantites describing a
00076  * single detector arm: unit-vector along detector-arm, arm-length,
00077  * and arm "basis-tensor" n x n. This is used to speed up the
00078  * computation of LISA detector tensors in the rigid-adiabatic approximation.
00079  */
00080 typedef struct
00081 {
00082   REAL4 n[3];                   /**< unit vector pointing along this arm */
00083   SymmTensor3 basisT;           /**< arm "basis-tensor" (n x n) */
00084   REAL4 armlength_c;            /**< armlengths in seconds L / c */
00085 } DetectorArm;
00086 
00087 typedef DetectorArm Detector3Arms[3];   /**< used to allow functions some type/size checking */
00088 
00089 /* ----- Output types for LALGetDetectorStates() */
00090 /** State-info about position, velocity and LMST of a detector together
00091  * with corresponding EarthState.
00092  */
00093 typedef struct
00094 {
00095   LIGOTimeGPS tGPS;             /**< GPS timestamps corresponding to this entry */
00096   REAL8 rDetector[3];           /**< Cartesian coords of detector position in ICRS J2000. Units=sec */
00097   REAL8 vDetector[3];           /**< Cart. coords. of detector velocity, in dimensionless units (v/c)*/
00098   REAL8 LMST;                   /**< local mean sidereal time at the detector-location in radians */
00099   EarthState earthState;        /**< EarthState information */
00100   Detector3Arms detArms;        /**< include up to three arms to allow describing LISA */
00101   SymmTensor3 detT;             /**< Detector-tensor components in SSB-fixed, Cartesian coordinates */
00102 } DetectorState;
00103 
00104 
00105 /** Timeseries of DetectorState's, representing the detector-info at different timestamps.
00106  * In addition to the standard 'vector'-fields we also store the detector-info in here.
00107  */
00108 typedef struct
00109 {
00110   UINT4 length;                 /**< total number of entries */
00111   DetectorState *data;          /**< array of DetectorState entries */
00112   LALDetector detector;         /**< detector-info corresponding to this timeseries */
00113   CoordinateSystem system;      /**< The coordinate system used for detector's position/velocity and detector-tensor */
00114 } DetectorStateSeries;
00115 
00116 /** Multi-IFO time-series of DetectorStates */
00117 typedef struct
00118 {
00119   UINT4 length;                 /**< number of detectors */
00120   DetectorStateSeries **data;   /**< vector of pointers to DetectorStateSeries */
00121   LIGOTimeGPS startTime;        /**< (earliest) startTime of the observation */
00122   REAL8 Tspan;                  /**< total spanned duration of the observation */
00123 } MultiDetectorStateSeries;
00124 
00125 /*---------- exported Global variables ----------*/
00126 
00127 /*---------- exported prototypes [API] ----------*/
00128 void
00129 LALGetDetectorStates (LALStatus *,
00130                       DetectorStateSeries **DetectorStates,
00131                       const LIGOTimeGPSVector *timestamps,
00132                       const LALDetector *detector,
00133                       const EphemerisData *edat,
00134                       REAL8 tOffset);
00135 
00136 void
00137 LALGetMultiDetectorStates( LALStatus *,
00138                            MultiDetectorStateSeries **mdetStates,
00139                            const MultiSFTVector *multiSFTs,
00140                            const EphemerisData *edat );
00141 
00142 void LALCreateDetectorStateSeries (LALStatus *, DetectorStateSeries **vect, UINT4 length );
00143 
00144 int XLALAddSymmTensor3s ( SymmTensor3 *sum, const SymmTensor3 *aT, const SymmTensor3 *bT );
00145 int XLALSubtractSymmTensor3s ( SymmTensor3 *diff, const SymmTensor3 *aT, const SymmTensor3 *bT );
00146 int XLALScaleSymmTensor3   ( SymmTensor3 *mult, const SymmTensor3 *aT, REAL4 factor );
00147 int XLALTensorSquareVector3 ( SymmTensor3 *vxv, REAL4 v[3] );
00148 int XLALSymmetricTensorProduct3 ( SymmTensor3 *vxw, REAL4 v[3], REAL4 w[3] );
00149 REAL4 XLALContractSymmTensor3s ( const SymmTensor3 *T1, const SymmTensor3 *T2 );
00150 
00151 
00152 /* destructors */
00153 void XLALDestroyDetectorStateSeries ( DetectorStateSeries *detStates );
00154 void LALDestroyDetectorStateSeries(LALStatus *, DetectorStateSeries **vect );
00155 void XLALDestroyMultiDetectorStateSeries ( MultiDetectorStateSeries *mdetStates );
00156 
00157 
00158 /* helpers */
00159 
00160 void LALGetMultiDetectorVelTimePos(LALStatus                *status,
00161                                    REAL8VectorSequence      **outVel,
00162                                    REAL8VectorSequence      **outPos,
00163                                    LIGOTimeGPSVector        **outTime,
00164                                    MultiDetectorStateSeries *in);
00165 
00166 #ifdef  __cplusplus
00167 }
00168 #endif
00169 /* C++ protection. */
00170 
00171 #endif  /* Double-include protection. */

Generated on Fri Sep 5 03:06:44 2008 for LAL by  doxygen 1.5.2