20 #include <lal/CoherentEstimation.h>
21 #include <lal/DetResponse.h>
22 #include <lal/TimeDelay.h>
23 #include <lal/AVFactories.h>
29 #define Cosh(x) cosh(x)
30 #define ACosh(x) acosh(x)
35 static INT4 jacobi(
float **
a,
int n,
float d[],
float **v,
int *nrot);
66 REAL8 maxLambda, tmpLambda;
207 pGPS.
p_gps ), stat );
231 tDelays[i] -= mDelay;
294 if(tmpLambda > maxLambda) {
298 maxLambda = tmpLambda;
309 if(tDelays[i] < 0.0) {
311 iPad = (
INT4)floor(-tDelays[i]/
output->deltaT);
318 p1 = ceil(tDelays[i] /
output->deltaT) - tDelays[i] /
output->deltaT;
329 p1 = ceil(tDelays[i] /
output->deltaT) - tDelays[i] /
output->deltaT;
339 output->data->data[j] +=
y * alpha[i];
442 #define ROTATE(a,i,j,k,l) g=a[i][j];h=a[k][l];a[i][j]=g-s*(h+g*tau);\
443 a[k][l]=h+s*(g-h*tau);
445 int jacobi(
float **
a,
int n,
float d[],
float **v,
int *nrot)
448 float tresh,theta,tau,t,sm,s,h,g,c,*b,*z;
471 for (ip=1;ip<=n;ip++) {
472 for (iq=1;iq<=n;iq++) v[ip][iq]=0.0;
475 for (ip=1;ip<=n;ip++) {
476 b[ip]=d[ip]=
a[ip][ip];
480 for (i=1;i<=50;i++) {
482 for (ip=1;ip<=n-1;ip++) {
483 for (iq=ip+1;iq<=n;iq++)
484 sm += fabs(
a[ip][iq]);
502 for (ip=1;ip<=n-1;ip++) {
503 for (iq=ip+1;iq<=n;iq++) {
504 g=100.0*fabs(
a[ip][iq]);
505 if (i > 4 && (
float)(fabs(d[ip])+g) == (
float)fabs(d[ip])
506 && (
float)(fabs(d[iq])+g) == (
float)fabs(d[iq]))
508 else if (fabs(
a[ip][iq]) > tresh) {
510 if ((
float)(fabs(h)+g) == (
float)fabs(h))
513 theta=0.5*h/(
a[ip][iq]);
514 t=1.0/(fabs(theta)+sqrt(1.0+theta*theta));
515 if (theta < 0.0) t = -t;
526 for (j=1;j<=ip-1;j++) {
529 for (j=ip+1;j<=iq-1;j++) {
532 for (j=iq+1;j<=n;j++) {
542 for (ip=1;ip<=n;ip++) {
549 fprintf(stderr,
"Too many iterations in routine jacobi");
void LALDoCoherentEstimation(LALStatus *stat, REAL4TimeSeries *output, CoherentEstimation *params, DetectorsData *in)
void LALClearCoherentData(LALStatus *stat, DetectorsData *dat)
#define ROTATE(a, i, j, k, l)
static INT4 jacobi(float **a, int n, float d[], float **v, int *nrot)
void LALClearCoherentInfo(LALStatus *stat, CoherentEstimation *dat)
#define COHERENTESTIMATIONH_EDST
#define COHERENTESTIMATIONH_EUIMP
#define COHERENTESTIMATIONH_MSGENUM
#define COHERENTESTIMATIONH_ENULL
#define COHERENTESTIMATIONH_EICE
#define COHERENTESTIMATIONH_MSGEDST
#define COHERENTESTIMATIONH_MSGEUIMP
#define COHERENTESTIMATIONH_ENUM
#define COHERENTESTIMATIONH_EMEM
#define COHERENTESTIMATIONH_MSGEMEM
#define COHERENTESTIMATIONH_MSGE0DEC
#define COHERENTESTIMATIONH_MSGEICE
#define COHERENTESTIMATIONH_MSGENULL
#define COHERENTESTIMATIONH_E0DEC
#define ABORT(statusptr, code, mesg)
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
void LALDestroyREAL8IIRFilter(LALStatus *stat, REAL8IIRFilter **input)
Deprecated.
void LALComputeDetAMResponse(LALStatus *status, LALDetAMResponse *pResponse, const LALDetAndSource *pDetAndSrc, const LIGOTimeGPS *gps)
void LALIIRFilterREAL8Vector(LALStatus *status, REAL8Vector *vector, REAL8IIRFilter *filter)
WARNING: THIS FUNCTION IS OBSOLETE.
double REAL8
Double precision real floating-point number (8 bytes).
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
double XLALTimeDelayFromEarthCenter(const double detector_earthfixed_xyz_metres[3], double source_right_ascension_radians, double source_declination_radians, const LIGOTimeGPS *gpstime)
Compute difference in arrival time of the same signal at detector and at center of Earth-fixed frame.
void LALDestroyVector(LALStatus *, REAL4Vector **)
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
REAL8IIRFilter ** filters
This structure encapsulates the detector AM (beam pattern) coefficients for one source at one instanc...
REAL4 plus
Detector response to -polarized gravitational radiation
REAL4 cross
Detector response to -polarized gravitational radiation.
This structure aggregates a pointer to a LALDetector and a LALSource.
LALSource * pSource
Pointer to LALSource object containing information about the source.
const LALDetector * pDetector
Pointer to LALDetector object containing information about the detector.
REAL8 location[3]
The three components, in an Earth-fixed Cartesian coordinate system, of the position vector from the ...
This structure stores pointers to a LALDetector and a LIGOTimeGPS.
LIGOTimeGPS * p_gps
Pointer to a GPS time structure.
const LALDetector * p_detector
pointer to a detector
This structure contains gravitational wave source position (in Equatorial coördinates),...
SkyPosition equatorialCoords
equatorial coordinates of source, in decimal RADIANS
REAL8 orientation
Orientation angle ( ) of source: counter-clockwise angle -axis makes with a line perpendicular to mer...
LAL status structure, see The LALStatus structure for more details.
struct tagLALStatus * statusPtr
Pointer to the next node in the list; NULL if this function is not reporting a subroutine error.
This structure stores units in the mksA system (plus Kelvin, Strain, and ADC Count).
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
INT4 gpsNanoSeconds
Residual nanoseconds.
Time series of REAL4 data, see DATATYPE-TimeSeries types for more details.
REAL4Sequence * data
The sequence of sampled data.
LALUnit sampleUnits
The physical units of the quantity being sampled.
REAL8 deltaT
The time step between samples of the time series in seconds.
LIGOTimeGPS epoch
The start time of the time series.
REAL8 f0
The heterodyning frequency, in Hertz (zero if not heterodyned).
REAL4 * data
Pointer to the data array.
UINT4 length
Number of elements in array.
Vector of type REAL8, see DATATYPE-Vector types for more details.
REAL8 * data
Pointer to the data array.
REAL8 longitude
The longitudinal coordinate (in radians), as defined above.
REAL8 latitude
The latitudinal coordinate (in radians), as defined above.
void output(int gps_sec, int output_type)