Skip to content

Commit

Permalink
Transform wobble position angle convention from IACT to astropy
Browse files Browse the repository at this point in the history
We were using astropy's convention (0 deg is North and then increase counterclockwise) rather than the IACT convention (0 deg is West and then increase clockwise)
  • Loading branch information
HealthyPear committed Dec 18, 2024
1 parent 4521302 commit f40431f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/iact_estimator/plots/wobble_skymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ def star_label_with_magnitude(star: Star) -> str:
for angle, offset, color in zip(wobble_angles, wobble_offsets, color_map.colors):
color = matplotlib_colors.to_hex(color)

wobble_center = target_coordinates.directional_offset_by(angle, offset)
# Transform IACT convention to astropy
position_angle = (90 * u.deg - angle) % (360 * u.deg)

wobble_center = target_coordinates.directional_offset_by(position_angle, offset)
wobble_ra = wobble_center.ra.to_value("hourangle")
wobble_dec = wobble_center.dec.to_value("deg")

Expand Down Expand Up @@ -245,5 +248,3 @@ def star_label_with_magnitude(star: Star) -> str:
f"{target_source.name}_skymap_with_wobbles.{config['wobble_skymap_plot_options']['export']['format']}",
**config["wobble_skymap_plot_options"]["export"],
)

# plt.show()

0 comments on commit f40431f

Please sign in to comment.