Skip to content

Commit

Permalink
Fix cta coordinate trafos, were using altitude instead of zenith
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed May 13, 2020
1 parent ea901f4 commit 2bd9e98
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aict_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.22.1'
__version__ = '0.22.2'
6 changes: 3 additions & 3 deletions aict_tools/cta_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ def horizontal_to_camera_cta_simtel(zd, az, zd_pointing, az_pointing, focal_leng
altaz = AltAz()
source_altaz = SkyCoord(
az=u.Quantity(az, u.deg, copy=False),
alt=u.Quantity(zd, u.deg, copy=False),
alt=u.Quantity(90 - zd, u.deg, copy=False),
frame=altaz,
)

tel_pointing = SkyCoord(
alt=u.Quantity(zd_pointing, u.deg, copy=False),
alt=u.Quantity(90 - zd_pointing, u.deg, copy=False),
az=u.Quantity(az_pointing, u.deg, copy=False),
frame=altaz,
)
camera_frame = CameraFrame(
focal_length=u.Quantity(focal_length, u.m, copy=False),
telescope_pointing=tel_pointing,
)

cam_coords = source_altaz.transform_to(camera_frame)
return cam_coords.x.to_value(u.m), cam_coords.y.to_value(u.m)
Binary file modified tests/cta_coord_test.hdf
Binary file not shown.
10 changes: 5 additions & 5 deletions tests/test_cta_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def test_horizontal_to_camera():
expected_x = df.x
expected_y = df.y
transformed_x, transformed_y = horizontal_to_camera_cta_simtel(
df.alt,
df.az,
df.alt_pointing,
df.az_pointing,
df.focal_length
zd=df.zd,
az=df.az,
zd_pointing=df.zd_pointing,
az_pointing=df.az_pointing,
focal_length=df.focal_length,
)
assert_allclose(expected_x, transformed_x)
assert_allclose(expected_y, transformed_y)

0 comments on commit 2bd9e98

Please sign in to comment.