diff --git a/gstlal-calibration/bin/gstlal_compute_strain b/gstlal-calibration/bin/gstlal_compute_strain index eb202e4b09ca113cca53a323d2daba16e4d2f407..3471bb468280af928af9b92d0de2d5c8289406ef 100755 --- a/gstlal-calibration/bin/gstlal_compute_strain +++ b/gstlal-calibration/bin/gstlal_compute_strain @@ -1350,7 +1350,7 @@ if compute_kappac or compute_fcc or compute_fs or compute_srcq: smooth_fcctee = pipeparts.mktee(pipeline, smooth_fcc) # if apply_fcc: -# update_fcc = pipeparts.mkgeneric(pipeline, smooth_fcctee, "lal_fcc_update", data_rate = hoft_sr, fcc_rate = compute_factors_sr, fcc_model = fcc_default, averaging_time = float(TDCFConfigs["fccaveragingtime"]), filter_duration = float(TDCFConfigs["fccfilterduration"])) +# update_fcc = calibration_parts.mkfccupdate(pipeline, smooth_fcctee, data_rate = hoft_sr, fcc_rate = compute_factors_sr, fcc_model = fcc_default, averaging_time = float(TDCFConfigs["fccaveragingtime"]), filter_duration = float(TDCFConfigs["fccfilterduration"])) # pipeparts.mkfakesink(pipeline, update_fcc) # compute f_s and Q @@ -1468,19 +1468,19 @@ if compute_fs or compute_srcq: if apply_complex_kappatst: # We will apply an adaptive FIR filter to the TST component of the actuation that includes time-dependence in the gain and computational time delay - adaptive_tst_filter = pipeparts.mkgeneric(pipeline, smooth_ktsttee, "lal_adaptivefirfilt", update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = esd_act_line_freq, static_filter = tstfilt, variable_filter_length = len(tstfilt), adaptive_filter_length = len(tstfilt), tukey_param = 0.5, filter_sample_rate = tstchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_tst_filter") + adaptive_tst_filter = calibration_parts.mkadaptivefirfilt(pipeline, smooth_ktsttee, static_filter = tstfilt, update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = esd_act_line_freq, variable_filter_length = len(tstfilt), adaptive_filter_length = len(tstfilt), tukey_param = 0.5, filter_sample_rate = tstchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_tst_filter") if apply_complex_kappapum: # We will apply an adaptive FIR filter to the PUM component of the actuation that includes time-dependence in the gain and computational time delay - adaptive_pum_filter = pipeparts.mkgeneric(pipeline, smooth_kpumtee, "lal_adaptivefirfilt", update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = esd_act_line_freq, static_filter = pumfilt, variable_filter_length = len(pumfilt), adaptive_filter_length = len(pumfilt), tukey_param = 0.5, filter_sample_rate = pumchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_pum_filter") + adaptive_pum_filter = calibration_parts.mkadaptivefirfilt(pipeline, smooth_kpumtee, static_filter = pumfilt, update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = esd_act_line_freq, variable_filter_length = len(pumfilt), adaptive_filter_length = len(pumfilt), tukey_param = 0.5, filter_sample_rate = pumchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_pum_filter") if apply_complex_kappauim: # We will apply an adaptive FIR filter to the UIM component of the actuation that includes time-dependence in the gain and computational time delay - adaptive_uim_filter = pipeparts.mkgeneric(pipeline, smooth_kuimtee, "lal_adaptivefirfilt", update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = esd_act_line_freq, static_filter = uimfilt, variable_filter_length = len(uimfilt), adaptive_filter_length = len(uimfilt), tukey_param = 0.5, filter_sample_rate = uimchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_uim_filter") + adaptive_uim_filter = calibration_parts.mkadaptivefirfilt(pipeline, smooth_kuimtee, static_filter = uimfilt, update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = esd_act_line_freq, variable_filter_length = len(uimfilt), adaptive_filter_length = len(uimfilt), tukey_param = 0.5, filter_sample_rate = uimchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_uim_filter") if apply_complex_kappapu: # We will apply an adaptive FIR filter to the PUM/UIM component of the actuation that includes time-dependence in the gain and computational time delay - adaptive_pumuim_filter = pipeparts.mkgeneric(pipeline, smooth_kputee, "lal_adaptivefirfilt", update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = darm_ctrl_line_freq, static_filter = pumuimfilt, variable_filter_length = len(pumuimfilt), adaptive_filter_length = len(pumuimfilt), tukey_param = 0.5, filter_sample_rate = pumuimchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_pumuim_filter") + adaptive_pumuim_filter = calibration_parts.mkadaptivefirfilt(pipeline, smooth_kputee, static_filter = pumuimfilt, update_samples = int(actuation_filter_update_time * compute_factors_sr), average_samples = int(actuation_filter_averaging_time * compute_factors_sr), phase_measurement_frequency = darm_ctrl_line_freq, variable_filter_length = len(pumuimfilt), adaptive_filter_length = len(pumuimfilt), tukey_param = 0.5, filter_sample_rate = pumuimchainsr, filter_timeshift = 1000000000 * actuation_filter_update_time, name = "adaptive_pumuim_filter") if apply_fcc or apply_fs or apply_srcq: # We will apply an adaptive FIR filter to DARM_ERR that allows corrections for poles, zeros, and gain @@ -1574,7 +1574,7 @@ if apply_fcc or apply_fs or apply_srcq: # Now interleave the correction channels in tdep_zpk and feed them into lal_adaptivefirfilt to update the inverse sensing filter tdep_zpk = calibration_parts.mkinterleave(pipeline, tdep_zpk, complex_data = True) - adaptive_invsens_filter = pipeparts.mkgeneric(pipeline, tdep_zpk, "lal_adaptivefirfilt", update_samples = int(sensing_filter_update_time * compute_factors_sr), average_samples = int(sensing_filter_averaging_time * compute_factors_sr), num_zeros = variable_invsens_zeros, num_poles = 0, static_poles = static_invsens_poles, static_filter = reschainfilt, variable_filter_length = len(reschainfilt), adaptive_filter_length = len(reschainfilt), tukey_param = 0.5, filter_sample_rate = hoft_sr, filter_timeshift = 1000000000 * sensing_filter_update_time, name = "adaptive_invsens_filter") + adaptive_invsens_filter = calibration_parts.mkadaptivefirfilt(pipeline, tdep_zpk, static_filter = reschainfilt, static_poles = static_invsens_poles, update_samples = int(sensing_filter_update_time * compute_factors_sr), average_samples = int(sensing_filter_averaging_time * compute_factors_sr), num_zeros = variable_invsens_zeros, num_poles = 0, variable_filter_length = len(reschainfilt), adaptive_filter_length = len(reschainfilt), tukey_param = 0.5, filter_sample_rate = hoft_sr, filter_timeshift = 1000000000 * sensing_filter_update_time, name = "adaptive_invsens_filter") # # CONTROL BRANCH @@ -1699,7 +1699,7 @@ if test_filters: tst_tf_dur = gps_end_time - tst_tf_start - tst_filter_latency - 10 if InputConfigs["datasource"] == "frames" else 300 tst_tf_dur = tst_tf_dur - (tst_tf_dur + 8) % 16 num_tst_ffts = int(tst_tf_dur / 8) - pipeparts.mkgeneric(pipeline, tst_tf, "lal_transferfunction", fft_length = 16 * tstchainsr, fft_overlap = 8 * tstchainsr, num_ffts = num_tst_ffts, use_median = True, update_samples = 1e15, update_delay_samples = tst_tf_delay * tstchainsr, filename = "%s_tst_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), tst_tf_start, tst_tf_dur), name = "tst_filters_tf") + calibration_parts.mktransferfunction(pipeline, tst_tf, fft_length = 16 * tstchainsr, fft_overlap = 8 * tstchainsr, num_ffts = num_tst_ffts, use_median = True, update_samples = 1e15, update_delay_samples = tst_tf_delay * tstchainsr, filename = "%s_tst_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), tst_tf_start, tst_tf_dur), name = "tst_filters_tf") # apply kappa_tst if we haven't already if apply_kappatst and not apply_complex_kappatst: @@ -1761,7 +1761,7 @@ if apply_kappapum or apply_kappauim or apply_complex_kappapum or apply_complex_k pum_tf_dur = gps_end_time - pum_tf_start - pum_filter_latency - 10 if InputConfigs["datasource"] == "frames" else 300 pum_tf_dur = pum_tf_dur - (pum_tf_dur + 8) % 16 num_pum_ffts = int(pum_tf_dur / 8) - pipeparts.mkgeneric(pipeline, pum_tf, "lal_transferfunction", fft_length = 16 * pumchainsr, fft_overlap = 8 * pumchainsr, num_ffts = num_pum_ffts, use_median = True, update_samples = 1e15, update_delay_samples = pum_tf_delay * pumchainsr, filename = "%s_pum_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), pum_tf_start, pum_tf_dur), name = "pum_filters_tf") + calibration_parts.mktransferfunction(pipeline, pum_tf, fft_length = 16 * pumchainsr, fft_overlap = 8 * pumchainsr, num_ffts = num_pum_ffts, use_median = True, update_samples = 1e15, update_delay_samples = pum_tf_delay * pumchainsr, filename = "%s_pum_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), pum_tf_start, pum_tf_dur), name = "pum_filters_tf") if apply_complex_kappauim: if filter_latency_factor == 0: @@ -1790,7 +1790,7 @@ if apply_kappapum or apply_kappauim or apply_complex_kappapum or apply_complex_k uim_tf_dur = gps_end_time - uim_tf_start - uim_filter_latency - 10 if InputConfigs["datasource"] == "frames" else 300 uim_tf_dur = uim_tf_dur - (uim_tf_dur + 8) % 16 num_uim_ffts = int(uim_tf_dur / 8) - pipeparts.mkgeneric(pipeline, uim_tf, "lal_transferfunction", fft_length = 16 * uimchainsr, fft_overlap = 8 * uimchainsr, num_ffts = num_uim_ffts, use_median = True, update_samples = 1e15, update_delay_samples = uim_tf_delay * uimchainsr, filename = "%s_uim_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), uim_tf_start, uim_tf_dur), name = "uim_filters_tf") + calibration_parts.mktransferfunction(pipeline, uim_tf, fft_length = 16 * uimchainsr, fft_overlap = 8 * uimchainsr, num_ffts = num_uim_ffts, use_median = True, update_samples = 1e15, update_delay_samples = uim_tf_delay * uimchainsr, filename = "%s_uim_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), uim_tf_start, uim_tf_dur), name = "uim_filters_tf") # apply kappa_pum if we haven't already if apply_kappapum and not apply_complex_kappapum: @@ -1856,7 +1856,7 @@ else: pumuim_tf_dur = gps_end_time - pumuim_tf_start - pumuim_filter_latency - 10 if InputConfigs["datasource"] == "frames" else 300 pumuim_tf_dur = pumuim_tf_dur - (pumuim_tf_dur + 8) % 16 num_pumuim_ffts = int(pumuim_tf_dur / 8) - pipeparts.mkgeneric(pipeline, pumuim_tf, "lal_transferfunction", fft_length = 16 * pumuimchainsr, fft_overlap = 8 * pumuimchainsr, num_ffts = num_pumuim_ffts, use_median = True, update_samples = 1e15, update_delay_samples = pumuim_tf_delay * pumuimchainsr, filename = "%s_pumuim_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), pumuim_tf_start, pumuim_tf_dur), name = "pumuim_filters_tf") + calibration_parts.mktransferfunction(pipeline, pumuim_tf, fft_length = 16 * pumuimchainsr, fft_overlap = 8 * pumuimchainsr, num_ffts = num_pumuim_ffts, use_median = True, update_samples = 1e15, update_delay_samples = pumuim_tf_delay * pumuimchainsr, filename = "%s_pumuim_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), pumuim_tf_start, pumuim_tf_dur), name = "pumuim_filters_tf") # apply kappa_pu if we haven't already if apply_kappapu and not apply_complex_kappapu: @@ -1955,7 +1955,7 @@ if test_filters: res_tf_dur = gps_end_time - res_tf_start - res_filter_latency - 10 if InputConfigs["datasource"] == "frames" else 300 res_tf_dur = res_tf_dur - (res_tf_dur + 8) % 16 num_res_ffts = int(res_tf_dur / 8) - pipeparts.mkgeneric(pipeline, res_tf, "lal_transferfunction", fft_length = 16 * hoft_sr, fft_overlap = 8 * hoft_sr, num_ffts = num_res_ffts, use_median = True, update_samples = 1e15, update_delay_samples = res_tf_delay * hoft_sr, filename = "%s_res_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), res_tf_start, res_tf_dur), name = "res_filters_tf") + calibration_parts.mktransferfunction(pipeline, res_tf, fft_length = 16 * hoft_sr, fft_overlap = 8 * hoft_sr, num_ffts = num_res_ffts, use_median = True, update_samples = 1e15, update_delay_samples = res_tf_delay * hoft_sr, filename = "%s_res_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), res_tf_start, res_tf_dur), name = "res_filters_tf") # Apply \kappa_c if we haven't already if apply_kappac and not (apply_fcc or apply_fs or apply_srcq): @@ -1984,7 +1984,7 @@ if test_filters: response_dur = gps_end_time - response_start - max(res_filter_latency, tst_filter_latency) - 10 if InputConfigs["datasource"] == "frames" else 300 response_dur = response_dur - (response_dur + 8) % 16 num_response_ffts = int(response_dur / 8) - pipeparts.mkgeneric(pipeline, response_function, "lal_transferfunction", fft_length = 16 * hoft_sr, fft_overlap = 8 * hoft_sr, num_ffts = num_response_ffts, use_median = True, update_samples = 1e15, update_delay_samples = response_delay * hoft_sr, filename = "%s_response_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), response_start, response_dur), name = "response_function") + calibration_parts.mktransferfunction(pipeline, response_function, fft_length = 16 * hoft_sr, fft_overlap = 8 * hoft_sr, num_ffts = num_response_ffts, use_median = True, update_samples = 1e15, update_delay_samples = response_delay * hoft_sr, filename = "%s_response_filters_transfer_function_%d-%d.txt" % (filters_name.split('/')[-1].replace('.', '_'), response_start, response_dur), name = "response_function") # Divide by L in a way that is compatitble with old and new filters files, since old filter files don't recored "arm length" try: strain = pipeparts.mkaudioamplify(pipeline, strain, 1.0/float(filters["arm_length"])) diff --git a/gstlal-calibration/config_files/O2/H1/tests/H1DCS_FreqIndepAndFccCorrections_Cleaning.ini b/gstlal-calibration/config_files/O2/H1/tests/H1DCS_FreqIndepAndFccCorrections_Cleaning.ini index 8102826caa3aa76496d9095d816b0e45b9aeb669..8b5dfa5df903b0e0db06b14046b8f31ad3ea95b6 100644 --- a/gstlal-calibration/config_files/O2/H1/tests/H1DCS_FreqIndepAndFccCorrections_Cleaning.ini +++ b/gstlal-calibration/config_files/O2/H1/tests/H1DCS_FreqIndepAndFccCorrections_Cleaning.ini @@ -195,6 +195,17 @@ TSTExcChannel: SUS-ETMY_L3_CAL_LINE_OUT_DQ PUMExcChannel: SUS-ETMY_L2_CAL_LINE_OUT_DQ UIMExcChannel: SUS-ETMY_L1_CAL_LINE_OUT_DQ PCALChannel: CAL-PCALY_TX_PD_OUT_DQ +############################################ +# Calibration Line Frequency Channel Names # +############################################ +DARMExcLineFreqChannel: CAL-CS_TDEP_DARM_LINE1_COMPARISON_OSC_FREQ +TSTExcLineFreqChannel: CAL-CS_TDEP_SUS_LINE3_COMPARISON_OSC_FREQ +PUMExcLineFreqChannel: CAL-CS_TDEP_SUS_LINE2_COMPARISON_OSC_FREQ +UIMExcLineFreqChannel: CAL-CS_TDEP_SUS_LINE1_COMPARISON_OSC_FREQ +PCALLine1FreqChannel: CAL-CS_TDEP_PCAL_LINE1_COMPARISON_OSC_FREQ +PCALLine2FreqChannel: CAL-CS_TDEP_PCAL_LINE2_COMPARISON_OSC_FREQ +PCALLine3FreqChannel: CAL-CS_TDEP_PCAL_LINE3_COMPARISON_OSC_FREQ +PCALLine4FreqChannel: CAL-CS_TDEP_PCAL_LINE4_COMPARISON_OSC_FREQ ####################################### # Coherence Uncertainty Channel Names # ####################################### diff --git a/gstlal-calibration/gst/lal/gstlal_adaptivefirfilt.c b/gstlal-calibration/gst/lal/gstlal_adaptivefirfilt.c index 330b9d841b5b9e78e9d76eb84eb7d1903e9164c6..5b2e81b40003a7d5cfdc8f4a699e545fb10721cd 100644 --- a/gstlal-calibration/gst/lal/gstlal_adaptivefirfilt.c +++ b/gstlal-calibration/gst/lal/gstlal_adaptivefirfilt.c @@ -750,9 +750,18 @@ static void set_property(GObject *object, enum property id, const GValue *value, g_free(element->static_zeros); element->static_zeros = NULL; } - element->static_zeros = (complex double *) gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, &element->num_static_zeros); + element->num_static_zeros = gst_value_array_get_size(value); + if(element->num_static_zeros % 2) + GST_ERROR_OBJECT(element, "Array length for property static-zeros must be even"); + double *double_static_zeros = g_malloc(element->num_static_zeros * sizeof(double)); + int i; + for(i = 0; i < element->num_static_zeros; i++) + double_static_zeros[i] = g_value_get_double(gst_value_array_get_value(value, i)); + element->static_zeros = (complex double *) double_static_zeros; + /* Since we passed a complex array as though it were real, there are only half as many zeros */ element->num_static_zeros /= 2; + break; case ARG_STATIC_POLES: @@ -760,9 +769,18 @@ static void set_property(GObject *object, enum property id, const GValue *value, g_free(element->static_poles); element->static_poles = NULL; } - element->static_poles = (complex double *) gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, &element->num_static_poles); + element->num_static_poles = gst_value_array_get_size(value); + if(element->num_static_poles % 2) + GST_ERROR_OBJECT(element, "Array length for property static-poles must be even"); + double *double_static_poles = g_malloc(element->num_static_poles * sizeof(double)); + int j; + for(j = 0; j < element->num_static_poles; j++) + double_static_poles[j] = g_value_get_double(gst_value_array_get_value(value, j)); + element->static_poles = (complex double *) double_static_poles; + /* Since we passed a complex array as though it were real, there are only half as many poles */ element->num_static_poles /= 2; + break; case ARG_PHASE_MEASUREMENT_FREQUENCY: @@ -774,7 +792,11 @@ static void set_property(GObject *object, enum property id, const GValue *value, g_free(element->static_filter); element->static_filter = NULL; } - element->static_filter = gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, (int *) &element->static_filter_length); + element->static_filter_length = gst_value_array_get_size(value); + element->static_filter = g_malloc(element->static_filter_length * sizeof(double)); + int k; + for(k = 0; k < element->static_filter_length; k++) + element->static_filter[k] = g_value_get_double(gst_value_array_get_value(value, k)); /* If no static filter is provided, the filter is just 1 */ if(element->static_filter_length == 0) { @@ -792,14 +814,6 @@ static void set_property(GObject *object, enum property id, const GValue *value, element->minimize_filter_length = g_value_get_boolean(value); break; - case ARG_ADAPTIVE_FILTER: - if(element->adaptive_filter) { - g_free(element->adaptive_filter); - element->adaptive_filter = NULL; - } - element->adaptive_filter = gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, (int *) &element->adaptive_filter_length); - break; - case ARG_ADAPTIVE_FILTER_LENGTH: element->adaptive_filter_length = g_value_get_int64(value); break; @@ -856,29 +870,64 @@ static void get_property(GObject *object, enum property id, GValue *value, GPara g_value_set_int(value, element->num_poles); break; - case ARG_STATIC_ZEROS: - if(element->static_zeros) - g_value_take_boxed(value, gstlal_g_value_array_from_doubles((double *) element->static_zeros, 2 * element->num_static_zeros)); - else - g_value_take_boxed(value, g_value_array_new(0)); + case ARG_STATIC_ZEROS: ; + GValue staticzeros = G_VALUE_INIT; + g_value_init(&staticzeros, GST_TYPE_ARRAY); + if(element->static_zeros) { + double *double_static_zeros = (double *) element->static_zeros; + int i; + for(i = 0; i < 2 * element->num_static_zeros; i++) { + GValue staticzero = G_VALUE_INIT; + g_value_init(&staticzero, G_TYPE_DOUBLE); + g_value_set_double(&staticzero, double_static_zeros[i]); + gst_value_array_append_value(&staticzeros, &staticzero); + g_value_unset(&staticzero); + } + } + g_value_copy(&staticzeros, value); + g_value_unset(&staticzeros); + break; - case ARG_STATIC_POLES: - if(element->static_poles) - g_value_take_boxed(value, gstlal_g_value_array_from_doubles((double *) element->static_poles, 2 * element->num_static_poles)); - else - g_value_take_boxed(value, g_value_array_new(0)); + case ARG_STATIC_POLES: ; + GValue staticpoles = G_VALUE_INIT; + g_value_init(&staticpoles, GST_TYPE_ARRAY); + if(element->static_poles) { + double *double_static_poles = (double *) element->static_poles; + int j; + for(j = 0; j < 2 * element->num_static_poles; j++) { + GValue staticpole = G_VALUE_INIT; + g_value_init(&staticpole, G_TYPE_DOUBLE); + g_value_set_double(&staticpole, double_static_poles[j]); + gst_value_array_append_value(&staticpoles, &staticpole); + g_value_unset(&staticpole); + } + } + g_value_copy(&staticpoles, value); + g_value_unset(&staticpoles); + break; case ARG_PHASE_MEASUREMENT_FREQUENCY: g_value_set_double(value, element->phase_measurement_frequency); break; - case ARG_STATIC_FILTER: - if(element->static_filter) - g_value_take_boxed(value, gstlal_g_value_array_from_doubles(element->static_filter, element->static_filter_length)); - else - g_value_take_boxed(value, g_value_array_new(0)); + case ARG_STATIC_FILTER: ; + GValue staticfilter = G_VALUE_INIT; + g_value_init(&staticfilter, GST_TYPE_ARRAY); + if(element->static_filter) { + int k; + for(k = 0; k < element->static_filter_length; k++) { + GValue static_filter_tap = G_VALUE_INIT; + g_value_init(&static_filter_tap, G_TYPE_DOUBLE); + g_value_set_double(&static_filter_tap, element->static_filter[k]); + gst_value_array_append_value(&staticfilter, &static_filter_tap); + g_value_unset(&static_filter_tap); + } + } + g_value_copy(&staticfilter, value); + g_value_unset(&staticfilter); + break; case ARG_VARIABLE_FILTER_LENGTH: @@ -889,11 +938,22 @@ static void get_property(GObject *object, enum property id, GValue *value, GPara g_value_set_boolean(value, element->minimize_filter_length); break; - case ARG_ADAPTIVE_FILTER: - if(element->adaptive_filter) - g_value_take_boxed(value, gstlal_g_value_array_from_doubles(element->adaptive_filter, element->adaptive_filter_length)); - else - g_value_take_boxed(value, g_value_array_new(0)); + case ARG_ADAPTIVE_FILTER: ; + GValue adaptivefilter = G_VALUE_INIT; + g_value_init(&adaptivefilter, GST_TYPE_ARRAY); + if(element->adaptive_filter) { + int m; + for(m = 0; m < element->adaptive_filter_length; m++) { + GValue adaptive_filter_tap = G_VALUE_INIT; + g_value_init(&adaptive_filter_tap, G_TYPE_DOUBLE); + g_value_set_double(&adaptive_filter_tap, element->adaptive_filter[m]); + gst_value_array_append_value(&adaptivefilter, &adaptive_filter_tap); + g_value_unset(&adaptive_filter_tap); + } + } + g_value_copy(&adaptivefilter, value); + g_value_unset(&adaptivefilter); + break; case ARG_ADAPTIVE_FILTER_LENGTH: @@ -1047,7 +1107,7 @@ static void gstlal_adaptivefirfilt_class_init(GSTLALAdaptiveFIRFiltClass *klass) 0, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT ); - properties[ARG_STATIC_ZEROS] = g_param_spec_value_array( + properties[ARG_STATIC_ZEROS] = gst_param_spec_array( "static-zeros", "Static Zeros", "Array of static zeros, which will be included in each computed filter. Since\n\t\t\t" @@ -1062,7 +1122,7 @@ static void gstlal_adaptivefirfilt_class_init(GSTLALAdaptiveFIRFiltClass *klass) ), G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT ); - properties[ARG_STATIC_POLES] = g_param_spec_value_array( + properties[ARG_STATIC_POLES] = gst_param_spec_array( "static-poles", "Static Poles", "Array of static poles, which will be included in each computed filter. Since\n\t\t\t" @@ -1086,7 +1146,7 @@ static void gstlal_adaptivefirfilt_class_init(GSTLALAdaptiveFIRFiltClass *klass) -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT ); - properties[ARG_STATIC_FILTER] = g_param_spec_value_array( + properties[ARG_STATIC_FILTER] = gst_param_spec_array( "static-filter", "Static Filter", "A static filter that is convolved with the computed adaptive filter", @@ -1117,7 +1177,7 @@ static void gstlal_adaptivefirfilt_class_init(GSTLALAdaptiveFIRFiltClass *klass) FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT ); - properties[ARG_ADAPTIVE_FILTER] = g_param_spec_value_array( + properties[ARG_ADAPTIVE_FILTER] = gst_param_spec_array( "adaptive-filter", "Adaptive Filter", "The computed adaptive filter. This includes both time-varying parameters like\n\t\t\t" diff --git a/gstlal-calibration/gst/lal/gstlal_insertgap.c b/gstlal-calibration/gst/lal/gstlal_insertgap.c index 9200839bf8f2994dccf6ef80505942686783291e..ef719bb8546835844dd40c494f9cf85c3f971abb 100644 --- a/gstlal-calibration/gst/lal/gstlal_insertgap.c +++ b/gstlal-calibration/gst/lal/gstlal_insertgap.c @@ -655,9 +655,14 @@ static void set_property(GObject *object, enum property prop_id, const GValue *v g_free(element->bad_data_intervals); element->bad_data_intervals = NULL; } - element->bad_data_intervals = gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, &element->array_length); + element->array_length = gst_value_array_get_size(value); if(element->array_length % 2) - GST_ERROR_OBJECT(element, "Array length for property bad_data_intervals must be even"); + GST_ERROR_OBJECT(element, "Array length for property bad-data-intervals must be even"); + element->bad_data_intervals = g_malloc(element->array_length * sizeof(double)); + int i; + for(i = 0; i < element->array_length; i++) + element->bad_data_intervals[i] = g_value_get_double(gst_value_array_get_value(value, i)); + break; } case ARG_BLOCK_DURATION: @@ -700,8 +705,20 @@ static void get_property(GObject *object, enum property prop_id, GValue *value, case ARG_REPLACE_VALUE: g_value_set_double(value, element->replace_value); break; - case ARG_BAD_DATA_INTERVALS: - g_value_take_boxed(value, gstlal_g_value_array_from_doubles(element->bad_data_intervals, element->array_length)); + case ARG_BAD_DATA_INTERVALS: ; + GValue va = G_VALUE_INIT; + g_value_init(&va, GST_TYPE_ARRAY); + int i; + for(i = 0; i < element->array_length; i++) { + GValue v = G_VALUE_INIT; + g_value_init(&v, G_TYPE_DOUBLE); + g_value_set_double(&v, element->bad_data_intervals[i]); + gst_value_array_append_value(&va, &v); + g_value_unset(&v); + } + g_value_copy(&va, value); + g_value_unset(&va); + break; case ARG_BLOCK_DURATION: g_value_set_uint64(value, element->block_duration); @@ -849,7 +866,7 @@ static void gstlal_insertgap_class_init(GSTLALInsertGapClass *klass) g_object_class_install_property( gobject_class, ARG_BAD_DATA_INTERVALS, - g_param_spec_value_array( + gst_param_spec_array( "bad-data-intervals", "Bad data intervals", "Array containing minima and maxima of closed intervals in which data is\n\t\t\t" diff --git a/gstlal-calibration/gst/lal/gstlal_transferfunction.c b/gstlal-calibration/gst/lal/gstlal_transferfunction.c index 3787b68251fcecef4e3a39793a381b9cd4e24710..bf6ee0c5f3e3f5383c6f4128f9f40cb58df29ef3 100644 --- a/gstlal-calibration/gst/lal/gstlal_transferfunction.c +++ b/gstlal-calibration/gst/lal/gstlal_transferfunction.c @@ -2006,34 +2006,21 @@ static void set_property(GObject *object, enum property id, const GValue *value, g_free(element->notch_frequencies); element->notch_frequencies = NULL; } - element->notch_frequencies = gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, &element->num_notches); + element->num_notches = gst_value_array_get_size(value); if(element->num_notches % 2) GST_ERROR_OBJECT(element, "Array length for property notch_frequencies must be even"); + element->notch_frequencies = g_malloc(element->num_notches * sizeof(double)); + int k; + for(k = 0; k < element->num_notches; k++) + element->notch_frequencies[k] = g_value_get_double(gst_value_array_get_value(value, k)); element->num_notches /= 2; + break; case ARG_FIR_TIMESHIFT: element->fir_timeshift = g_value_get_int64(value); break; - case ARG_TRANSFER_FUNCTIONS: - if(element->transfer_functions) { - g_free(element->transfer_functions); - element->transfer_functions = NULL; - } - int n; - element->transfer_functions = (complex double *) gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, &n); - break; - - case ARG_FIR_FILTERS: - if(element->fir_filters) { - g_free(element->fir_filters); - element->fir_filters = NULL; - } - int m; - element->fir_filters = gstlal_doubles_from_g_value_array(g_value_get_boxed(value), NULL, &m); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, id, pspec); break; @@ -2118,8 +2105,20 @@ static void get_property(GObject *object, enum property id, GValue *value, GPara g_value_set_double(value, element->low_pass); break; - case ARG_NOTCH_FREQUENCIES: - g_value_take_boxed(value, gstlal_g_value_array_from_doubles(element->notch_frequencies, 2 * element->num_notches)); + case ARG_NOTCH_FREQUENCIES: ; + GValue valuearray = G_VALUE_INIT; + g_value_init(&valuearray, GST_TYPE_ARRAY); + int k; + for(k = 0; k < 2 * element->num_notches; k++) { + GValue notch = G_VALUE_INIT; + g_value_init(¬ch, G_TYPE_DOUBLE); + g_value_set_double(¬ch, element->notch_frequencies[k]); + gst_value_array_append_value(&valuearray, ¬ch); + g_value_unset(¬ch); + } + g_value_copy(&valuearray, value); + g_value_unset(&valuearray); + break; case ARG_FIR_TIMESHIFT: @@ -2128,31 +2127,48 @@ static void get_property(GObject *object, enum property id, GValue *value, GPara case ARG_TRANSFER_FUNCTIONS: if(element->transfer_functions) { - GValueArray *va; - va = g_value_array_new(element->channels - 1); - GValue v = G_VALUE_INIT; - g_value_init(&v, G_TYPE_VALUE_ARRAY); - int i; + double *double_tfs = (double *) element->transfer_functions; + GValue va = G_VALUE_INIT; + g_value_init(&va, GST_TYPE_ARRAY); + int i, j; for(i = 0; i < element->channels - 1; i++) { - g_value_take_boxed(&v, gstlal_g_value_array_from_doubles((double *) (element->transfer_functions + i * (element->fir_length / 2 + 1)), element->fir_length + 2)); - g_value_array_append(va, &v); + GValue va_row = G_VALUE_INIT; + g_value_init(&va_row, GST_TYPE_ARRAY); + for(j = 0; j < element->fir_length + 2; j++) { + GValue v = G_VALUE_INIT; + g_value_init(&v, G_TYPE_DOUBLE); + g_value_set_double(&v, double_tfs[i * (element->fir_length + 2) + j]); + gst_value_array_append_value(&va_row, &v); + g_value_unset(&v); + } + gst_value_array_append_value(&va, &va_row); + g_value_unset(&va_row); } - g_value_take_boxed(value, va); + g_value_copy(&va, value); + g_value_unset(&va); } break; case ARG_FIR_FILTERS: if(element->fir_filters) { - GValueArray *val_array; - val_array = g_value_array_new(element->channels - 1); - GValue val = G_VALUE_INIT; - g_value_init(&val, G_TYPE_VALUE_ARRAY); - int j; - for(j = 0; j < element->channels - 1; j++) { - g_value_take_boxed(&val, gstlal_g_value_array_from_doubles(element->fir_filters + j * element->fir_length, element->fir_length)); - g_value_array_append(val_array, &val); + GValue varray = G_VALUE_INIT; + g_value_init(&varray, GST_TYPE_ARRAY); + int m, n; + for(m = 0; m < element->channels - 1; m++) { + GValue varray_row = G_VALUE_INIT; + g_value_init(&varray_row, GST_TYPE_ARRAY); + for(n = 0; n < element->fir_length; n++) { + GValue val = G_VALUE_INIT; + g_value_init(&val, G_TYPE_DOUBLE); + g_value_set_double(&val, element->fir_filters[m * element->fir_length + n]); + gst_value_array_append_value(&varray_row, &val); + g_value_unset(&val); + } + gst_value_array_append_value(&varray, &varray_row); + g_value_unset(&varray_row); } - g_value_take_boxed(value, val_array); + g_value_copy(&varray, value); + g_value_unset(&varray); } break; @@ -2508,7 +2524,7 @@ static void gstlal_transferfunction_class_init(GSTLALTransferFunctionClass *klas 0, G_MAXDOUBLE, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT ); - properties[ARG_NOTCH_FREQUENCIES] = g_param_spec_value_array( + properties[ARG_NOTCH_FREQUENCIES] = gst_param_spec_array( "notch-frequencies", "Notch Frequencies", "Array of minima and maxima of frequency ranges where the Fourier transform\n\t\t\t" @@ -2534,11 +2550,11 @@ static void gstlal_transferfunction_class_init(GSTLALTransferFunctionClass *klas G_MININT64, G_MAXINT64, G_MAXINT64, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT ); - properties[ARG_TRANSFER_FUNCTIONS] = g_param_spec_value_array( + properties[ARG_TRANSFER_FUNCTIONS] = gst_param_spec_array( "transfer-functions", "Transfer Functions", "Array of the computed transfer functions", - g_param_spec_value_array( + gst_param_spec_array( "transfer-function", "Transfer Function", "A single transfer function", @@ -2553,11 +2569,11 @@ static void gstlal_transferfunction_class_init(GSTLALTransferFunctionClass *klas ), G_PARAM_READABLE | G_PARAM_STATIC_STRINGS ); - properties[ARG_FIR_FILTERS] = g_param_spec_value_array( + properties[ARG_FIR_FILTERS] = gst_param_spec_array( "fir-filters", "FIR Filters", "Array of the computed FIR filters", - g_param_spec_value_array( + gst_param_spec_array( "fir-filter", "FIR Filter", "A single FIR filter", diff --git a/gstlal-calibration/python/calibration_parts.py b/gstlal-calibration/python/calibration_parts.py index c5b8582a32b4a00465cb7eb1ca5df5a848caa91c..42949a434a63e0fb09f020fefb68deb3b947f751 100644 --- a/gstlal-calibration/python/calibration_parts.py +++ b/gstlal-calibration/python/calibration_parts.py @@ -16,6 +16,8 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +import os + from gstlal import pipeparts import numpy @@ -42,8 +44,16 @@ def mkcomplexqueue(pipeline, head, length = 0, min_length = 0): head = pipeparts.mktogglecomplex(pipeline, head) return head -def mkinsertgap(pipeline, head, bad_data_intervals = [-1e35, -1e-35, 1e-35, 1e35], insert_gap = False, remove_gap = True, replace_value = 0, fill_discont = True, block_duration = Gst.SECOND, chop_length = 0): - return pipeparts.mkgeneric(pipeline, head, "lal_insertgap", bad_data_intervals = bad_data_intervals, insert_gap = insert_gap, remove_gap = remove_gap, replace_value = replace_value, fill_discont = fill_discont, block_duration = int(block_duration), chop_length = int(chop_length)) +def mkinsertgap(pipeline, head, **properties): + if "bad_data_intervals" in properties: + # Make sure the array property bad-data-intervals is formatted correctly + intervals = properties.pop("bad_data_intervals") + if intervals is not None: + bad_data_intervals = [] + for i in range(0, len(intervals)): + bad_data_intervals.append(float(intervals[i])) + properties["bad_data_intervals"] = bad_data_intervals + return pipeparts.mkgeneric(pipeline, head, "lal_insertgap", **properties) #def mkupsample(pipeline, head, new_caps): # head = pipeparts.mkgeneric(pipeline, head, "lal_constantupsample") @@ -65,13 +75,81 @@ def mkresample(pipeline, head, quality, zero_latency, caps): return head def mkcomplexfirbank(pipeline, src, latency = None, fir_matrix = None, time_domain = None, block_stride = None): + if fir_matrix is not None: + # Make sure the fir matrix is formatted correctly + matrix = [] + for i in range(0, len(fir_matrix)): + firfilt = [] + for j in range(0, len(fir_matrix[i])): + firfilt.append(float(fir_matrix[i][j])) + matrix.append(firfilt) + fir_matrix = matrix properties = dict((name, value) for name, value in zip(("latency", "fir_matrix", "time_domain", "block_stride"), (latency, fir_matrix, time_domain, block_stride)) if value is not None) return pipeparts.mkgeneric(pipeline, src, "lal_complexfirbank", **properties) def mkcomplexfirbank2(pipeline, src, latency = None, fir_matrix = None, time_domain = None, block_stride = None): + if fir_matrix is not None: + # Make sure the fir matrix is formatted correctly + matrix = [] + for i in range(0, len(fir_matrix)): + firfilt = [] + for j in range(0, len(fir_matrix[i])): + firfilt.append(float(fir_matrix[i][j])) + matrix.append(firfilt) + fir_matrix = matrix properties = dict((name, value) for name, value in zip(("latency", "fir_matrix", "time_domain", "block_stride"), (latency, fir_matrix, time_domain, block_stride)) if value is not None) return pipeparts.mkgeneric(pipeline, src, "lal_complexfirbank2", **properties) +def mkfccupdate(pipeline, src, **properties): + if "fir_matrix" in properties: + # Make sure the fir matrix is formatted correctly + matrix = properties.pop("fir_matrix") + if matrix is not None: + fir_matrix = [] + for i in range(0, len(matrix)): + firfilt = [] + for j in range(0, len(matrix[i])): + firfilt.append(float(matrix[i][j])) + fir_matrix.append(firfilt) + properties["fir_matrix"] = fir_matrix + return pipeparts.mkgeneric(pipeline, src, "lal_fcc_update", **properties) + +def mktransferfunction(pipeline, src, **properties): + if "notch_frequencies" in properties: + # Make sure the array property notch-frequencies is formatted correctly + freqs = properties.pop("notch_frequencies") + if freqs is not None: + notch_frequencies = [] + for i in range(0, len(freqs)): + notch_frequencies.append(float(freqs[i])) + properties["notch_frequencies"] = notch_frequencies + return pipeparts.mkgeneric(pipeline, src, "lal_transferfunction", **properties) + +def mkadaptivefirfilt(pipeline, src, **properties): + # Make sure each array property is formatted correctly + if "static_filter" in properties: + staticfilt = properties.pop("static_filter") + if staticfilt is not None: + static_filter = [] + for i in range(0, len(staticfilt)): + static_filter.append(float(staticfilt[i])) + properties["static_filter"] = static_filter + if "static_zeros" in properties: + staticz = properties.pop("static_zeros") + if staticz is not None: + static_zeros = [] + for i in range(0, len(staticz)): + static_zeros.append(float(staticz[i])) + properties["static_zeros"] = static_zeros + if "static_poles" in properties: + staticp = properties.pop("static_poles") + if staticp is not None: + static_poles = [] + for i in range(0, len(staticp)): + static_poles.append(float(staticp[i])) + properties["static_poles"] = static_poles + return pipeparts.mkgeneric(pipeline, src, "lal_adaptivefirfilt", **properties) + def mkpow(pipeline, src, **properties): return pipeparts.mkgeneric(pipeline, src, "cpow", **properties) @@ -139,9 +217,9 @@ def write_graph(demux, pipeline, name): def hook_up(pipeline, demux, channel_name, instrument, buffer_length): if channel_name.endswith("UNCERTAINTY"): - head = mkinsertgap(pipeline, None, block_duration = 1000000000 * buffer_length, replace_value = 1) + head = mkinsertgap(pipeline, None, bad_data_intervals = [-1e35, -1e-35, 1e-35, 1e35], insert_gap = False, remove_gap = True, fill_discont = True, block_duration = int(1000000000 * buffer_length), replace_value = 1) else: - head = mkinsertgap(pipeline, None, block_duration = 1000000000 * buffer_length) + head = mkinsertgap(pipeline, None, bad_data_intervals = [-1e35, -1e-35, 1e-35, 1e35], insert_gap = False, remove_gap = True, fill_discont = True, block_duration = int(1000000000 * buffer_length), replace_value = 0) pipeparts.src_deferred_link(demux, "%s:%s" % (instrument, channel_name), head.get_static_pad("sink")) return head @@ -477,9 +555,9 @@ def compute_kappa_bits(pipeline, smoothR, smoothI, expected_real, expected_imag, expected_imag = expected_imag_sum / avg_samples if type(real_ok_var) is list: - smoothRInRange = mkinsertgap(pipeline, smoothR, bad_data_intervals = [real_ok_var[0], expected_real, expected_real, real_ok_var[1]], insert_gap = True, remove_gap = False) + smoothRInRange = mkinsertgap(pipeline, smoothR, bad_data_intervals = [real_ok_var[0], expected_real, expected_real, real_ok_var[1]], insert_gap = True, remove_gap = False, replace_value = 0, fill_discont = True, block_duration = Gst.SECOND) else: - smoothRInRange = mkinsertgap(pipeline, smoothR, bad_data_intervals = [expected_real - real_ok_var, expected_real, expected_real, expected_real + real_ok_var], insert_gap = True, remove_gap = False) + smoothRInRange = mkinsertgap(pipeline, smoothR, bad_data_intervals = [expected_real - real_ok_var, expected_real, expected_real, expected_real + real_ok_var], insert_gap = True, remove_gap = False, replace_value = 0, fill_discont = True, block_duration = Gst.SECOND) smoothRInRange = pipeparts.mkbitvectorgen(pipeline, smoothRInRange, nongap_is_control = True, bit_vector = status_out_smooth) smoothRInRange = pipeparts.mkcapsfilter(pipeline, smoothRInRange, "audio/x-raw, format=U32LE, rate=%d, channel-mask=(bitmask)0x0" % starting_rate) if starting_rate != ending_rate: @@ -488,9 +566,9 @@ def compute_kappa_bits(pipeline, smoothR, smoothI, expected_real, expected_imag, smoothRInRangetee = pipeparts.mktee(pipeline, smoothRInRange) if type(imag_ok_var) is list: - smoothIInRange = mkinsertgap(pipeline, smoothI, bad_data_intervals = [imag_ok_var[0], expected_imag, expected_imag, imag_ok_var[1]], insert_gap = True, remove_gap = False) + smoothIInRange = mkinsertgap(pipeline, smoothI, bad_data_intervals = [imag_ok_var[0], expected_imag, expected_imag, imag_ok_var[1]], insert_gap = True, remove_gap = False, replace_value = 0, fill_discont = True, block_duration = Gst.SECOND) else: - smoothIInRange = mkinsertgap(pipeline, smoothI, bad_data_intervals = [expected_imag - imag_ok_var, expected_imag, expected_imag, expected_imag + imag_ok_var], insert_gap = True, remove_gap = False) + smoothIInRange = mkinsertgap(pipeline, smoothI, bad_data_intervals = [expected_imag - imag_ok_var, expected_imag, expected_imag, expected_imag + imag_ok_var], insert_gap = True, remove_gap = False, replace_value = 0, fill_discont = True, block_duration = Gst.SECOND) smoothIInRange = pipeparts.mkbitvectorgen(pipeline, smoothIInRange, nongap_is_control = True, bit_vector = status_out_smooth) smoothIInRange = pipeparts.mkcapsfilter(pipeline, smoothIInRange, "audio/x-raw, format=U32LE, rate=%d, channel-mask=(bitmask)0x0" % starting_rate) if starting_rate != ending_rate: @@ -513,9 +591,9 @@ def compute_kappa_bits_only_real(pipeline, smooth, expected, ok_var, median_samp expected = expected_sum / avg_samples if type(ok_var) is list: - smoothInRange = mkinsertgap(pipeline, smooth, bad_data_intervals = [ok_var[0], expected, expected, ok_var[1]], insert_gap = True, remove_gap = False) + smoothInRange = mkinsertgap(pipeline, smooth, bad_data_intervals = [ok_var[0], expected, expected, ok_var[1]], insert_gap = True, remove_gap = False, replace_value = 0, fill_discont = True, block_duration = Gst.SECOND) else: - smoothInRange = mkinsertgap(pipeline, smooth, bad_data_intervals = [expected - ok_var, expected, expected, expected + ok_var], insert_gap = True, remove_gap = False) + smoothInRange = mkinsertgap(pipeline, smooth, bad_data_intervals = [expected - ok_var, expected, expected, expected + ok_var], insert_gap = True, remove_gap = False, replace_value = 0, fill_discont = True, block_duration = Gst.SECOND) smoothInRange = pipeparts.mkbitvectorgen(pipeline, smoothInRange, nongap_is_control = True, bit_vector = status_out_smooth) smoothInRange = pipeparts.mkcapsfilter(pipeline, smoothInRange, "audio/x-raw, format=U32LE, rate=%d, channel-mask=(bitmask)0x0" % starting_rate) if starting_rate != ending_rate: @@ -969,7 +1047,7 @@ def clean_data(pipeline, signal, signal_rate, witnesses, witness_rate, fft_lengt transfer_functions = mkinterleave(pipeline, numpy.insert(witness_tees, 0, resampled_signal, axis = 0)) if noisesub_gate_bit is not None: transfer_functions = mkgate(pipeline, transfer_functions, noisesub_gate_bit, 1) - transfer_functions = pipeparts.mkgeneric(pipeline, transfer_functions, "lal_transferfunction", fft_length = fft_length, fft_overlap = fft_overlap, num_ffts = num_ffts, min_ffts = min_ffts, update_samples = update_samples, make_fir_filters = -1, fir_length = fir_length, frequency_resolution = frequency_resolution, high_pass = high_pass / 2.0, update_after_gap = True, use_median = use_median, parallel_mode = parallel_mode, notch_frequencies = notch_frequencies, use_first_after_gap = critical_lock_loss_time * witness_rate, update_delay_samples = int(delay_time * witness_rate), fir_timeshift = 0, filename = filename) + transfer_functions = mktransferfunction(pipeline, transfer_functions, fft_length = fft_length, fft_overlap = fft_overlap, num_ffts = num_ffts, min_ffts = min_ffts, update_samples = update_samples, make_fir_filters = -1, fir_length = fir_length, frequency_resolution = frequency_resolution, high_pass = high_pass / 2.0, update_after_gap = True, use_median = use_median, parallel_mode = parallel_mode, notch_frequencies = notch_frequencies, use_first_after_gap = critical_lock_loss_time * witness_rate, update_delay_samples = int(delay_time * witness_rate), fir_timeshift = 0, filename = filename) signal_minus_noise = [signal_tee] for i in range(0, len(witnesses)): if parallel_mode: diff --git a/gstlal-calibration/tests/check_calibration/Makefile b/gstlal-calibration/tests/check_calibration/Makefile index eecf62c944b214334a0a71c705d1988a8220ff3e..07cdf72644ec5416b91f4c60912aa326c52e6925 100644 --- a/gstlal-calibration/tests/check_calibration/Makefile +++ b/gstlal-calibration/tests/check_calibration/Makefile @@ -4,15 +4,15 @@ ################################# # which interferometer (H or L) -IFO = H +IFO = L # determines where to look for filters files (e.g., O1, O2, O3, ER10, ER13, ER14, PreER10, PreER13, PreER14) OBSRUN = ER13 -START = $(shell echo 1231728640 - 715 | bc) +START = $(shell echo 1231151104 - 715 | bc) #1229094912 #1225967424 #1185763328 -END = $(shell echo 1231732736 + 715 | bc) +END = $(shell echo 1231155200 + 715 | bc) #1229099008 #1225968448 #1185771520 @@ -21,15 +21,15 @@ SHMRUNTIME = 400 PLOT_WARMUP_TIME = 1715 PLOT_COOLDOWN_TIME = 715 -GDSCONFIGS = Filters/ER13/GDSFilters/H1GDS_TEST_1231802073.ini -DCSCONFIGS = Filters/ER13/GDSFilters/H1DCS_TEST_1231802073.ini +GDSCONFIGS = Filters/ER13/GDSFilters/L1GDS_TEST_1231802073.ini +DCSCONFIGS = Filters/ER13/GDSFilters/L1DCS_TEST_1231620000.ini #../../config_files/O2/H1/tests/H1DCS_AllCorrections_Cleaning.ini DCSFCCCONFIGS = ../../config_files/O2/H1/tests/H1DCS_FreqIndepAndFccCorrections_Cleaning.ini GDSTESTCONFIGS = ../../config_files/PreER13/H1/H1GDS_TEST_1225558818.ini DCSTESTCONFIGS = ../../config_files/O2/H1/tests/H1DCS_AllCorrections_Cleaning_TEST.ini GDSSHMCONFIGS = ../../config_files/PreER13/H1/tests/H1GDS_1222058826_shm2frames.ini -all: noise_subtraction_ASD_GDS noise_subtraction_tf_GDS +all: noise_subtraction_ASD_DCS filters_tf_DCS noise_subtraction_tf_DCS ############################################### ### These commands should change less often ### diff --git a/gstlal-calibration/tests/check_calibration/frame_manipulator.py b/gstlal-calibration/tests/check_calibration/frame_manipulator.py index a388b08c15ef4a4863bacc4e08deeceac50ae39f..cae7479b676e2ef6a6494f894fe2548cc1f2b714 100644 --- a/gstlal-calibration/tests/check_calibration/frame_manipulator.py +++ b/gstlal-calibration/tests/check_calibration/frame_manipulator.py @@ -156,13 +156,22 @@ channel_list.append("CAL-PCALY_RX_PD_OUT_DQ") channel_list.append("CAL-PCALY_TX_PD_OUT_DQ") channel_list.append("CAL-PCALX_RX_PD_OUT_DQ") channel_list.append("CAL-PCALX_TX_PD_OUT_DQ") +channel_list.append("CAL-CS_TDEP_DARM_LINE1_COMPARISON_OSC_FREQ") channel_list.append("CAL-CS_TDEP_SUS_LINE1_COMPARISON_OSC_FREQ") channel_list.append("CAL-CS_TDEP_SUS_LINE2_COMPARISON_OSC_FREQ") channel_list.append("CAL-CS_TDEP_SUS_LINE3_COMPARISON_OSC_FREQ") channel_list.append("CAL-CS_TDEP_PCAL_LINE1_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALY_LINE1_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALX_LINE1_COMPARISON_OSC_FREQ") channel_list.append("CAL-CS_TDEP_PCAL_LINE2_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALY_LINE2_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALX_LINE2_COMPARISON_OSC_FREQ") channel_list.append("CAL-CS_TDEP_PCAL_LINE3_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALY_LINE3_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALX_LINE3_COMPARISON_OSC_FREQ") channel_list.append("CAL-CS_TDEP_PCAL_LINE4_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALY_LINE4_COMPARISON_OSC_FREQ") +channel_list.append("CAL-CS_TDEP_PCALX_LINE4_COMPARISON_OSC_FREQ") channel_list.append("PEM-EY_MAINSMON_EBAY_1_DQ") channel_list.append("CAL-CS_TDEP_PCAL_LINE1_CORRECTION_REAL") channel_list.append("CAL-CS_TDEP_PCAL_LINE1_CORRECTION_IMAG") @@ -270,7 +279,7 @@ channel_list.append("CAL-CS_TDEP_F_C_OUTPUT") channel_list.append("CAL-CS_TDEP_F_S_OUTPUT") channel_list.append("CAL-CS_TDEP_Q_S_OUTPUT") channel_list.append("GRD-IFO_OK") -channel_list.append("ISC_LOCK_STATE_N") +#channel_list.append("ISC_LOCK_STATE_N") channel_list.append("ISC_LOCK_STATUS") channel_list.append("GRD-ISC_LOCK_OK") channel_list.append("GRD-ISC_LOCK_ERROR")