diff --git a/bin/gstlal_compute_strain b/bin/gstlal_compute_strain index 491f4b668769d75ce8fca13e9fecfaad24b0af92..ea6bdd9b22f6d3ee7e4e561ccdf001365e64e039 100755 --- a/bin/gstlal_compute_strain +++ b/bin/gstlal_compute_strain @@ -56,6 +56,7 @@ import sys import numpy import time import resource +import hashlib from optparse import OptionParser, Option import configparser @@ -117,6 +118,15 @@ def is_number(s): except ValueError: return False +# +# Function definition to get sha256 checksum of a file +# + +def file_sha256_int(path): + with open(path, 'rb') as f: + hexsha = hashlib.sha256(f.read()).hexdigest() + return int(hexsha[:7], 16) + ############################################################################# ##################### Program Command Line Options ########################## ############################################################################# @@ -444,12 +454,7 @@ if write_config_info: configs_git_commit_hash = int(configs_git_commit_hash[:7], 16) except: configs_git_commit_hash = 0 - calib_report_id = 0 - if "report_id" in filters: - calib_report_id = int(filters["report_id"]) - calib_report_hash = 0 - if "report_hash" in filters: - calib_report_hash = int(filters["report_hash"]) + filters_sha256 = file_sha256_int(filters_name) filters_tagstr = "filters=%s" % filters_name # Additional info requested from the filters file filters_info = OutputConfigs["filtersinfo"] if "filtersinfo" in OutputConfigs else None @@ -2720,12 +2725,9 @@ if write_config_info and compute_calib_statevector: calib_config_hash = calibration_parts.mkinsertgap(pipeline, calibstatevector, bad_data_intervals = [0.1, 0.2], insert_gap = False, remove_gap = True, replace_value = configs_git_commit_hash) calib_config_hash = pipeparts.mkprogressreport(pipeline, calib_config_hash, "progress_calib_config_hash_%s" % instrument) calib_config_hash = pipeparts.mktaginject(pipeline, calib_config_hash, "remote_repository_url=%s" % configs_url) - calib_report_id_stream = calibration_parts.mkinsertgap(pipeline, calibstatevector, bad_data_intervals = [0.1, 0.2], insert_gap = False, remove_gap = True, replace_value = calib_report_id) - calib_report_id_stream = pipeparts.mkprogressreport(pipeline, calib_report_id_stream, "progress_calib_report_id_stream_%s" % instrument) - calib_report_id_stream = pipeparts.mktaginject(pipeline, calib_report_id_stream, filters_tagstr) - calib_report_hash_stream = calibration_parts.mkinsertgap(pipeline, calibstatevector, bad_data_intervals = [0.1, 0.2], insert_gap = False, remove_gap = True, replace_value = calib_report_hash) - calib_report_hash_stream = pipeparts.mkprogressreport(pipeline, calib_report_hash_stream, "progress_calib_report_hash_stream_%s" % instrument) - calib_report_hash_stream = pipeparts.mktaginject(pipeline, calib_report_hash_stream, filters_tagstr) + filters_sha256_stream = calibration_parts.mkinsertgap(pipeline, calibstatevector, bad_data_intervals = [0.1, 0.2], insert_gap = False, remove_gap = True, replace_value = filters_sha256) + filters_sha256_stream = pipeparts.mkprogressreport(pipeline, filters_sha256_stream, "progress_filters_sha256_stream_%s" % instrument) + filters_sha256_stream = pipeparts.mktaginject(pipeline, filters_sha256_stream, filters_tagstr) gstlal_calibration_version = calibration_parts.mkinsertgap(pipeline, calibstatevector, bad_data_intervals = [0.1, 0.2], insert_gap = False, remove_gap = True, replace_value = gstlal_calibration_version) gstlal_calibration_version = pipeparts.mkprogressreport(pipeline, gstlal_calibration_version, "progress_gstlal_calibration_version_%s" % instrument) @@ -2983,8 +2985,7 @@ if compute_calib_statevector: # Link the config info channels to the muxer if write_config_info and compute_calib_statevector: channelmux_input_dict["%s:%sCALIB_GSTLAL_CONFIG_HASH_INT%s" % (instrument, chan_prefix, chan_suffix)] = calibration_parts.mkqueue(pipeline, calib_config_hash, length = queue_length) - channelmux_input_dict["%s:%sCALIB_REPORT_ID_INT%s" % (instrument, chan_prefix, chan_suffix)] = calibration_parts.mkqueue(pipeline, calib_report_id_stream, length = queue_length) - channelmux_input_dict["%s:%sCALIB_REPORT_HASH_INT%s" % (instrument, chan_prefix, chan_suffix)] = calibration_parts.mkqueue(pipeline, calib_report_hash_stream, length = queue_length) + channelmux_input_dict["%s:%sCALIB_REPORT_GDS_HASH_INT%s" % (instrument, chan_prefix, chan_suffix)] = calibration_parts.mkqueue(pipeline, filters_sha256_stream, length = queue_length) channelmux_input_dict["%s:%sCALIB_GSTLAL_CALIBRATION_VERSION_INT%s" % (instrument, chan_prefix, chan_suffix)] = calibration_parts.mkqueue(pipeline, gstlal_calibration_version, length = queue_length) # Link the strain branch to the muxer channelmux_input_dict["%s:%sCALIB_STRAIN%s" % (instrument, chan_prefix, chan_suffix)] = calibration_parts.mkqueue(pipeline, strain, length = queue_length) diff --git a/tests/check_calibration/Makefile b/tests/check_calibration/Makefile index fc0f92055c9685b2ca6a04b1a4c76fd53425e0df..6ebfcf0a04c2ce7e7648d7e77dc179671275f334 100644 --- a/tests/check_calibration/Makefile +++ b/tests/check_calibration/Makefile @@ -10,7 +10,7 @@ OBSRUN = O3 # Determines whether to find calibration filters in the old SVN or the git repo. Starting with PreER15 and O4, we switched to the git repo. Set to 'svn' or 'git'. FILTERSRC = svn -START = $(shell echo 1371862818 | bc) +START = $(shell echo 1371895218 | bc) # 1371862818 oversubtraction study # 1266880202 Comb # 1266605804 H1 BB inj @@ -19,7 +19,7 @@ START = $(shell echo 1371862818 | bc) # 1238288418 # 1269090018 # 1269114645-21449 -END = $(shell echo 1371911734 | bc) +END = $(shell echo 1371909618 | bc) # 1371911734 oversubtraction study # 1266888034 Comb # 1266606486 H1 BB inj @@ -35,8 +35,8 @@ PLOT_COOLDOWN_TIME = 1000 GDSCONFIGS = Filters/O3/GDSFilters/gstlal_compute_strain_C00_offlineTest_H1.ini GDSSHORTTFCONFIGS = Filters/O3/GDSFilters/gstlal_compute_strain_C00_offlineTest_H1_shortTF.ini GDSLONGTFCONFIGS = Filters/O3/GDSFilters/gstlal_compute_strain_C00_offlineTest_H1_longTF.ini -GDSAPPROXKAPPASCONFIGS = Filters/O3/GDSFilters/H1GDS_1362848367_PreO4test_ApproxKappas.ini -GDSEXACTKAPPASCONFIGS = Filters/O3/GDSFilters/H1GDS_1362848367_PreO4test_ExactKappas.ini +GDSAPPROXKAPPASCONFIGS = Filters/O3/GDSFilters/gstlal_compute_strain_C00_testApprox_H1.ini +GDSEXACTKAPPASCONFIGS = Filters/O3/GDSFilters/gstlal_compute_strain_C00_testExact_H1.ini DCSAPPROXKAPPASCONFIGS = Filters/O3/GDSFilters/H1DCS_test_1256655618_v2_approxKappas.ini #Filters/O3/GDSFilters/H1DCS_20230407_testing_ApproxKappas.ini DCSEXACTKAPPASCONFIGS = Filters/O3/GDSFilters/H1DCS_test_1256655618_v2_exactKappas.ini @@ -78,7 +78,7 @@ GDSSHMCONFIGS = Filters/O3/GDSFilters/H1GDS_1258216456_testing.ini GDSOLDCONFIGS = Filters/ER14/GDSFilters/L1GDS_1235491416_old.ini EASYRAWFILTERS = H1DCS_20230407_testing.npz -all: noise_subtraction_ASD_GDS2 noise_subtraction_ASD_GDS3 noise_subtraction_ASD_GDS4 noise_subtraction_ASD_GDS5 noise_subtraction_ASD_GDS6 noise_subtraction_ASD_GDS7 +all: GDSEXACTKAPPAS_pcal2darm_plots GDSEXACTKAPPAS_act2darm_plots # state_vector_plot # DARM_over_ASC_callines # TDCFs_pcal2darm_plots @@ -390,37 +390,29 @@ noise_channels_ASD_DCS: 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 $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 512 --fft-spacing 256 --window=0 --freq-res 0.05 --frequency-min 1 --frequency-max=8192 --ASD-max=1e-17 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 512 --fft-spacing 256 --window=0 --freq-res 0.05 --frequency-min 1 --frequency-max=8192 --ASD-max=1e-17 --labels 'strain,128s\ estimate,4096s\ estimate,switch' -noise_subtraction_ASD_GDS1: - #$(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 410.27 --frequency-max=410.33 --ASD-max=1e-19 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS1: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 410.27 --frequency-max=410.33 --ASD-max=1e-19 --labels 'strain,128s\ estimate,4096s\ estimate,switch' -noise_subtraction_ASD_GDS2: - #$(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 15.5 --frequency-max=18 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS2: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 15.5 --frequency-max=18 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'strain,128s\ estimate,4096s\ estimate,switch' -noise_subtraction_ASD_GDS3: - #$(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 15.57 --frequency-max=15.63 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS3: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 15.57 --frequency-max=15.63 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'strain,128s\ estimate,4096s\ estimate,switch' -noise_subtraction_ASD_GDS4: - #$(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 16.37 --frequency-max=16.43 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS4: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 16.37 --frequency-max=16.43 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'strain,128s\ estimate,4096s\ estimate,switch' -noise_subtraction_ASD_GDS5: - #$(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 17.07 --frequency-max=17.13 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS5: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 17.07 --frequency-max=17.13 --ASD-min=1e-22 --ASD-max=1e-18 --labels 'strain,128s\ estimate,4096s\ estimate,switch' -noise_subtraction_ASD_GDS6: - #$(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 33.4 --frequency-max=33.46 --ASD-min=1e-23 --ASD-max=1e-19 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS6: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 33.4 --frequency-max=33.46 --ASD-min=1e-23 --ASD-max=1e-19 --labels 'strain,128s\ estimate,4096s\ estimate,switch' -noise_subtraction_ASD_GDS7: - #$(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache - python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 59.5 --frequency-max=60.5 --ASD-max=1e-21 --labels 'STRAIN,NOLINES,LONGERTF,SWITCH' +noise_subtraction_ASD_GDS7: $(IFO)1_hoft_GDS_frames.cache $(IFO)1_hoft_GDS_frames_shortTF.cache $(IFO)1_hoft_GDS_frames_longTF.cache + python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_hoft_GDS_frames.cache,$(IFO)1_hoft_GDS_frames_shortTF.cache,$(IFO)1_hoft_GDS_frames_longTF.cache,$(IFO)1_hoft_GDS_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 4096 --fft-spacing 2048 --freq-res 0.001 --frequency-min 59.5 --frequency-max=60.5 --ASD-max=1e-21 --labels 'strain,128s\ estimate,4096s\ estimate,switch' noise_subtraction_ASD_C00: $(IFO)1_C00_frames.cache python3 plot_ASD.py --gps-start-time $(PLOT_START) --gps-end-time $(PLOT_END) --ifo $(IFO)1 --frame-cache-list $(IFO)1_C00_frames.cache,$(IFO)1_C00_frames.cache --channel-list GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES --sample-rate 16384 --fft-time 16 --fft-spacing 8 --freq-res 0.25 --frequency-min 0.1 --frequency-max=8192 --ASD-max=1e-14 --labels 'GDS-CALIB_STRAIN,GDS-CALIB_STRAIN_NOLINES' diff --git a/tests/check_calibration/plot_ASD.py b/tests/check_calibration/plot_ASD.py index 23d5fb753c6570e7aebfd46c15037285a54f343a..557fd1c5942244bdd8bee1f972cd164b5be7bec4 100644 --- a/tests/check_calibration/plot_ASD.py +++ b/tests/check_calibration/plot_ASD.py @@ -248,6 +248,7 @@ for i in range(0, len(labels)): plt.ylabel(r'${\rm ASD}\ \left[{\rm strain / }\sqrt{\rm Hz}\right]$') plt.xlabel(r'${\rm Frequency \ [Hz]}$') ticks_and_grid(plt.gca(), xmin = options.frequency_min, xmax = options.frequency_max, ymin = options.ASD_min, ymax = options.ASD_max, xscale = freq_scale, yscale = ASD_scale) + plt.tight_layout() plt.savefig('%s_%s_ASD_%d-%dHz_%d-%d.png' % (ifo, labels[i].replace(' ', '_'), int(options.frequency_min), int(options.frequency_max), options.gps_start_time, options.gps_end_time - options.gps_start_time)) plt.savefig('%s_%s_ASD_%d-%dHz_%d-%d.pdf' % (ifo, labels[i].replace(' ', '_'), int(options.frequency_min), int(options.frequency_max), options.gps_start_time, options.gps_end_time - options.gps_start_time)) diff --git a/tests/line_subtraction_ringing.py b/tests/line_subtraction_ringing.py index 2c2c120aeb6a7cdccb30758c290234fecd71da96..c8214bb66826c006da54b5785bc7fbef243c161c 100755 --- a/tests/line_subtraction_ringing.py +++ b/tests/line_subtraction_ringing.py @@ -61,8 +61,8 @@ from ticks_and_grid import ticks_and_grid # Constants freq = 20.3 # Hz test_duration = 400000 # seconds -amplitude_mod = 0.0002 -phase_mod = 0.0002 +amplitude_mod = 0.02 +phase_mod = 0.02 avg_time = 1 # seconds med_time = 4096 # seconds other_lines = []#[10.301, 10.295, 10.31, 10.28] # Hz @@ -100,11 +100,11 @@ def line_subtraction_ringing_01(pipeline, name): # The signal in the data, which may not be a pure sinusoid, but could have amplitude and/or phase modulation. amplitude = test_common.test_src(pipeline, rate = 16, test_duration = test_duration, wave = 0, src_suffix = '2', volume = 0) - amplitude = pipeparts.mkgeneric(pipeline, amplitude, "lal_add_constant", value = 100) + amplitude = pipeparts.mkgeneric(pipeline, amplitude, "lal_add_constant", value = 1) # Slow modulation (changes on ~2500s timescale) amp_mod = test_common.test_src(pipeline, rate = 16, test_duration = test_duration, wave = 5, src_suffix = '3') amp_mod = pipeparts.mkgeneric(pipeline, amp_mod, "lal_smoothkappas", array_size = 1, avg_array_size = 16 * 2500, default_kappa_re = 0) - amp_mod = pipeparts.mkaudioamplify(pipeline, amp_mod, amplitude_mod * 4 * 50 * 100) + amp_mod = pipeparts.mkaudioamplify(pipeline, amp_mod, amplitude_mod * 4 * 50) amplitude = calibration_parts.mkadder(pipeline, calibration_parts.list_srcs(pipeline, amplitude, amp_mod)) amplitude = pipeparts.mktogglecomplex(pipeline, calibration_parts.mkmatmix(pipeline, amplitude, matrix = [[1, 0]])) p_mod = test_common.test_src(pipeline, rate = 16, test_duration = test_duration, wave = 5, src_suffix = '4') @@ -113,7 +113,7 @@ def line_subtraction_ringing_01(pipeline, name): p_mod = pipeparts.mktogglecomplex(pipeline, calibration_parts.mkmatmix(pipeline, p_mod, matrix = [[0.0, phase_mod * 4 * 50]])) signal = calibration_parts.mkmultiplier(pipeline, calibration_parts.list_srcs(pipeline, amplitude, pipeparts.mkgeneric(pipeline, p_mod, "cexp"))) signal = pipeparts.mktee(pipeline, signal) - pipeparts.mknxydumpsink(pipeline, calibration_parts.complex_audioamplify(pipeline, signal, -1.824403670446913, 0.8194477063597114), "TF_mod.txt") + pipeparts.mknxydumpsink(pipeline, calibration_parts.complex_audioamplify(pipeline, signal, -1.824419051573438, 0.8194480607432615), "TF_mod.txt") signal = calibration_parts.mkresample(pipeline, signal, 4, False, "audio/x-raw, format=Z128LE, rate=64") signal = pipeparts.mkgeneric(pipeline, signal, "lal_demodulate", line_frequency = -1.0 * freq, prefactor_real = -2.0) signal = pipeparts.mkcapsfilter(pipeline, signal, "audio/x-raw, format=Z128LE, rate=64") @@ -190,7 +190,7 @@ def line_subtraction_ringing_01(pipeline, name): test_common.build_and_run(line_subtraction_ringing_01, "line_subtraction_ringing_01") -labels = ['strain', 'short', 'long', 'switch'] +labels = ['strain', '128s\ TF', '4096s\ TF', 'switch'] # Get ASD data print("Loading ASD txt file 1 of %d" % (1 + len(filter_latencies))) @@ -235,7 +235,7 @@ print("Done loading TF txt files") # Plot ASDs against frequency plt.figure(figsize = (10, 6)) -colors = ["red", "blue", "gold", "limegreen"] +colors = ["red", "blue", "orange", "limegreen"] #colors = ['red'] + [cm.viridis(x) for x in np.linspace(0, 1, len(filter_latencies))] #labels = ['strain'] #for lat in filter_latencies: @@ -245,15 +245,16 @@ for i in range(len(labels[1:])): plt.plot(fvec, clean[i], color = colors[1 + i], linewidth = 0.75) patches = [mpatches.Patch(color = colors[j], label = r'$%s$' % labels[j]) for j in range(len(colors))] plt.legend(handles = patches, loc = 'upper right', ncol = 1) -plt.title('ASD %d s Median, %d s Average' % (med_time, avg_time)) +#plt.title('ASD %d s Median, %d s Average' % (med_time, avg_time)) plt.ylabel(r'${\rm ASD}\ \left[{\rm strain / }\sqrt{\rm Hz}\right]$') plt.xlabel(r'${\rm Frequency \ [Hz]}$') -ticks_and_grid(plt.gca(), xmin = freq - 0.01, xmax = freq + 0.01, ymin = 0.0001, ymax = 10000, xscale = 'linear', yscale = 'log') +ticks_and_grid(plt.gca(), xmin = freq - 0.01, xmax = freq + 0.01, ymin = 0.01, ymax = 1000, xscale = 'linear', yscale = 'log') +plt.tight_layout() if any(other_lines): plt.savefig("lineSubRingingOtherLinesASD_%dmed_%davg.png" % (med_time, avg_time)) else: - plt.savefig("lineSubRingingASD_%dHz_%dmed_%davg_filter.png" % (int(freq), med_time, avg_time)) + plt.savefig("lineSubRingingASD_%dHz_%dmed_%davg_%dversions.png" % (int(freq), med_time, avg_time, len(labels))) # Plot transfer function against frequency plt.figure(figsize = (10, 10)) @@ -267,7 +268,7 @@ patches = [mpatches.Patch(color = colors[j+1], label = r'$%s$' % labels[j+1]) fo plt.legend(handles = patches, loc = 'upper right', ncol = 1) ticks_and_grid(plt.gca(), xmin = freq - 0.01, xmax = freq + 0.01, ymin = 0, ymax = 2, xscale = 'linear', yscale = 'linear') plt.ylabel('Magnitude') -plt.title('TF %d s Median %d s Avg' % (med_time, avg_time)) +plt.title('CLEAN / HOFT') plt.subplot(212) for i in range(len(labels[1:])): plt.plot(TFfvec, TFphase[i], color = colors[i+1], linewidth = 0.75) @@ -278,6 +279,6 @@ plt.xlabel('Frequency [Hz]') if any(other_lines): plt.savefig("lineSubRingingOtherLinesTF_%dmed_%davg.png" % (med_time, avg_time)) else: - plt.savefig("lineSubRingingTF_%dHz_%dmed_%davg_filter.png" % (int(freq), med_time, avg_time)) + plt.savefig("lineSubRingingTF_%dHz_%dmed_%davg_%dversions.png" % (int(freq), med_time, avg_time, len(labels) - 1))