23 #include <lal/LALStdio.h>
24 #include <lal/LALStdlib.h>
25 #include <lal/LALError.h>
26 #include <lal/Calibration.h>
27 #include <lal/Units.h>
30 #define CAL_S2START 729273613
31 #define CAL_S2END 734367613
217 const REAL4 tiny = 1e-6;
298 R =
output->responseFunction->data->data;
299 C =
output->sensingFunction->data->data;
301 save =
output->responseFunction->data;
303 output->responseFunction->data = save;
306 save =
output->sensingFunction->data;
308 output->sensingFunction->data = save;
316 dt =
epoch - first_cal;
345 if ( ( fabs( creal(this_a) ) < tiny && fabs( cimag(this_a) ) < tiny ) ||
346 ( fabs( creal(this_ab) ) < tiny && fabs( cimag(this_ab) ) < tiny ) )
354 "Zero calibration factors found during S2 at GPS %10.9f",
362 "Zero calibration factor found at GPS %10.9f",
382 (
epoch + duration) );
386 (fabs( creal(
a) ) < tiny && fabs( cimag(
a) ) < tiny) ||
387 (fabs( creal(ab) ) < tiny && fabs( cimag(ab) ) < tiny) )
390 "Got %d calibration samples\nalpha and/or beta are zero:\n"
391 "Re a = %e\tIm a = %e\nRe ab = %e\tIm ab = %e",
392 length, creal(
a), cimag(
a), creal(ab), cimag(ab) );
405 "Got %d calibration samples\n"
406 "Re a = %e\tIm a = %e\nRe ab = %e\tIm ab = %e",
407 length, creal(
a), cimag(
a), creal(ab), cimag(ab) );
410 for ( i = 0; i < n; ++i )
413 R[i] = (ab * (C0[i] * R0[i] - 1.0) + 1.0) / C[i];
444 for ( i = 0; i <
output->data->length; ++i )
467 unitOne =
output->sampleUnits;
517 for ( i = 0; i <
output->data->length; ++i )
525 REAL4 scale = pow( 10.0, -fac );
526 for ( i = 0; i <
output->data->length; ++i )
528 output->data->data[i] *= scale;
556 for ( i = 0; i <
output->data->length; ++i )
579 unitOne =
output->sampleUnits;
629 for ( i = 0; i <
output->data->length; ++i )
637 REAL4 scale = pow( 10.0, -fac );
638 for ( i = 0; i <
output->data->length; ++i )
640 output->data->data[i] *= scale;
#define LALInfo(statusptr, info)
#define LALWarning(statusptr, warning)
#define ABORT(statusptr, code, mesg)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
static double f(double theta, double y, double xi)
#define CALIBRATIONH_ENULL
Null pointer.
#define CALIBRATIONH_ETIME
Time out of range.
#define CALIBRATIONH_EZERO
Zero factor.
#define CALIBRATIONH_ESIZE
Invalid size.
#define CALIBRATIONH_EUNIT
Incompatible units.
#define CALIBRATIONH_ESZMM
Size mismatch.
INT4 XLALResponseConvert(COMPLEX8FrequencySeries *output, COMPLEX8FrequencySeries *input)
UNDOCUMENTED.
void LALUpdateCalibration(LALStatus *status, CalibrationFunctions *output, CalibrationFunctions *input, CalibrationUpdateParams *params)
UNDOCUMENTED.
void LALResponseConvert(LALStatus *status, COMPLEX8FrequencySeries *output, COMPLEX8FrequencySeries *input)
UNDOCUMENTED.
void LALComputeTransfer(LALStatus *stat, CalibrationRecord *calrec)
UNDOCUMENTED.
#define XLAL_NUM_ELEM(x)
MACRO which gives the number of elements in a fixed-size array.
double REAL8
Double precision real floating-point number (8 bytes).
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
uint32_t UINT4
Four-byte unsigned integer.
float complex COMPLEX8
Single-precision floating-point complex number (8 bytes total)
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
@ LALNumUnits
The number of units.
int XLALUnitNormalize(LALUnit *unit)
Returns 0 upon success or XLAL_FAILURE if the input pointer is NULL, in which case xlalErrno is set t...
#define XLAL_ERROR(...)
Macro to invoke a failure from a XLAL routine returning an integer.
@ XLAL_EINVAL
Invalid argument.
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
Returns the GPS time as a REAL8.
See DATATYPE-FrequencySeries types for documentation.
REAL8 deltaT
The time step between samples of the time series in seconds.
LIGOTimeGPS epoch
The start time of the time series.
COMPLEX8Sequence * data
The sequence of sampled data.
Vector of type COMPLEX8, see DATATYPE-Vector types for more details.
UINT4 length
Number of elements in array.
COMPLEX8 * data
Pointer to the data array.
The type CalibrationFunctions contains two calibration functions, the sensing function and the respo...
COMPLEX8FrequencySeries * responseFunction
COMPLEX8FrequencySeries * sensingFunction
COMPLEX8FrequencySeries * transfer
The type CalibrationUpdateParams contains two time series representing an overall gain factor for the...
COMPLEX8TimeSeries * sensingFactor
COMPLEX8TimeSeries * openLoopFactor
LAL status structure, see The LALStatus structure for more details.
This structure stores units in the mksA system (plus Kelvin, Strain, and ADC Count).
INT2 powerOfTen
Overall power-of-ten scaling is 10^powerOfTen.
UINT2 unitDenominatorMinusOne[LALNumUnits]
Array of unit power denominators-minus-one.
INT2 unitNumerator[LALNumUnits]
Array of unit power numerators.
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
REAL8 * data
Pointer to the data array.
UINT4 length
Number of elements in array.
void output(int gps_sec, int output_type)