Skip to content

Commit

Permalink
Fix logic for determining frame type in make_skymap (gwastro#4937)
Browse files Browse the repository at this point in the history
  • Loading branch information
titodalcanton authored and prayush committed Nov 21, 2024
1 parent ca8e4ac commit b3757ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bin/pycbc_make_skymap
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ def main(trig_time, mass1, mass2, spin1z, spin2z, f_low, f_upper, sample_rate,
frame_types = {}
if channel_names is None:
channel_names = {}
for ifo in ifos:
if ifo not in frame_types:
frame_types[ifo] = default_frame_type(mean_trig_time, ifo)
if ifo not in channel_names:
if fake_strain[ifo] is not None:
channel_names[ifo] = ifo + ':FAKE_DATA'
else:
channel_names[ifo] = default_channel_name(mean_trig_time, ifo)

# resulting files will be tagged with this string
file_name_tag = '{:.0f}'.format(mean_trig_time)
Expand Down Expand Up @@ -165,6 +157,12 @@ def main(trig_time, mass1, mass2, spin1z, spin2z, f_low, f_upper, sample_rate,
st_psd_paths = {}
st_out_paths = {}
for ifo in ifos:
if ifo not in channel_names:
if fake_strain[ifo] is not None:
channel_names[ifo] = ifo + ':FAKE_DATA'
else:
channel_names[ifo] = default_channel_name(mean_trig_time, ifo)

# compose the command line for the single-template process
st_psd_paths[ifo] = os.path.join(
tmpdir, 'PSD_{}_{}.txt'.format(file_name_tag, ifo))
Expand Down Expand Up @@ -227,6 +225,8 @@ def main(trig_time, mass1, mass2, spin1z, spin2z, f_low, f_upper, sample_rate,
command.append(str(fake_strain_seed[ifo]))
elif custom_frame_files is None or ifo not in custom_frame_files:
# use default guesses for this ifo
if ifo not in frame_types:
frame_types[ifo] = default_frame_type(mean_trig_time, ifo)
command.append("--frame-type")
command.append(frame_types[ifo])
else:
Expand Down

0 comments on commit b3757ed

Please sign in to comment.