Skip to content

Commit

Permalink
Do batched curve lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremykubica committed Sep 18, 2024
1 parent c0f1bec commit 37d4239
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/kbmod/run_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ def load_and_filter_results(self, search, config):
logger.info(f"Chunk Min. Likelihood = {results[-1].lh}")

trj_batch = []
psi_batch = []
phi_batch = []
for i, trj in enumerate(results):
# Stop as soon as we hit a result below our limit, because anything after
# that is not guarrenteed to be valid due to potential on-GPU filtering.
Expand All @@ -93,14 +91,15 @@ def load_and_filter_results(self, search, config):

if trj.lh < max_lh:
trj_batch.append(trj)
psi_batch.append(search.get_psi_curves(trj))
phi_batch.append(search.get_phi_curves(trj))
total_count += 1

batch_size = len(trj_batch)
logger.info(f"Extracted batch of {batch_size} results for total of {total_count}")

if batch_size > 0:
psi_batch = search.get_psi_curves(trj_batch)
phi_batch = search.get_phi_curves(trj_batch)

result_batch = Results.from_trajectories(trj_batch, track_filtered=do_tracking)
result_batch.add_psi_phi_data(psi_batch, phi_batch)

Expand Down

0 comments on commit 37d4239

Please sign in to comment.