Skip to content

Commit

Permalink
some tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Dec 4, 2024
1 parent a3d6e45 commit f3be8b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
7 changes: 1 addition & 6 deletions bin/pycbc_compress_bank
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,14 @@ 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
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
Expand Down
10 changes: 8 additions & 2 deletions bin/pycbc_inspiral
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pycbc/waveform/bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pycbc/workflow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f3be8b8

Please sign in to comment.