29#include <lal/LALConstants.h>
30#include <lal/LALStdlib.h>
31#include <lal/LALError.h>
32#include <lal/LALGSL.h>
33#include <lal/LIGOMetadataTables.h>
34#include <lal/CoincInspiralEllipsoid.h>
36#include <gsl/gsl_matrix.h>
37#include <gsl/gsl_vector.h>
38#include <gsl/gsl_linalg.h>
73 gsl_matrix *shape = NULL;
92 gsl_matrix_free( shape );
108 gsl_matrix *fisher = NULL;
109 gsl_permutation *
p = NULL;
111 REAL8 freqRatio0 = 0.0;
112 REAL8 freqRatio3 = 0.0;
125 if ( shape->size1 != 3 || shape->size1 != shape->size2 )
128 if ( !
event->Gamma[0] )
142 if ( fisher ) gsl_matrix_free( fisher );
143 if (
p ) gsl_permutation_free(
p );
148 fLow = 5.0 / (256.0 *
event->eta * pow(mtotal, 5.0/3.0) *
event->tau0 );
149 fLow = pow(fLow, 3.0/8.0) /
LAL_PI;
150 freqRatio0 = pow(fLow, 8.0/3.0);
151 freqRatio3 = pow(fLow, 5.0/3.0);
154 gsl_matrix_set( fisher, 0, 0,
event->Gamma[0] );
155 gsl_matrix_set( fisher, 0, 1,
event->Gamma[1]/freqRatio0 );
156 gsl_matrix_set( fisher, 1, 0,
event->Gamma[1]/freqRatio0 );
157 gsl_matrix_set( fisher, 0, 2,
event->Gamma[2]/freqRatio3 );
158 gsl_matrix_set( fisher, 2, 0,
event->Gamma[2]/freqRatio3 );
159 gsl_matrix_set( fisher, 1, 1,
event->Gamma[3]/(freqRatio0*freqRatio0) );
160 gsl_matrix_set( fisher, 1, 2,
event->Gamma[4]/(freqRatio0*freqRatio3) );
161 gsl_matrix_set( fisher, 2, 1,
event->Gamma[4]/(freqRatio0*freqRatio3) );
162 gsl_matrix_set( fisher, 2, 2,
event->Gamma[5]/(freqRatio3*freqRatio3) );
164 XLAL_CALLGSL( gslStatus = gsl_matrix_scale( fisher, 1.0 / eMatch ) );
165 if ( gslStatus != GSL_SUCCESS )
167 gsl_matrix_free( fisher );
168 gsl_permutation_free(
p );
173 XLAL_CALLGSL( gslStatus = gsl_linalg_LU_decomp( fisher,
p, &signum ) );
174 if ( gslStatus == GSL_SUCCESS )
176 XLAL_CALLGSL( gslStatus = gsl_linalg_LU_invert( fisher,
p, shape ) );
179 gsl_matrix_free( fisher );
180 gsl_permutation_free(
p );
182 if ( gslStatus != GSL_SUCCESS )
194 gsl_vector *position = NULL;
197 REAL8 freqRatio0 = 0.0;
198 REAL8 freqRatio3 = 0.0;
213 fLow = 5.0 / (256.0 *
table->eta * pow(mtotal, 5.0/3.0) *
table->tau0 );
214 fLow = pow(fLow, 3.0/8.0) /
LAL_PI;
215 freqRatio0 = pow(fLow, 8.0/3.0);
216 freqRatio3 = pow(fLow, 5.0/3.0);
218 gsl_vector_set( position, 0, endTime );
219 gsl_vector_set( position, 1, freqRatio0*
table->tau0 );
220 gsl_vector_set( position, 2, freqRatio3*
table->tau3 );
235 gsl_vector_set( position, 0, timeShift );
#define XLAL_CALLGSL(statement)
int XLALSetErrorMatrixFromSnglInspiral(gsl_matrix *shape, SnglInspiralTable *event, REAL8 eMatch)
int XLALSetTimeInPositionVector(gsl_vector *position, REAL8 timeShift)
gsl_matrix * XLALGetErrorMatrixFromSnglInspiral(SnglInspiralTable *event, REAL8 eMatch)
gsl_vector * XLALGetPositionFromSnglInspiral(SnglInspiralTable *table)
#define XLAL_ERROR_NULL(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1