UniversalDopplerMetric.c File Reference

Author:
Reinhard Prix Function to compute the full F-statistic metric, including antenna-pattern functions from multi-detector, as derived in Prix07.
More...

#include <math.h>
#include <gsl/gsl_block.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_integration.h>
#include <lal/FlatPulsarMetric.h>
#include <lal/PulsarTimes.h>
#include <lal/ComputeFstat.h>
#include <lal/XLALGSL.h>
#include <lal/UniversalDopplerMetric.h>

Include dependency graph for UniversalDopplerMetric.c:

Go to the source code of this file.

Data Structures

struct  intparams_t
 parameters for metric-integration More...

Defines

#define IN_UNIVERSALDOPPLERMETRICC
#define TRUE   (1==1)
#define FALSE   (0==1)
#define COPY_VECT(dst, src)   do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0)
 copy 3 components of Euklidean vector
#define SCALAR(u, v)   ((u)[0]*(v)[0] + (u)[1]*(v)[1] + (u)[2]*(v)[2])
 Simple Euklidean scalar product for two 3-dim vectors in cartesian coords.
#define SQUARE(x)   ((x) * (x))
#define GPS2REAL8(gps)   (1.0 * (gps).gpsSeconds + 1.e-9 * (gps).gpsNanoSeconds )
 convert GPS-time to REAL8
#define MYMAX(a, b)   ( (a) > (b) ? (a) : (b) )
#define HEADER   "Doppler-coordinate names and explanations:\n--------------------------------------------------\n"

Enumerations

enum  AM_comp_t { AMCOMP_NONE = -1, AMCOMP_A = 0, AMCOMP_B, AMCOMP_LAST }
 components of antenna-pattern function: q_l = {a(t), b(t)} More...

Functions

 NRCSID (UNIVERSALDOPPLERMETRICC,"$Id: UniversalDopplerMetric.c,v 1.2 2008/04/30 18:53:06 kipp Exp $")
double CW_am1_am2_Phi_i_Phi_j (double tt, void *params)
 For gsl-integration: general quadruple product between two antenna-pattern functions am1, am2 in {a(t),b(t)} and two phase-derivatives phi_i * phi_j, i.e.
double XLALAverage_am1_am2_Phi_i_Phi_j (const intparams_t *params)
 Integrate a general quadruple product CW_am1_am2_Phi_i_Phi_j() from 0 to 1.
double CWPhaseDeriv_i (double tt, void *params)
 Partial derivative of continuous-wave (CW) phase, with respect to Doppler coordinate 'i' := intparams_t->phderiv.
double CWPhase_cov_Phi_ij (const intparams_t *params)
 Compute a pure phase-deriv covariance [phi_i, phi_j] = <phi_i phi_j>=""> - <phi_i><phi_j> which gives a component of the "phase metric".
