33 #include <lal/LISAspecifics.h>
34 #include <lal/LALError.h>
35 #include <lal/SinCosLUT.h>
43 #define SCALAR(u,v) ((u)[0]*(v)[0] + (u)[1]*(v)[1] + (u)[2]*(v)[2])
44 #define SQ(x) ( (x) * (x) )
45 #define GPS2REAL8(gps) (1.0 * (gps).gpsSeconds + 1.e-9 * (gps).gpsNanoSeconds )
46 #define LAL_SQRT1_3 0.5773502691896257645091487805019575
67 return ( det != NULL ) && ( strncmp( det->
frDetector.
name,
"LISA TDI ", 9 ) == 0 );
78 for (
CHAR channelNum =
'1'; channelNum <=
'9'; ++channelNum ) {
81 switch ( channelNum ) {
83 strcpy( Detector1.frDetector.name,
"LISA TDI X" );
86 strcpy( Detector1.frDetector.name,
"LISA TDI Y" );
89 strcpy( Detector1.frDetector.name,
"LISA TDI Z" );
92 strcpy( Detector1.frDetector.name,
"LISA TDI Y-Z" );
95 strcpy( Detector1.frDetector.name,
"LISA TDI Z-X" );
98 strcpy( Detector1.frDetector.name,
"LISA TDI X-Y" );
101 strcpy( Detector1.frDetector.name,
"LISA TDI A" );
104 strcpy( Detector1.frDetector.name,
"LISA TDI E" );
107 strcpy( Detector1.frDetector.name,
"LISA TDI T" );
110 XLAL_ERROR(
XLAL_EINVAL,
"Illegal LISA TDI index '%c': must be one of {'1', '2', '3', '4', '5', '6', '7', '8', '9'}.\n\n", channelNum );
114 Detector1.frDetector.prefix[0] = prefixLetter;
115 Detector1.frDetector.prefix[1] = channelNum;
118 Detector1.frDetector.vertexLongitudeRadians = 0;
119 Detector1.frDetector.vertexLatitudeRadians = 0;
120 Detector1.frDetector.vertexElevation = 0;
121 Detector1.frDetector.xArmAltitudeRadians = 0;
122 Detector1.frDetector.xArmAzimuthRadians = 0;
123 Detector1.frDetector.yArmAltitudeRadians = 0;
124 Detector1.frDetector.yArmAzimuthRadians = 0;
131 Detector1.location[0] = 1;
132 Detector1.location[1] = 1;
133 Detector1.location[2] = 1;
154 enum { SC1 = 0, SC2, SC3 };
155 enum { I1 = 0, I2, I3 };
157 UINT4 send_l[3] = { SC3, SC1, SC2 };
158 UINT4 rec_l [3] = { SC2, SC3, SC1 };
169 REAL4 kappa = 0, lambda = 0;
170 REAL4 sin_alpha, cos_alpha;
177 alpha_t = Om * tGPS + kappa;
180 for (
i = 0;
i < 3;
i ++ ) {
182 REAL4 sin_beta, cos_beta;
185 x[
i] = detState->
earthState.
posNow[0] + ae * ( sin_alpha * cos_alpha * sin_beta - ( 1.0f +
SQ( sin_alpha ) ) * cos_beta );
186 y[
i] = detState->
earthState.
posNow[1] + ae * ( sin_alpha * cos_alpha * cos_beta - ( 1.0f +
SQ( cos_alpha ) ) * sin_beta );
187 z[
i] = detState->
earthState.
posNow[2] - sqrt( 3.0f ) * ae * ( cos_alpha * cos_beta + sin_alpha * sin_beta );
192 for ( arm = 0; arm < 3; arm ++ ) {
201 n[0] =
x[rec] -
x[send];
202 n[1] =
y[rec] -
y[send];
203 n[2] = z[rec] - z[send];
207 detState->
detArms[arm].armlength_c = L_c;
249 switch ( channelNum ) {
280 XLALPrintError(
"\nInvalid channel-number '%c' for LISA \n\n", channelNum );
291 REAL8 weight1, weight2, weight3;
295 XLALPrintError(
"\nXLALgetLISADetectorTensorLWL() failed !\n\n" );
300 XLALPrintError(
"\nXLALgetLISADetectorTensorLWL() failed !\n\n" );
305 XLALPrintError(
"\nXLALgetLISADetectorTensorLWL() failed !\n\n" );
309 switch ( channelNum ) {
311 weight1 = ( 2.0 / 3.0 );
312 weight2 = ( -1.0 / 3.0 );
313 weight3 = ( -1.0 / 3.0 );
328 XLALPrintError(
"\nInvalid channel-number '%c' for LISA \n\n", channelNum );
364 XLALPrintError(
"\nXLALgetLISADetectorTensorLWL() failed !\n\n" );
369 XLALPrintError(
"\nXLALgetLISADetectorTensorLWL() failed !\n\n" );
408 switch ( channelNum ) {
439 XLALPrintError(
"\nInvalid channel-number '%c' for LISA \n\n", channelNum );
448 &( detArms[armB] ), freq_skypos )
455 REAL8 weight1, weight2, weight3;
459 freq_skypos ) != 0 ) {
460 XLALPrintError(
"\nXLALgetLISADetectorTensorRAA() failed !\n\n" );
465 freq_skypos ) != 0 ) {
466 XLALPrintError(
"\nXLALgetLISADetectorTensorRAA() failed !\n\n" );
471 freq_skypos ) != 0 ) {
472 XLALPrintError(
"\nXLALgetLISADetectorTensorRAA() failed !\n\n" );
476 switch ( channelNum ) {
478 weight1 = ( 2.0 / 3.0 );
479 weight2 = ( -1.0 / 3.0 );
480 weight3 = ( -1.0 / 3.0 );
495 XLALPrintError(
"\nInvalid channel-number '%c' for LISA \n\n", channelNum );
556 XLALPrintError(
"\nXLALgetLISADetectorTensorRAA() failed !\n\n" );
561 XLALPrintError(
"\nXLALgetLISADetectorTensorRAA() failed !\n\n" );
593 REAL4 pifL_3c = pifL_c / 3.0f;
594 REAL4 kdotnA, kdotnB;
599 if ( !detT || !detArmA || !detArmB || !freq_skypos ) {
611 eta = pifL_c * ( 1.0f + kdotnA );
614 coeffAA =
crectf( 0.25f * cospha * sinc_eta, 0.25f * sinpha * sinc_eta );
619 eta = pifL_c * ( 1.0f - kdotnA );
622 coeffAA +=
crectf( 0.25f * cospha * sinc_eta, 0.25f * sinpha * sinc_eta );
629 eta = pifL_c * ( 1.0f - kdotnB );
632 coeffBB =
crectf( 0.25f * cospha * sinc_eta, 0.25f * sinpha * sinc_eta );
637 eta = pifL_c * ( 1.0f + kdotnB );
640 coeffBB +=
crectf( 0.25f * cospha * sinc_eta, 0.25f * sinpha * sinc_eta );
660 #define SINC_SAFETY 1e-5
int XLALregisterLISAdetectors(const CHAR prefixLetter)
Set up the LALDetector structs representing LISA X, Y, Z TDI observables.
int XLALgetLISAtwoArmRAAIFO(CmplxDetectorTensor *detT, const DetectorArm *armA, const DetectorArm *armB, const FreqSkypos_t *freq_skypos)
return a rigid-adiabatic-approximation (RAA) two-arm IFO detector tensor for LISA,...
static REAL4 safe_sinc(REAL4 x)
Unnormalized sinc(x) = sin(x) / x.
int XLALprecomputeLISAarms(DetectorState *detState)
Precompute the arm-geometry for LISA, which is later used for assembling the RAA detector-tensor (whi...
int XLALgetLISADetectorTensorRAA(CmplxDetectorTensor *detT, const Detector3Arms detArms, CHAR channelNum, const FreqSkypos_t *freq_skypos)
#define LAL_SQRT1_3
1/sqrt(3)
BOOLEAN XLALisLISAdetector(const LALDetector *det)
Return true if 'det' is a LISA LALDetector struct.
#define SCALAR(u, v)
Simple Euklidean scalar product for two 3-dim vectors in cartesian coords.
int XLALgetLISADetectorTensorLWL(SymmTensor3 *detT, const Detector3Arms detArms, CHAR channelNum)
LISAarmT
Translate TDI arm indices to C-indexing.
int XLALTensorSquareVector3(SymmTensor3 *vxv, REAL4 v[3])
Compute the "squared-tensor" v x v for given vector v, the result is returned in a "detectorTensor" s...
int XLALAddSymmTensor3s(SymmTensor3 *sum, const SymmTensor3 *aT, const SymmTensor3 *bT)
Convenience function for adding two SymmTensor3s: aT + bT NOTE: it is safe to have sum point to the s...
int XLALSubtractSymmTensor3s(SymmTensor3 *diff, const SymmTensor3 *aT, const SymmTensor3 *bT)
Convenience function for subtracting two SymmTensor3s: aT - bT NOTE: it is safe to have diff point to...
int XLALScaleSymmTensor3(SymmTensor3 *mult, const SymmTensor3 *aT, REAL4 factor)
Convenience function for multiplying a SymmTensor3 by a scalar factor.
DetectorArm Detector3Arms[3]
used to allow functions some type/size checking
#define XLAL_INIT_DECL(var,...)
int XLALRegisterSpecialCWDetector(const LALDetector *specialDetector)
Register a special detector for use with CW codes.
int XLALSinCosLUT(REAL4 *sinx, REAL4 *cosx, REAL8 x)
Calculate sin(x) and cos(x) to roughly 1e-7 precision using a lookup-table and Taylor-expansion.
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
The 'detector tensor' for a GW-detector: symmetric 3x3 matrix, storing only the upper triangle.
SymmTensor3 re
tensor holding real-parts of all components
SymmTensor3 im
tensor holding imaginary-parts of all components
Struct containing pre-computed quantites describing a single detector arm: unit-vector along detector...
SymmTensor3 basisT
arm "basis-tensor" (n x n)
REAL4 n[3]
unit vector pointing along this arm
REAL4 armlength_c
armlengths in seconds L / c
State-info about position, velocity and LMST of a detector together with corresponding EarthState.
EarthState earthState
EarthState information.
Detector3Arms detArms
include up to three arms to allow describing LISA
LIGOTimeGPS tGPS
GPS timestamps corresponding to this entry.
REAL8 posNow[3]
Cartesian coords of Earth's center at tgps, extrapolated from JPL DE405 ephemeris; units= sec.
Convenience container for precomputed pi f L/c and skyposition vector.
REAL8 skyposV[3]
unit vector pointing to skyposition of source
REAL4 Freq
signal frequency
A symmetric 3x3 tensor (such as detector-tensors), storing only the upper triangle.