Skip to content

Commit

Permalink
Merge pull request #711 from dirac-institute/fix_missing_trj_gen
Browse files Browse the repository at this point in the history
Add a few more checks and logging to EclitipicCenteredSearch
  • Loading branch information
jeremykubica authored Sep 18, 2024
2 parents 6910e76 + d05bc2c commit 36e739c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/kbmod/trajectory_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def __init__(
elif work_unit is not None:
# compute_ecliptic_angle() always produces radians.
self.ecliptic_angle = work_unit.compute_ecliptic_angle()
logger.info(f"Computing ecliptic angle from wcs: {self.ecliptic_angle}")
else:
logger.warning("No ecliptic angle provided. Using 0.0.")
self.ecliptic_angle = 0.0
Expand All @@ -410,10 +411,12 @@ def __init__(
raise ValueError("Invalid angles parameter. Expected a length 3 list.")
if len(velocities) != 3:
raise ValueError("Invalid velocity parameter. Expected a length 3 list.")
if velocities[2] < 1 or angles[2] < 1:
raise ValueError("EclipticCenteredSearch requires at least 1 step in each dimension")
if angles[2] < 1:
raise ValueError("EclipticCenteredSearch requires at least 1 step in angles.")
if velocities[1] < velocities[0]:
raise ValueError(f"Invalid EclipticCenteredSearch bounds: {velocities}")
raise ValueError(f"Invalid EclipticCenteredSearch: {velocities[1]} < {velocities[0]}")
if velocities[2] < 1:
raise ValueError("EclipticCenteredSearch requires at least 1 step in velocities.")

self.velocities = [
(velocities[0] * vel_units).to(u.pixel / u.day).value,
Expand Down

0 comments on commit 36e739c

Please sign in to comment.