Skip to content

Commit ed8bbc3

Browse files
authored
Merge pull request #122 from fact-project/fix_cta_coord_trafo
Fix cta coordinate trafos
2 parents ea901f4 + 2bd9e98 commit ed8bbc3

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

aict_tools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.22.1'
1+
__version__ = '0.22.2'

aict_tools/cta_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ def horizontal_to_camera_cta_simtel(zd, az, zd_pointing, az_pointing, focal_leng
1313
altaz = AltAz()
1414
source_altaz = SkyCoord(
1515
az=u.Quantity(az, u.deg, copy=False),
16-
alt=u.Quantity(zd, u.deg, copy=False),
16+
alt=u.Quantity(90 - zd, u.deg, copy=False),
1717
frame=altaz,
1818
)
1919

2020
tel_pointing = SkyCoord(
21-
alt=u.Quantity(zd_pointing, u.deg, copy=False),
21+
alt=u.Quantity(90 - zd_pointing, u.deg, copy=False),
2222
az=u.Quantity(az_pointing, u.deg, copy=False),
2323
frame=altaz,
2424
)
2525
camera_frame = CameraFrame(
2626
focal_length=u.Quantity(focal_length, u.m, copy=False),
2727
telescope_pointing=tel_pointing,
2828
)
29-
29+
3030
cam_coords = source_altaz.transform_to(camera_frame)
3131
return cam_coords.x.to_value(u.m), cam_coords.y.to_value(u.m)

tests/cta_coord_test.hdf

45.1 KB
Binary file not shown.

tests/test_cta_coords.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ def test_horizontal_to_camera():
99
expected_x = df.x
1010
expected_y = df.y
1111
transformed_x, transformed_y = horizontal_to_camera_cta_simtel(
12-
df.alt,
13-
df.az,
14-
df.alt_pointing,
15-
df.az_pointing,
16-
df.focal_length
12+
zd=df.zd,
13+
az=df.az,
14+
zd_pointing=df.zd_pointing,
15+
az_pointing=df.az_pointing,
16+
focal_length=df.focal_length,
1717
)
1818
assert_allclose(expected_x, transformed_x)
1919
assert_allclose(expected_y, transformed_y)

0 commit comments

Comments
 (0)