int XLALPtolemaicPosVel (PosVel3D_t *posvel,const LIGOTimeGPS *tGPS)
 Compute position and velocity assuming a purely "Ptolemaic" orbital motion (i.e.
int XLALDetectorPosVel (PosVel3D_t *posvel, const LIGOTimeGPS *tGPS, const LALDetector *site, const EphemerisData *edat, DetectorMotionType special)
 Given a GPS time and detector, return the current position (and velocity) of the detector.
DopplerMetricXLALDopplerPhaseMetric (const LALStringVector *coords, DetectorMotionType detMotionType, const PulsarDopplerParams *dopplerPoint, LIGOTimeGPS startTime, REAL8 Tspan, const EphemerisData *edat, const CHAR *detName)
 Calculate an approximate "phase-metric" with the specified parameters.
DopplerMetricXLALDopplerFstatMetric (const LALStringVector *coords, DetectorMotionType detMotionType, const PulsarDopplerParams *dopplerPoint, LIGOTimeGPS startTime, REAL8 Tspan, const EphemerisData *edat, const MultiDetectorInfo *detInfo, REAL8 cosi, REAL8 psi)
 Calculate the full (multi-IFO) Fstat-metric derived in Prix07.
DopplerMetricXLALCreateDopplerMetric (UINT4 dim, BOOLEAN fullFmetric)
 Allocate an empty DopplerMetric container for 'dim' dimensions, allocating the matrices Fav_ij, m1_ij, m2_ij, m3_ij ONLY if fullFmetric==TRUE.
void XLALDestroyDopplerMetric (DopplerMetric *metric)
 Free a DopplerMetric structure.
DetectorMotionType XLALParseDetectorMotionString (const CHAR *detMotionString)
 Parse a detector-motion type string into the corresponding enum-number,.
const CHARXLALDetectorMotionName (DetectorMotionType detType)
 Provide a pointer to a static string containing the DopplerCoordinate-name cooresponding to the enum DopplerCoordinateID.
DopplerCoordinateID XLALParseDopplerCoordinateString (const CHAR *coordName)
 Parse a DopplerCoordinate-name into the corresponding DopplerCoordinateID.
int XLALDopplerCoordinateNames2System (DopplerCoordinateSystem *coordSys, const LALStringVector *coordNames)
 Given a LALStringVector of coordinate-names, parse them into a 'DopplerCoordinateSystem', namely a list of coordinate-IDs.
const CHARXLALDopplerCoordinateName (DopplerCoordinateID coordID)
 Provide a pointer to a static string containing the DopplerCoordinate-name cooresponding to the enum DopplerCoordinateID.
const CHARXLALDopplerCoordinateHelp (DopplerCoordinateID coordID)
 Provide a pointer to a static string containing the a descriptive 'help-string' describing the coordinate DopplerCoordinateID.
const CHARXLALDopplerCoordinateHelpAll (void)
 Return a string (allocated here) containing a full name - helpstring listing for all doppler-coordinates DopplerCoordinateID allowed by UniversalDopplerMetric.c.
int XLALParseMultiDetectorInfo (MultiDetectorInfo *detInfo, const LALStringVector *detNames, const LALStringVector *detWeights)
 Parse string-vectors (typically input by user) of detector-names and relative noise-weights, and return a MultiDetectorInfo struct.

Variables

DopplerMetricParams empty_DopplerMetricParams
DopplerCoordinateSystem empty_DopplerCoordinateSystem
MultiDetectorInfo empty_MultiDetectorInfo


Detailed Description

Author:
Reinhard Prix Function to compute the full F-statistic metric, including antenna-pattern functions from multi-detector, as derived in Prix07.

Revision:

Id
UniversalDopplerMetric.c,v 1.2 2008/04/30 18:53:06 kipp Exp

Definition in file UniversalDopplerMetric.c.


Define Documentation

#define IN_UNIVERSALDOPPLERMETRICC

Definition at line 48 of file UniversalDopplerMetric.c.

#define TRUE   (1==1)

Definition at line 52 of file UniversalDopplerMetric.c.

#define FALSE   (0==1)

Definition at line 53 of file UniversalDopplerMetric.c.

#define COPY_VECT ( dst,
src   )     do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0)

copy 3 components of Euklidean vector

Definition at line 56 of file UniversalDopplerMetric.c.

#define SCALAR ( u,
v   )     ((u)[0]*(v)[0] + (u)[1]*(v)[1] + (u)[2]*(v)[2])

Simple Euklidean scalar product for two 3-dim vectors in cartesian coords.

Definition at line 59 of file UniversalDopplerMetric.c.

#define SQUARE ( x   )     ((x) * (x))

Definition at line 61 of file UniversalDopplerMetric.c.

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

convert GPS-time to REAL8

Definition at line 64 of file UniversalDopplerMetric.c.

#define MYMAX ( a,
 )     ( (a) > (b) ? (a) : (b) )

Definition at line 66 of file UniversalDopplerMetric.c.

#define HEADER   "Doppler-coordinate names and explanations:\n--------------------------------------------------\n"


Enumeration Type Documentation

enum AM_comp_t

components of antenna-pattern function: q_l = {a(t), b(t)}

Enumerator:
AMCOMP_NONE  no antenna pattern function: (equivalent "a = 1")
AMCOMP_A  a(t)
AMCOMP_B  b(t)
AMCOMP_LAST 

Definition at line 73 of file UniversalDopplerMetric.c.


Function Documentation

NRCSID ( UNIVERSALDOPPLERMETRICC  ,
"$Id: UniversalDopplerMetric.  c,
v 1.2 2008/04/30 18:53:06 kipp Exp $"   
)

double CW_am1_am2_Phi_i_Phi_j ( double  tt,
void *  params 
)

For gsl-integration: general quadruple product between two antenna-pattern functions am1, am2 in {a(t),b(t)} and two phase-derivatives phi_i * phi_j, i.e.

compute an expression of the form $q_1(t) q_2(t) \phi_i(t) \phi_j(t)$, where $q_i = \{a(t), b(t)\}$.

