diff --git a/aict_tools/__init__.py b/aict_tools/__init__.py index 66d9d1e..cc37364 100644 --- a/aict_tools/__init__.py +++ b/aict_tools/__init__.py @@ -1 +1 @@ -__version__ = '0.22.1' +__version__ = '0.22.2' diff --git a/aict_tools/cta_helpers.py b/aict_tools/cta_helpers.py index 3133951..082609c 100644 --- a/aict_tools/cta_helpers.py +++ b/aict_tools/cta_helpers.py @@ -13,12 +13,12 @@ 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, ) @@ -26,6 +26,6 @@ def horizontal_to_camera_cta_simtel(zd, az, zd_pointing, az_pointing, focal_leng 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) diff --git a/tests/cta_coord_test.hdf b/tests/cta_coord_test.hdf index d898b22..d4bd2d0 100644 Binary files a/tests/cta_coord_test.hdf and b/tests/cta_coord_test.hdf differ diff --git a/tests/test_cta_coords.py b/tests/test_cta_coords.py index 21b9b25..13e43a1 100644 --- a/tests/test_cta_coords.py +++ b/tests/test_cta_coords.py @@ -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)