Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the code to generate the sky grid that will be used by pycbc_multi_inspiral #4485

Merged
merged 10 commits into from
Jan 25, 2024
Prev Previous commit
Next Next commit
Calculate the time delay corresponding to each sky point
  • Loading branch information
hoangstephanie committed Sep 14, 2023
commit 16cd3b1b655aa76cfde5423a9748a6e775c13b04
5 changes: 5 additions & 0 deletions bin/pycbc_make_sky_grid
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ rota = r.apply(cart)
# Convert cartesian coordinates back to spherical coordinates
spher = cart_to_spher(rota)

# Calculate the time delay corresponding to each sky point
time_delays = [detector_pairs[smallest_td][0].time_delay_from_detector(
detector_pairs[smallest_td][1], spher[i][0], spher[i][0], args.trigger_time) for i in range(len(spher))]

with h5py.File(args.output, 'w') as hf:
hf['ra'] = spher[:,0]
hf['dec'] = spher[:,1]
Expand All @@ -105,3 +109,4 @@ with h5py.File(args.output, 'w') as hf:
hf['trigger_time'] = [args.trigger_time]
hf['timing_uncertainty'] = [args.timing_uncertainty]
hf['instruments'] = [d for d in args.instruments]
hf['time_delays'] = time_delays
Loading