DetectorStates.c File Reference

Author:
R. functions to handle DetectorStatesSeries: positions, velocities, detector-tensors of detector as function of time.
More...

#include <math.h>
#include "ComputeFstat.h"
#include "DetectorStates.h"
#include "LISAspecifics.h"

Include dependency graph for DetectorStates.c:

Go to the source code of this file.

Defines

#define __USE_ISOC99   1
#define TRUE   (1==1)
#define FALSE   (1==0)
#define GPS2REAL8(gps)   (1.0 * (gps).gpsSeconds + 1.e-9 * (gps).gpsNanoSeconds )
 convert GPS-time to REAL8
#define MYMAX(x, y)   ( (x) > (y) ? (x) : (y) )
#define MYMIN(x, y)   ( (x) < (y) ? (x) : (y) )

Functions

 NRCSID (DETECTORSTATESC,"$Id: DetectorStates.c,v 1.15 2008/08/01 12:03:19 reinhard Exp $")
int XLALFillDetectorTensor (DetectorState *detState,const LALDetector *detector)
 Function to compute the LWL detector-tensor for the given detector in SSB-fixed cartesian coordinates at time tgps.
void LALGetDetectorStates (LALStatus *status, DetectorStateSeries **DetectorStates, const LIGOTimeGPSVector *timestamps, const LALDetector *detector, const EphemerisData *edat, REAL8 tOffset)
 Get the 'detector state' (ie detector-tensor, position, velocity, etc) for the given vector of timestamps, shifted by a common time-shift tOffset.
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" struct.
int XLALSymmetricTensorProduct3 (SymmTensor3 *vxw, REAL4 v[3], REAL4 w[3])
 Compute the symmetrized tensor product T = v x w + w x v.
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 same tensor-struct as either aT or bT.
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 the same tensor-struct as either aT or bT.
int XLALScaleSymmTensor3 (SymmTensor3 *mult, const SymmTensor3 *aT, REAL4 factor)
 Convenience function for multiplying a SymmTensor3 by a scalar factor.
REAL4 XLALContractSymmTensor3s (const SymmTensor3 *T1, const SymmTensor3 *T2)
 Contract two symmetric tensors over both indices T1 : T2.
void LALGetMultiDetectorStates (LALStatus *status, MultiDetectorStateSeries **mdetStates, const MultiSFTVector *multiSFTs, const EphemerisData *edat)
 Get the detector-time series for the given MultiSFTVector.
void LALCreateDetectorStateSeries (LALStatus *status, DetectorStateSeries **vect, UINT4 length)
 Create a DetectorStateSeries.
void XLALDestroyDetectorStateSeries (DetectorStateSeries *detStates)
void LALDestroyDetectorStateSeries (LALStatus *status, DetectorStateSeries **detStates)
 Destroy a DetectorStateSeries (and set it to NULL).
void XLALDestroyMultiDetectorStateSeries (MultiDetectorStateSeries *mdetStates)
 Helper function to get rid of a multi-IFO DetectorStateSeries Note, this is "NULL-robust" in the sense that it will not crash on NULL-entries anywhere in this struct, so it can be used for failure-cleanup even on incomplete structs.
void LALGetMultiDetectorVelTimePos (LALStatus *status, REAL8VectorSequence **outVel, REAL8VectorSequence **outPos, LIGOTimeGPSVector **outTime, MultiDetectorStateSeries *in)
 Helper funxtion to copy velocity, time and position vectors out of the multi-detector state series.


Detailed Description

Author:
R. functions to handle DetectorStatesSeries: positions, velocities, detector-tensors of detector as function of time.

Prix, John T. Whelan

Definition in file DetectorStates.c.


Define Documentation

#define __USE_ISOC99   1

Definition at line 30 of file DetectorStates.c.

#define TRUE   (1==1)

Definition at line 40 of file DetectorStates.c.

#define FALSE   (1==0)

Definition at line 41 of file DetectorStates.c.

#define GPS2REAL8 ( gps   )     (1.0 * (gps).gpsSeconds + 1.e-9 * (gps).gpsNanoSeconds )

convert GPS-time to REAL8

Definition at line 45 of file DetectorStates.c.

#define MYMAX ( x,
y   )     ( (x) > (y) ? (x) : (y) )

Definition at line 47 of file DetectorStates.c.

#define MYMIN ( x,
y   )     ( (x) < (y) ? (x) : (y) )

Definition at line 48 of file DetectorStates.c.


Function Documentation

NRCSID ( DETECTORSTATESC  ,
"$Id: DetectorStates.  c,
v 1.15 2008/08/01 12:03:19 reinhard Exp $"   
)

int XLALFillDetectorTensor ( DetectorState detState,
const LALDetector detector 
)