NOTE: this can be 'truncated' to any sub-expression by using AMCOMP_NONE for antenna-pattern component and DOPPLERCOORD_NONE for DopplerCoordinate, eg in this way this function can be used to compute $a^2(t), b^2(t), a(t) b(t)$, or $phi_i(t) phi_j(t)$.

Definition at line 172 of file UniversalDopplerMetric.c.

double XLALAverage_am1_am2_Phi_i_Phi_j ( const intparams_t params  ) 

Integrate a general quadruple product CW_am1_am2_Phi_i_Phi_j() from 0 to 1.

This implements the expression $\langle<q_1 q_2 \phi_i \phi_j\rangle$ for single-IFO average over the observation time.

The input parameters correspond to CW_am1_am2_Phi_i_Phi_j()

Definition at line 129 of file UniversalDopplerMetric.c.

double CWPhaseDeriv_i ( double  tt,
void *  params 
)

Partial derivative of continuous-wave (CW) phase, with respect to Doppler coordinate 'i' := intparams_t->phderiv.

Time is in 'natural units' of Tspan, i.e. tt is in [0, 1] corresponding to GPS-times in [startTime, startTime + Tspan ]

Definition at line 250 of file UniversalDopplerMetric.c.

double CWPhase_cov_Phi_ij ( const intparams_t params  ) 

Compute a pure phase-deriv covariance [phi_i, phi_j] = <phi_i phi_j>=""> - <phi_i><phi_j> which gives a component of the "phase metric".

Definition at line 533 of file UniversalDopplerMetric.c.

int XLALPtolemaicPosVel ( PosVel3D_t posvel,
const LIGOTimeGPS tGPS 
)

Compute position and velocity assuming a purely "Ptolemaic" orbital motion (i.e.

on a circle) around the sun, approximating Earth's orbit

Parameters:
posvel  [out] instantaneous position and velocity vector
tGPS  [in] GPS time

Definition at line 482 of file UniversalDopplerMetric.c.

int XLALDetectorPosVel ( PosVel3D_t posvel,
const LIGOTimeGPS tGPS,
const LALDetector site,
const EphemerisData edat,
DetectorMotionType  special 
)

Given a GPS time and detector, return the current position (and velocity) of the detector.

NOTE: the 'special' flag allows to simulate artifically truncated detector motions, such as pure orbital motion.

Parameters:
posvel  [out] instantaneous position and velocity vector
tGPS  [in] GPS time
site  [in] detector info
edat  [in] ephemeris data
special  [in] 'special' flag: 0 = full motion, 1 = pure orbital, 2 = pure spin

Definition at line 364 of file UniversalDopplerMetric.c.

DopplerMetric* XLALDopplerPhaseMetric ( const LALStringVector coords,
DetectorMotionType  detMotionType,
const PulsarDopplerParams dopplerPoint,
LIGOTimeGPS  startTime,
REAL8  Tspan,
const EphemerisData edat,
const CHAR detName 
)

Calculate an approximate "phase-metric" with the specified parameters.

The phase metric can only be computed for a single detector, if you want a multi-detector metric you need to use the full Fstat-metric, as computed by XLALDopplerFstatMetric().

Note: The returned DopplerMetric does not set the matrices Fav_ij, or m1_ij, m2_ij, m3_ij.

Note: Reference time is always assumed to be equal to the startTime !

Return NULL on error.

Parameters:
coords  names of Doppler-coordinates to compute metric in
detMotionType  type of detector-motion: full spin+orbit, pure orbital, Ptole, ...
dopplerPoint  doppler-point to compute metric for
startTime  startTime of the observation
Tspan  total spanned duration of the observation
edat  ephemeris data
detName  detector name 'H1', 'L1', ...

Definition at line 604 of file UniversalDopplerMetric.c.

DopplerMetric* XLALDopplerFstatMetric ( const LALStringVector coords,
DetectorMotionType  detMotionType,
const PulsarDopplerParams dopplerPoint,
LIGOTimeGPS  startTime,
REAL8  Tspan,
const EphemerisData edat,
const MultiDetectorInfo detInfo,
REAL8  cosi,
REAL8  psi 
)

Calculate the full (multi-IFO) Fstat-metric derived in Prix07.

Note: The returned DopplerMetric does set the matrices Fav_ij, and m1_ij, m2_ij, m3_ij.

Note: Reference time is always assumed to be equal to the startTime !

