21 #include <lal/ComputeDataQualityVector.h>
74 int t_bad_left,
int t_bad_right,
int wings,
76 int* dq_data,
int n_dq)
81 int sv_science, sv_injection, sv_up;
82 int science, injection, up;
88 for (i = 0; i < n_dq; i++) {
92 for (j = 0; j < r_light; j++) {
93 sum_x += lax_data[i*r_light + j];
94 sum_y += lay_data[i*r_light + j];
97 light = (sum_x/r_light > 100 && sum_y/r_light > 100);
104 for (j = 0; j < r_sv; j++) {
105 int s = (int) sv_data[i*r_sv + j];
106 if ((s & (1 << 0)) == 0) sv_science = 0;
107 if ((s & (1 << 3)) == 0) sv_injection = 1;
108 if ((s & (1 << 2)) == 0) sv_up = 0;
111 science = sv_science && light;
112 injection = sv_injection;
128 for (j = 0; j < r_gamma; j++) {
129 REAL8 re = creal(gamma_data[i*r_gamma + j]);
130 if (re < 0.8 || re > 1.2 || isnan(re) || isinf(re))
136 if (science) dq_value += (1 << 0);
137 if (injection) dq_value += (1 << 1);
138 if (up) dq_value += (1 << 2);
140 if (badgamma) dq_value += (1 << 4);
141 if (light) dq_value += (1 << 5);
142 if (missing) dq_value += (1 << 6);
144 dq_data[i] = dq_value;
148 for (i = 0; i < n_dq; i++) {
151 if (i - wings < t_bad_left || i + wings > n_dq + t_bad_right)
154 for (j = 0; j < wings; j++) {
157 if ((dq_data[pos] & (1 << 2)) == 0)
162 if ((dq_data[pos] & (1 << 2)) == 0)
167 if (calibrated) dq_data[i] += (1 << 3);
int XLALComputeDQ(REAL4 *sv_data, int r_sv, REAL4 *lax_data, REAL4 *lay_data, int r_light, COMPLEX16 *gamma_data, int r_gamma, int t_bad_left, int t_bad_right, int wings, int missing, int *dq_data, int n_dq)
Compute the Data Quality Vector as defined in https://www.lsc-group.phys.uwm.edu/daswg/wiki/S6OnlineG...
double complex COMPLEX16
Double-precision floating-point complex number (16 bytes total)
double REAL8
Double precision real floating-point number (8 bytes).
float REAL4
Single precision real floating-point number (4 bytes).