Function to compute the LWL detector-tensor for the given detector in SSB-fixed cartesian coordinates at time tgps.

The coordinates used are: EQUATORIAL for Earth-based detectors, but ECLIPTIC for LISA. RETURN: 0 = OK, -1 = ERROR

Parameters:
detState  [out,in]: detector state: fill in detector-tensor
detector  [in]: which detector

Definition at line 188 of file DetectorStates.c.

void LALGetDetectorStates ( LALStatus status,
DetectorStateSeries **  DetectorStates,
const LIGOTimeGPSVector timestamps,
const LALDetector detector,
const EphemerisData edat,
REAL8  tOffset 
)

Get the 'detector state' (ie detector-tensor, position, velocity, etc) for the given vector of timestamps, shifted by a common time-shift tOffset.

This function just calls LALBarycenterEarth() and LALBarycenter() for the given vector of timestamps (shifted by tOffset) and returns the positions, velocities and LMSTs of the detector, stored in a DetectorStateSeries. There is also an entry containing the EarthState at each timestamp, which can be used as input for subsequent calls to LALBarycenter().

tOffset allows one to easily use the midpoints of SFT-timestamps, for example.

Note:
the DetectorStateSeries is allocated here and should be free'ed with LALDestroyDetectorStateSeries().
Parameters:
DetectorStates  [out] series of DetectorStates
timestamps  array of GPS timestamps t_i
detector  detector info
edat  ephemeris file data

Definition at line 79 of file DetectorStates.c.

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" struct.

Definition at line 270 of file DetectorStates.c.

int XLALSymmetricTensorProduct3 ( SymmTensor3 vxw,
REAL4  v[3],
REAL4  w[3] 
)

Compute the symmetrized tensor product T = v x w + w x v.

Definition at line 291 of file DetectorStates.c.

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 same tensor-struct as either aT or bT.

Definition at line 313 of file DetectorStates.c.

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 the same tensor-struct as either aT or bT.

Definition at line 335 of file DetectorStates.c.

int XLALScaleSymmTensor3 ( SymmTensor3 mult,
const SymmTensor3 aT,
REAL4  factor 
)

Convenience function for multiplying a SymmTensor3 by a scalar factor.

NOTE: it *is* safe to have aT and mult point to the same tensor-struct

Definition at line 357 of file DetectorStates.c.

REAL4 XLALContractSymmTensor3s ( const SymmTensor3 T1,
const SymmTensor3 T2 
)

Contract two symmetric tensors over both indices T1 : T2.

Definition at line 378 of file DetectorStates.c.

void LALGetMultiDetectorStates ( LALStatus status,
MultiDetectorStateSeries **  mdetStates,
const MultiSFTVector multiSFTs,
const EphemerisData edat 
)

Get the detector-time series for the given MultiSFTVector.

(see LALGetDetectorStates() for more comments).

Note:
The time-series is based on the midpoints of the SFT-timestamps.
Parameters:
mdetStates  [out] multi-IFO detector-states
multiSFTs  [in] multi-IFO SFTs
edat  ephemeris files data nix nix

Definition at line 405 of file DetectorStates.c.

void LALCreateDetectorStateSeries ( LALStatus status,
DetectorStateSeries **  vect,
UINT4  length 
)

Create a DetectorStateSeries.

Parameters:
vect  output vector
length  number of entries

Definition at line 511 of file DetectorStates.c.

void XLALDestroyDetectorStateSeries ( DetectorStateSeries detStates  ) 

Definition at line 542 of file DetectorStates.c.

void LALDestroyDetectorStateSeries ( LALStatus status,
DetectorStateSeries **  detStates 
)

Destroy a DetectorStateSeries (and set it to NULL).

Parameters:
detStates  pointer to vector to be destroyed

Definition at line 556 of file DetectorStates.c.

void XLALDestroyMultiDetectorStateSeries ( MultiDetectorStateSeries mdetStates  ) 

Helper function to get rid of a multi-IFO DetectorStateSeries Note, this is "NULL-robust" in the sense that it will not crash on NULL-entries anywhere in this struct, so it can be used for failure-cleanup even on incomplete structs.

Definition at line 576 of file DetectorStates.c.

void LALGetMultiDetectorVelTimePos ( LALStatus status,
REAL8VectorSequence **  outVel,
REAL8VectorSequence **  outPos,
LIGOTimeGPSVector **  outTime,
MultiDetectorStateSeries in 
)

Helper funxtion to copy velocity, time and position vectors out of the multi-detector state series.

Definition at line 601 of file DetectorStates.c.


Generated on Tue Oct 14 02:32:46 2008 for LAL by  doxygen 1.5.2