diff --git a/gstlal-calibration/gst/lal/gstlal_trackfrequency.c b/gstlal-calibration/gst/lal/gstlal_trackfrequency.c index 8ba1417a30951168f5cf69e911bb814a21a381e9..28ace16912053d04ef6671f2048444ab77b662df 100644 --- a/gstlal-calibration/gst/lal/gstlal_trackfrequency.c +++ b/gstlal-calibration/gst/lal/gstlal_trackfrequency.c @@ -93,13 +93,21 @@ static void trackfrequency_ ## DTYPE(const DTYPE *src, DTYPE *dst, gint64 size, if(*sign == 0) { \ if(*src < 0) \ *sign = -1; \ - else \ + else if(*src > 0) \ *sign = 1; \ } \ \ gint64 i = 0; \ gint64 j = 0; \ double fractional_sample; \ + \ + /* Check if input is zeros. If so, clear element's history except for the current frequency. */ \ + if(*src == 0.0) { \ + *check_step = 1; \ + *sign = 0; \ + *num_stored = 0; \ + } \ + \ while(i < size - 1) { \ \ gboolean shift = FALSE; \ @@ -178,13 +186,21 @@ static void trackfrequency_complex_ ## DTYPE(const DTYPE complex *src, DTYPE *ds if(*sign == 0) { \ if(creal ## F_OR_BLANK(*src) < 0) \ *sign = -1; \ - else \ + else if(creal ## F_OR_BLANK(*src) > 0) \ *sign = 1; \ } \ \ gint64 i = 0; \ gint64 j = 0; \ double fractional_sample; \ + \ + /* Check if input is zeros. If so, clear element's history except for the current frequency. */ \ + if(*src == 0.0) { \ + *check_step = 1; \ + *sign = 0; \ + *num_stored = 0; \ + } \ + \ while(i < size - 1) { \ \ gboolean shift = FALSE; \ diff --git a/gstlal-calibration/tests/check_calibration/ASD_plots b/gstlal-calibration/tests/check_calibration/ASD_plots index bf7c26c9c18b7243f3395a7815e851f15b8e353e..a397c4fc4ea8c0efa11751228c3b6f292537e2fa 100755 --- a/gstlal-calibration/tests/check_calibration/ASD_plots +++ b/gstlal-calibration/tests/check_calibration/ASD_plots @@ -99,7 +99,7 @@ if options.write_ASD_txt: numpy.savetxt("%s_%s_ASD_%d_%d%s.txt" % (ifo, channel_list[i], start_time, end_time, options.filename_suffix), asd_txt) # Plot ASDs -colors = ['darkmagenta', 'orchid', "royalblue", "deepskyblue", "red", "yellow", "purple", "pink"] +colors = ['blue', 'limegreen', "royalblue", "deepskyblue", "red", "yellow", "purple", "pink"] if len(ASD_title): plot = ASDs[0].plot(color = colors[0], title = "%s" % ASD_title, linewidth = 0.75, label = ASD_labels[0]) else: diff --git a/gstlal-calibration/tests/check_calibration/Makefile b/gstlal-calibration/tests/check_calibration/Makefile index ce134a2b3900f06b91e41a589b447f16161b4541..177ecc387976041542c3dc3b1eae096f374bd4a5 100644 --- a/gstlal-calibration/tests/check_calibration/Makefile +++ b/gstlal-calibration/tests/check_calibration/Makefile @@ -8,11 +8,11 @@ IFO = H # determines where to look for filters files (e.g., O1, O2, O3, ER10, ER13, ER14, PreER10, PreER13, PreER14) OBSRUN = O3 -START = $(shell echo 1239840000 - 364 | bc) +START = $(shell echo 1241208018 | bc) #1229094912 #1225967424 #1185763328 -END = $(shell echo 1239926400 + 364 | bc) +END = $(shell echo 1241209018 | bc) #1229099008 #1225968448 #1185771520 @@ -21,7 +21,7 @@ SHMRUNTIME = 36000 PLOT_WARMUP_TIME = 364 PLOT_COOLDOWN_TIME = 364 -GDSCONFIGS = Filters/O3/GDSFilters/H1GDS_1239476409_test.ini +GDSCONFIGS = Filters/O3/GDSFilters/H1GDS_1240326116_test.ini DCSCONFIGS = Filters/O3/GDSFilters/H1DCS_test.ini DCSLINESCONFIGS = ../../config_files/O2/H1/tests/H1DCS_AllCorrections_CleaningLines.ini #../../config_files/O2/H1/tests/H1DCS_AllCorrections_Cleaning.ini @@ -33,7 +33,7 @@ GDSOLDCONFIGS = Filters/ER14/GDSFilters/L1GDS_1235491416_old.ini GDSBETTERCONFIGS = Filters/ER14/GDSFilters/L1GDS_1235491416_better.ini GDSBESTCONFIGS = Filters/ER14/GDSFilters/L1GDS_1235491416_best.ini -all: noise_subtraction_ASD_C00 +all: $(IFO)1_hoft_GDS_frames.cache ############################################### ### These commands should change less often ### @@ -75,7 +75,7 @@ $(IFO)1_clean_C02_frames.cache: gw_data_find -o $(IFO) -t $(IFO)1_CLEANED_HOFT_C02 -s $(START) -e $(END) -l --url-type file > $@ $(IFO)1_hoft_GDS_frames.cache: $(IFO)1_easy_raw_frames.cache filters framesdir - GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-cache $(IFO)1_easy_raw_frames.cache --output-path Frames/$(OBSRUN)/$(IFO)1/GDS/ --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(GDSCONFIGS) + #GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-cache $(IFO)1_easy_raw_frames.cache --output-path Frames/$(OBSRUN)/$(IFO)1/GDS/ --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(GDSCONFIGS) ls Frames/$(OBSRUN)/$(IFO)1/GDS/$(IFO)-$(IFO)1GDS-*.gwf | lalapps_path2cache > $@ $(IFO)1_hoft_DCS_frames.cache: $(IFO)1_easy_raw_frames.cache filters framesdir @@ -162,17 +162,22 @@ DCS_over_C02: $(IFO)1_hoft_DCS_frames.cache $(IFO)1_C02_frames.cache kappastimeseries_GDS: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_easy_raw_frames.cache python timeserieskappas.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache $(IFO)1_hoft_GDS_frames.cache --channel-list 'GDS-CALIB_KAPPA_TST_REAL_NOGATE','GDS-CALIB_KAPPA_TST_IMAGINARY_NOGATE','GDS-CALIB_KAPPA_PUM_REAL_NOGATE','GDS-CALIB_KAPPA_PUM_IMAGINARY_NOGATE','GDS-CALIB_KAPPA_UIM_REAL_NOGATE','GDS-CALIB_KAPPA_UIM_IMAGINARY_NOGATE','GDS-CALIB_KAPPA_C_NOGATE','GDS-CALIB_F_CC_NOGATE' --raw-channel-list 'CAL-CS_TDEP_KAPPA_TST_REAL_OUTPUT','CAL-CS_TDEP_KAPPA_TST_IMAG_OUTPUT','CAL-CS_TDEP_KAPPA_PUM_REAL_OUTPUT','CAL-CS_TDEP_KAPPA_PUM_IMAG_OUTPUT','CAL-CS_TDEP_KAPPA_UIM_REAL_OUTPUT','CAL-CS_TDEP_KAPPA_UIM_IMAG_OUTPUT','CAL-CS_TDEP_KAPPA_C_OUTPUT','CAL-CS_TDEP_F_C_OUTPUT' --raw-frame-cache $(IFO)1_easy_raw_frames.cache +SRC_detuning_C00: + #$(IFO)1_C00_frames.cache + python timeserieskappas.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache $(IFO)1_C00_frames.cache --channel-list 'GDS-CALIB_F_S_SQUARED,GDS-CALIB_SRC_Q_INVERSE' + noise_subtraction_ASD_DCS: $(IFO)1_hoft_DCS_frames.cache ./ASD_plots --ifo $(IFO)1 --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --frame-cache-list '$(IFO)1_hoft_DCS_frames.cache,$(IFO)1_hoft_DCS_frames.cache' --channel-list 'DCS-CALIB_STRAIN,DCS-CALIB_STRAIN_CLEAN' --ASD-fmin 0.3 noise_subtraction_ASD_DCS_LINES: $(IFO)1_hoft_DCS_frames.cache ./ASD_plots --ifo $(IFO)1 --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --frame-cache-list '$(IFO)1_hoft_DCS_frames.cache,$(IFO)1_hoft_DCS_frames.cache' --channel-list 'DCS-CALIB_STRAIN,DCS-CALIB_STRAIN_CLEAN' --ASD-fmin 0.3 -noise_subtraction_ASD_GDS: $(IFO)1_hoft_GDS_frames.cache - ./ASD_plots --ifo $(IFO)1 --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --raw-frame-cache $(IFO)1_hoft_GDS_frames.cache --calcs-channel-name GDS-CALIB_STRAIN --hoft-frame-cache $(IFO)1_hoft_GDS_frames.cache --hoft-channel-name GDS-CALIB_STRAIN_CLEAN +noise_subtraction_ASD_GDS: + #$(IFO)1_hoft_GDS_frames.cache + ./ASD_plots --ifo $(IFO)1 --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --frame-cache-list '$(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames.cache' --channel-list 'GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_CLEAN' --ASD-fmin 1.0 noise_subtraction_ASD_C00: $(IFO)1_C00_frames.cache - ./ASD_plots --ifo $(IFO)1 --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --frame-cache-list '$(IFO)1_C00_frames.cache,$(IFO)1_C00_frames.cache' --channel-list 'GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_CLEAN' + ./ASD_plots --ifo $(IFO)1 --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --frame-cache-list '$(IFO)1_C00_frames.cache,$(IFO)1_C00_frames.cache' --channel-list 'GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_CLEAN' --ASD-fmin 1.0 highpass_filter_ASD_GDS: #$(IFO)1_hoft_GDS_OLD_frames.cache $(IFO)1_hoft_GDS_BETTER_frames.cache $(IFO)1_hoft_GDS_BEST_frames.cache diff --git a/gstlal-calibration/tests/check_calibration/demod_ratio_timeseries.py b/gstlal-calibration/tests/check_calibration/demod_ratio_timeseries.py index f482ccedd16f8d9a2cadca5b277a09921bed895d..598a541c8c1d70a58da20b7fb6e7f7e7cdd706cb 100644 --- a/gstlal-calibration/tests/check_calibration/demod_ratio_timeseries.py +++ b/gstlal-calibration/tests/check_calibration/demod_ratio_timeseries.py @@ -66,6 +66,8 @@ from ligo import segments parser = OptionParser() parser.add_option("--gps-start-time", metavar = "seconds", type = int, help = "GPS time at which to start processing data") parser.add_option("--gps-end-time", metavar = "seconds", type = int, help = "GPS time at which to stop processing data") +parser.add_option("--stride-time", metavar = "seconds", type = int, help = "Time in seconds between the start times of consecutive chunks of data to measure") +parser.add_option("--chunk-time", metavar = "seconds", type = int, help = "Duration in seconds of continuous chunks of data to be measured") parser.add_option("--ifo", metavar = "name", type = str, help = "Name of the interferometer (IFO), e.g., H1, L1") parser.add_option("--denominator-frame-cache", metavar = "name", type = str, help = "Frame cache file that contains denominator") parser.add_option("--numerator-frame-cache", metavar = "name", type = str, help = "Frame cache file that contains numerator") @@ -98,6 +100,10 @@ for i in range(0, len(freq_list)): filter_time = options.filter_time average_time = options.average_time rate_out = 1 +chunk_time = options.chunk_time +stride_time = options.stride_time +num_chunks = numpy.floor((options.gps_end_time - options.gps_start_time - chunk_time) / stride_time) if chunk_time < stride_time else 0 + # # ============================================================================= diff --git a/gstlal-calibration/tests/check_calibration/timeserieskappas.py b/gstlal-calibration/tests/check_calibration/timeserieskappas.py index 172b4505a92ba60c2905f903433e7670ad15518f..a6927b25204bdc18551c5bd6fe72dc67595a1383 100644 --- a/gstlal-calibration/tests/check_calibration/timeserieskappas.py +++ b/gstlal-calibration/tests/check_calibration/timeserieskappas.py @@ -55,6 +55,10 @@ for n, channel in enumerate(channels): #title = item #title = title.replace('_', '\_') ax.set_title(channel.replace('_', '\_')) + if 'F_S_SQUARED' in channel: + ax.set_ylim(-100,100) + elif 'SRC_Q_INVERSE' in channel: + ax.set_ylim(-2,2) #plot.add_state_segments(segs, plotargs=dict(label='Calibrated')) - plot.legend([r'GDS value', r'front-end value']) + #plot.legend([r'GDS value', r'front-end value']) plot.savefig('%s_%s_%s_plot_%s.png' % (ifo, options.gps_start_time, options.gps_end_time, channel))