Return NULL on error.

Parameters:
coords  names of Doppler-coordinates to compute metric in
detMotionType  type of detector-motion: full spin+orbit, pure orbital, Ptole, ...
dopplerPoint  doppler-point to compute metric for
startTime  startTime of the observation
Tspan  total spanned duration of the observation
edat  ephemeris data
detInfo  detector specifications and noise-weights
cosi  amplitude-parameters: cos(iota)
psi  amplitude-parameters: polarization angle psi

Definition at line 707 of file UniversalDopplerMetric.c.

DopplerMetric* XLALCreateDopplerMetric ( UINT4  dim,
BOOLEAN  fullFmetric 
)

Allocate an empty DopplerMetric container for 'dim' dimensions, allocating the matrices Fav_ij, m1_ij, m2_ij, m3_ij ONLY if fullFmetric==TRUE.

Definition at line 983 of file UniversalDopplerMetric.c.

void XLALDestroyDopplerMetric ( DopplerMetric metric  ) 

Free a DopplerMetric structure.

Definition at line 1023 of file UniversalDopplerMetric.c.

DetectorMotionType XLALParseDetectorMotionString ( const CHAR detMotionString  ) 

Parse a detector-motion type string into the corresponding enum-number,.

Definition at line 1043 of file UniversalDopplerMetric.c.

const CHAR* XLALDetectorMotionName ( DetectorMotionType  detType  ) 

Provide a pointer to a static string containing the DopplerCoordinate-name cooresponding to the enum DopplerCoordinateID.

Definition at line 1069 of file UniversalDopplerMetric.c.

DopplerCoordinateID XLALParseDopplerCoordinateString ( const CHAR coordName  ) 

Parse a DopplerCoordinate-name into the corresponding DopplerCoordinateID.

Definition at line 1087 of file UniversalDopplerMetric.c.

int XLALDopplerCoordinateNames2System ( DopplerCoordinateSystem coordSys,
const LALStringVector coordNames 
)

Given a LALStringVector of coordinate-names, parse them into a 'DopplerCoordinateSystem', namely a list of coordinate-IDs.

Parameters:
coordSys  [out] pointer to coord-system struct
coordNames  [in] list of coordinate names

Definition at line 1111 of file UniversalDopplerMetric.c.

const CHAR* XLALDopplerCoordinateName ( DopplerCoordinateID  coordID  ) 

Provide a pointer to a static string containing the DopplerCoordinate-name cooresponding to the enum DopplerCoordinateID.

Definition at line 1139 of file UniversalDopplerMetric.c.

const CHAR* XLALDopplerCoordinateHelp ( DopplerCoordinateID  coordID  ) 

Provide a pointer to a static string containing the a descriptive 'help-string' describing the coordinate DopplerCoordinateID.

Definition at line 1157 of file UniversalDopplerMetric.c.

const CHAR* XLALDopplerCoordinateHelpAll ( void   ) 

Return a string (allocated here) containing a full name - helpstring listing for all doppler-coordinates DopplerCoordinateID allowed by UniversalDopplerMetric.c.

Definition at line 1174 of file UniversalDopplerMetric.c.

int XLALParseMultiDetectorInfo ( MultiDetectorInfo detInfo,
const LALStringVector detNames,
const LALStringVector detWeights 
)

Parse string-vectors (typically input by user) of detector-names and relative noise-weights, and return a MultiDetectorInfo struct.

NOTE: you can pass detWeights == NULL, corresponding to equal-sensitivity detectors, ie. all noise-weights equal.

NOTE: the input noise-weights dont have to be normalized, but the returned noise-weights will be properly normalized, i.e. $\sum_{i=1}^N w_i = 1$.

Return 0 == OK, nonzero == ERROR

Parameters:
detNames  [out] parsed detector-info struct [in] list of detector names
detWeights  [in] list of (strings) with detector weights (NULL if all 1)

Definition at line 1238 of file UniversalDopplerMetric.c.


Variable Documentation

DopplerMetricParams empty_DopplerMetricParams

Definition at line 101 of file UniversalDopplerMetric.c.

DopplerCoordinateSystem empty_DopplerCoordinateSystem

Definition at line 102 of file UniversalDopplerMetric.c.

MultiDetectorInfo empty_MultiDetectorInfo

Definition at line 103 of file UniversalDopplerMetric.c.


Generated on Sun Oct 12 02:33:33 2008 for LAL by  doxygen 1.5.2