diff --git a/gstlal-calibration/bin/gstlal_compute_strain b/gstlal-calibration/bin/gstlal_compute_strain index eec125e3a4c1552d650b6abde8dd326f6c53224e..37facaa350d8a9b5ae7e24fc6e0e2e67a8433af0 100755 --- a/gstlal-calibration/bin/gstlal_compute_strain +++ b/gstlal-calibration/bin/gstlal_compute_strain @@ -126,9 +126,11 @@ parser = OptionParser(description = __doc__) # Append program specific options # These options should be used whether the pipeline runs in full calibration mode or partial calibration mode -parser.add_option("--gps-start-time", metavar = "seconds", help = "Set the start time of the segment to analyze in GPS seconds. This is required iff --data-source=frames") -parser.add_option("--gps-end-time", metavar = "seconds", help = "Set the end time of the segment to analyze in GPS seconds. This is required iff --data-source=frames") -parser.add_option("--wings", metavar = "seconds", default = 0, type = "int", help = "Number of seconds to trim off of the beginning and end of the output. Should only be used if --data-source=frames.") +parser.add_option("--gps-start-time", metavar = "seconds", help = "Set the start time of the segment to analyze in GPS seconds. This is required iff DataSource is frames") +parser.add_option("--gps-end-time", metavar = "seconds", help = "Set the end time of the segment to analyze in GPS seconds. This is required iff DataSource is =frames") +parser.add_option("--frame-cache", metavar = "filename", help = "Set the name of the LAL cache listing the LIGO .gwf frame files (optional). This is required iff DataSource is frames") +parser.add_option("--output-path", metavar = "name", default = ".", help = "Set the output path for writing frame files. (Default=Current)") +parser.add_option("--wings", metavar = "seconds", default = 0, type = "int", help = "Number of seconds to trim off of the beginning and end of the output. Should only be used if DataSource is frames.") parser.add_option("--frame-duration", metavar = "seconds", type = "int", default = 4, help = "Set the number of seconds for each frame. (Default = 4)") parser.add_option("--frames-per-file", metavar = "count", type = "int", default = 1, help = "Set the number of frames per frame file. (Default = 1)") parser.add_option("--config-file", metavar = "name", help = "Full path to configuration file for running.") @@ -177,7 +179,7 @@ data_sources = set(("frames", "lvshm")) if InputConfigs["datasource"] not in data_sources: raise ValueError("DataSource must be one of %s" % ",".join(data_sources)) -if InputConfigs["datasource"] == "frames" and InputConfigs["framecache"] is None: +if InputConfigs["datasource"] == "frames" and options.frame_cache is None: raise ValueError("FrameCache must be specified when using DataSource: frames") if int(options.wings != 0) and InputConfigs["datasource"] != "frames": @@ -359,28 +361,33 @@ skip_bad_files = Config.getboolean("InputConfigurations", "skipbadfiles") # Search the directory tree for files with names matching the one we want. filters_name = InputConfigs["filtersfilename"] -filters_paths = [] -print "\nSearching for %s ..." % filters_name -# Check the user's home directory -for dirpath, dirs, files in os.walk(os.environ['HOME']): - if filters_name in files: - # We prefer filters that came directly from a GDSFilters directory of the calibration SVN - if dirpath.count("GDSFilters") > 0: - filters_paths.insert(0, os.path.join(dirpath, filters_name)) - else: - filters_paths.append(os.path.join(dirpath, filters_name)) -# Check if there is a checkout of the entire calibration SVN -for dirpath, dirs, files in os.walk('/ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/'): - if filters_name in files: - # We prefer filters that came directly from a GDSFilters directory of the calibration SVN - if dirpath.count("GDSFilters") > 0: - filters_paths.insert(0, os.path.join(dirpath, filters_name)) - else: - filters_paths.append(os.path.join(dirpath, filters_name)) -if not len(filters_paths): - raise ValueError("Cannot find filters file %s in home directory %s or in /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/*/GDSFilters", (filters_name, os.environ['HOME'])) -print "Loading calibration filters from %s\n" % filters_paths[0] -filters = numpy.load(filters_paths[0]) +if filters_name.count('/') > 0: + # Then the path to the filters file was given + filters = numpy.load(filters_name) +else: + # We need to search for the filters file + filters_paths = [] + print "\nSearching for %s ..." % filters_name + # Check the user's home directory + for dirpath, dirs, files in os.walk(os.environ['HOME']): + if filters_name in files: + # We prefer filters that came directly from a GDSFilters directory of the calibration SVN + if dirpath.count("GDSFilters") > 0: + filters_paths.insert(0, os.path.join(dirpath, filters_name)) + else: + filters_paths.append(os.path.join(dirpath, filters_name)) + # Check if there is a checkout of the entire calibration SVN + for dirpath, dirs, files in os.walk('/ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/'): + if filters_name in files: + # We prefer filters that came directly from a GDSFilters directory of the calibration SVN + if dirpath.count("GDSFilters") > 0: + filters_paths.insert(0, os.path.join(dirpath, filters_name)) + else: + filters_paths.append(os.path.join(dirpath, filters_name)) + if not len(filters_paths): + raise ValueError("Cannot find filters file %s in home directory %s or in /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/*/GDSFilters", (filters_name, os.environ['HOME'])) + print "Loading calibration filters from %s\n" % filters_paths[0] + filters = numpy.load(filters_paths[0]) # In case we want to remove calibration lines, we will fill these dictionaries pcal_line_removal_dict = {} @@ -803,7 +810,7 @@ if not verbose: if InputConfigs["datasource"] == "lvshm": # Data is to be read from shared memory; "low-latency" mode src = pipeparts.mklvshmsrc(pipeline, shm_name = InputConfigs["shmpartition"], assumed_duration = int(InputConfigs["inputframeduration"])) elif InputConfigs["datasource"] == "frames": # Data is to be read from frame files; "offline" mode - src = pipeparts.mklalcachesrc(pipeline, location = InputConfigs["framecache"], cache_dsc_regex = instrument) + src = pipeparts.mklalcachesrc(pipeline, location = options.frame_cache, cache_dsc_regex = instrument) if Config.getboolean("DebuggingConfigurations", "testlatency"): src = pipeparts.mkgeneric(pipeline, src, "splitcounter", filename = "gstlal_compute_strain_timestamps_in.txt") @@ -2457,7 +2464,7 @@ if Config.getboolean("DebuggingConfigurations", "testlatency"): if OutputConfigs["datasink"] == "lvshm": pipeparts.mkgeneric(pipeline, mux, "gds_lvshmsink", sync=False, async=False, shm_name = OutputConfigs["outputshmpartition"], num_buffers = int(OutputConfigs["numbuffers"]), blocksize = int(OutputConfigs["framesize"])*options.frame_duration*options.frames_per_file, buffer_mode = int(OutputConfigs["buffermode"])) elif OutputConfigs["datasink"] == "frames": - pipeparts.mkframecppfilesink(pipeline, mux, frame_type = OutputConfigs["frametype"], path = OutputConfigs["outputpath"], instrument = instrument) + pipeparts.mkframecppfilesink(pipeline, mux, frame_type = OutputConfigs["frametype"], path = options.output_path, instrument = instrument) # Run pipeline diff --git a/gstlal-calibration/config_files/H1DCS_AllCorrections_Cleaning.ini b/gstlal-calibration/config_files/H1DCS_AllCorrections_Cleaning.ini index 5d88f32c3338788ef2e3f52e4877c1675c2985ad..03166b7a898de6bf2cc79d45fb3d3e56536ba43b 100644 --- a/gstlal-calibration/config_files/H1DCS_AllCorrections_Cleaning.ini +++ b/gstlal-calibration/config_files/H1DCS_AllCorrections_Cleaning.ini @@ -11,7 +11,8 @@ SkipBadFiles: No ############################################ # If reading from frames use these options # ############################################ -FrameCache: H1_raw_frames.cache +# None + ################################################### # If reading from shared memory use these options # ################################################### @@ -39,7 +40,6 @@ NumBuffers: 10 # If writing to frame files use these options # ############################################### FrameType: H1DCS_TEST -OutputPath: Frames/O2/H1/DCS [CalibrationConfigurations] IFO: H1 diff --git a/gstlal-calibration/config_files/H1DCS_SplitPU_AllCorrections_Cleaning.ini b/gstlal-calibration/config_files/H1DCS_SplitPU_AllCorrections_Cleaning.ini index 0d1fec22c1179207ce083eae77a34017f2c3fd62..5ccc4945c056b77839b08fe567ec35cc5506aaba 100644 --- a/gstlal-calibration/config_files/H1DCS_SplitPU_AllCorrections_Cleaning.ini +++ b/gstlal-calibration/config_files/H1DCS_SplitPU_AllCorrections_Cleaning.ini @@ -11,7 +11,8 @@ SkipBadFiles: No ############################################ # If reading from frames use these options # ############################################ -FrameCache: H1_raw_frames.cache +# None + ################################################### # If reading from shared memory use these options # ################################################### @@ -39,7 +40,6 @@ NumBuffers: 10 # If writing to frame files use these options # ############################################### FrameType: H1DCS_TEST -OutputPath: Frames/O2/H1/DCS [CalibrationConfigurations] IFO: H1 diff --git a/gstlal-calibration/config_files/H1GDS_LowLatency_AllCorrections_Cleaning.ini b/gstlal-calibration/config_files/H1GDS_LowLatency_AllCorrections_Cleaning.ini index ddb2e3f7dfbb330065c0564f73aac865d718ad57..da4db61618beee92713f7e70c86bb06fa16767b5 100644 --- a/gstlal-calibration/config_files/H1GDS_LowLatency_AllCorrections_Cleaning.ini +++ b/gstlal-calibration/config_files/H1GDS_LowLatency_AllCorrections_Cleaning.ini @@ -11,7 +11,8 @@ SkipBadFiles: No ############################################ # If reading from frames use these options # ############################################ -FrameCache: H1_raw_frames.cache +# None + ################################################### # If reading from shared memory use these options # ################################################### @@ -39,7 +40,6 @@ NumBuffers: 10 # If writing to frame files use these options # ############################################### FrameType: H1GDS_TEST -OutputPath: Frames/O2/H1/GDS [CalibrationConfigurations] IFO: H1 diff --git a/gstlal-calibration/config_files/H1GDS_TestLatency_AllCorrections_Cleaning.ini b/gstlal-calibration/config_files/H1GDS_TestLatency_AllCorrections_Cleaning.ini index 23e2d043c865e569d581099e212faa78cd8f1098..6ebb9bce8e5146042aa32360bb9cce8a396f6ffd 100644 --- a/gstlal-calibration/config_files/H1GDS_TestLatency_AllCorrections_Cleaning.ini +++ b/gstlal-calibration/config_files/H1GDS_TestLatency_AllCorrections_Cleaning.ini @@ -11,7 +11,8 @@ SkipBadFiles: No ############################################ # If reading from frames use these options # ############################################ -FrameCache: H1_raw_frames.cache +# None + ################################################### # If reading from shared memory use these options # ################################################### @@ -39,7 +40,6 @@ NumBuffers: 10 # If writing to frame files use these options # ############################################### FrameType: H1GDS_SHM -OutputPath: Frames/O2/H1/GDS [CalibrationConfigurations] IFO: H1 diff --git a/gstlal-calibration/config_files/gstlal_compute_strain_config_example.ini b/gstlal-calibration/config_files/gstlal_compute_strain_config_example.ini index 678ff986345c2a00f09650e108aa3e016ac50ff3..96b57233ab30fb3fe07358545fbf3172cffc8fec 100644 --- a/gstlal-calibration/config_files/gstlal_compute_strain_config_example.ini +++ b/gstlal-calibration/config_files/gstlal_compute_strain_config_example.ini @@ -11,7 +11,8 @@ SkipBadFiles: No ############################################ # If reading from frames use these options # ############################################ -FrameCache: L1_raw_frames.cache +# None + ################################################### # If reading from shared memory use these options # ################################################### @@ -39,7 +40,6 @@ NumBuffers: 10 # If writing to frame files use these options # ############################################### FrameType: TEST -OutputPath: . [CalibrationConfigurations] IFO: L1 diff --git a/gstlal-calibration/tests/check_calibration/Makefile b/gstlal-calibration/tests/check_calibration/Makefile index 58557bc5bbb1d1fea5794618cf30b4cc6b52df4c..5f5a1e0f416c03d33157ea27e8267554a6509d8f 100644 --- a/gstlal-calibration/tests/check_calibration/Makefile +++ b/gstlal-calibration/tests/check_calibration/Makefile @@ -43,24 +43,24 @@ $(IFO)1_C02_frames.cache: gw_data_find -o $(IFO) -t $(IFO)1_HOFT_C02 -s $(START) -e $(END) -l --url-type file > $@ $(IFO)1_hoft_GDS_frames.cache: $(IFO)1_raw_frames.cache filters framesdir - GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --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_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_TEST*.gwf | lalapps_path2cache > $@ $(IFO)1_hoft_DCS_frames.cache: $(IFO)1_raw_frames.cache filters framesdir - GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(DCSCONFIGS) + GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-cache $(IFO)1_raw_frames.cache --output-path Frames/$(OBSRUN)/$(IFO)1/DCS/ --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(DCSCONFIGS) ls Frames/$(OBSRUN)/$(IFO)1/DCS/$(IFO)-$(IFO)1DCS_TEST*.gwf | lalapps_path2cache > $@ # In case we want to compare one calibration to another... $(IFO)1_hoft_GDS_TEST_frames.cache: $(IFO)1_raw_frames.cache filters framesdir - GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(GDSTESTCONFIGS) + GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-cache $(IFO)1_raw_frames.cache --output-path Frames/$(OBSRUN)/$(IFO)1/GDS/ --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(GDSTESTCONFIGS) ls Frames/$(OBSRUN)/$(IFO)1/GDS/$(IFO)-$(IFO)1GDS_TEST*.gwf | lalapps_path2cache > $@ $(IFO)1_hoft_DCS_TEST_frames.cache: $(IFO)1_raw_frames.cache filters framesdir - GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(DCSTESTCONFIGS) + GST_DEBUG=3 gstlal_compute_strain --gps-start-time $(START) --gps-end-time $(END) --frame-cache $(IFO)1_raw_frames.cache --output-path Frames/$(OBSRUN)/$(IFO)1/DCS/ --frame-duration=64 --frames-per-file=1 --wings=0 --config-file $(DCSTESTCONFIGS) ls Frames/$(OBSRUN)/$(IFO)1/DCS/$(IFO)-$(IFO)1DCS_TEST*.gwf | lalapps_path2cache > $@ $(IFO)1_hoft_GDS_SHM_frames.cache: filters framesdir - -GST_DEBUG=3 timeout $(SHMRUNTIME) gstlal_compute_strain --frame-duration=1 --frames-per-file=1 --wings=0 --config-file $(GDSSHMCONFIGS) + -GST_DEBUG=3 timeout $(SHMRUNTIME) gstlal_compute_strain --output-path Frames/$(OBSRUN)/$(IFO)1/GDS/ --frame-duration=1 --frames-per-file=1 --wings=0 --config-file $(GDSSHMCONFIGS) ls Frames/$(OBSRUN)/$(IFO)1/GDS/$(IFO)-$(IFO)1GDS_SHM*.gwf | lalapps_path2cache > $@ GDS_pcal2darm_plots: $(IFO)1_raw_frames.cache $(IFO)1_hoft_GDS_frames.cache