Skip to content

Commit

Permalink
Fix bug where pointing information was interpolated
Browse files Browse the repository at this point in the history
  • Loading branch information
samaloney committed Dec 9, 2024
1 parent 8e40408 commit 2372544
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions stixpy/coordinates/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_hpc_info(times, end_time=None):
-------
"""
aux = _get_aux_data(times.min(), times.max())
aux = _get_aux_data(times.min(), end_time or times.max())

indices = np.argwhere((aux["time"] >= times.min()) & (aux["time"] <= times.max()))
if end_time is not None:
Expand Down Expand Up @@ -122,9 +122,11 @@ def get_hpc_info(times, end_time=None):

sas_x = np.interp(x, xp, aux["y_srf"])
sas_y = np.interp(x, xp, aux["z_srf"])

good_solution = np.where(aux[indices]["sas_ok"] == 1)
good_sas = aux[good_solution]
if x.size == 1:
good_sas = [True] if np.interp(x, xp, aux["sas_ok"]).astype(bool) else []
else:
sas_ok = np.interp(x, xp, aux["sas_ok"]).astype(bool)
good_sas = sas_ok[sas_ok == True] # noqa E712

# Convert the spacecraft pointing to STIX frame
rotated_yaw = -yaw * np.cos(roll) + pitch * np.sin(roll)
Expand Down

0 comments on commit 2372544

Please sign in to comment.