From f3be8b8d8c7613c21a2b5e0b7beeaf39761f92bd Mon Sep 17 00:00:00 2001 From: GarethCabournDavies Date: Wed, 4 Dec 2024 07:59:45 -0800 Subject: [PATCH] some tidying --- bin/pycbc_compress_bank | 7 +------ bin/pycbc_inspiral | 10 ++++++++-- pycbc/waveform/bank.py | 2 +- pycbc/workflow/core.py | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bin/pycbc_compress_bank b/bin/pycbc_compress_bank index 87636d70259..07794cca4f5 100755 --- a/bin/pycbc_compress_bank +++ b/bin/pycbc_compress_bank @@ -102,7 +102,7 @@ parser.add_argument( "--do-not-compress", nargs="+", help="If given, will not compress waveforms using " - "the given approximant. Default: [TaylorF2, SPAtmplt]" + "the given approximant. Recommended 'SPAtmplt TaylorF2'." ) # Insert the PSD options @@ -110,11 +110,6 @@ pycbc.psd.insert_psd_option_group(parser, include_data_options=False) args = parser.parse_args() -# TalyorF2/SPAtmplt should not be compressed, as this will be less -# efficient than generating on-the-fly -args.do_not_compress = ["TaylorF2", "SPAtmplt"] if args.do_not_compress \ - is None else args.do_not_compress - pycbc.init_logging(args.verbose) # Verify if the input options for calculating the psd are correct, if diff --git a/bin/pycbc_inspiral b/bin/pycbc_inspiral index f2e0187b766..242ca153290 100644 --- a/bin/pycbc_inspiral +++ b/bin/pycbc_inspiral @@ -181,8 +181,12 @@ parser.add_argument("--finalize-events-template-rate", default=None, "512, but a good number may depend on other settings " "and your specific use-case.") parser.add_argument("--gpu-callback-method", default='none') -parser.add_argument("--use-compressed-waveforms", action="store_true", default=False, - help='Use compressed waveforms from the bank file.') +parser.add_argument( + "--use-compressed-waveforms", + action="store_true", + default=False, + help='Use compressed waveforms from the bank file (if available).' +) parser.add_argument("--waveform-decompression-method", action='store', default=None, help='Method to be used decompress waveforms from the bank file.') parser.add_argument("--checkpoint-interval", type=int, @@ -296,8 +300,10 @@ def template_triggers(t_num): pycbc.psd.find_trigger_value(psd_var, out_vals['time_index'], opt.gps_start_time, opt.sample_rate) + #print(idx, out_vals['time_index']) out_vals_all.append(copy.deepcopy(out_vals)) + #print(out_vals_all) return out_vals_all, tparam with ctx: diff --git a/pycbc/waveform/bank.py b/pycbc/waveform/bank.py index 65f9b4ffc52..d28b9c288fe 100644 --- a/pycbc/waveform/bank.py +++ b/pycbc/waveform/bank.py @@ -774,7 +774,7 @@ def generate_with_delta_f_and_max_freq(self, t_num, max_freq, delta_f, if cached_mem is None: wav_len = int(max_freq / delta_f) + 1 cached_mem = zeros(wav_len, dtype=np.complex64) - + try : if not (self.has_compressed_waveforms and self.enable_compressed_waveforms): raise ValueError diff --git a/pycbc/workflow/core.py b/pycbc/workflow/core.py index c4bbd554623..5eaace3aed5 100644 --- a/pycbc/workflow/core.py +++ b/pycbc/workflow/core.py @@ -1279,7 +1279,7 @@ def _filename(self, ifo, description, extension, segment): # Follow the frame convention of using integer filenames, # but stretching to cover partially covered seconds. # The if statement allows us to use a filename which doesn't - # have a teim associated to it + # have a time associated to it start = int(segment[0]) end = int(math.ceil(segment[1])) if (end-start) > 0 and segment[0] > 0: