-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed bug in coordinate transformation #997
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,30 @@ def test_cam_to_tel(): | |
assert camera_coord.separation_3d(camera_coord2)[0] == 0 * u.m | ||
|
||
|
||
def test_cam_to_hor(): | ||
# Coordinates in any frame can be given as a numpy array of the xyz positions | ||
# e.g. in this case the position on pixels in the camera | ||
pix_x = [1] * u.m | ||
pix_y = [1] * u.m | ||
|
||
focal_length = 15000 * u.mm | ||
|
||
# first define the camera frame | ||
pointing = SkyCoord(alt=70*u.deg, az=0*u.deg,frame=AltAz()) | ||
camera_frame = CameraFrame(focal_length=focal_length) | ||
|
||
# transform | ||
camera_coord = SkyCoord(pix_x, pix_y, frame=camera_frame) | ||
altaz_coord = camera_coord.transform_to(AltAz()) | ||
|
||
# transform back | ||
altaz_coord2 = SkyCoord(az=altaz_coord.az, alt=altaz_coord.alt, frame=hf) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hf is undefined (should be defined above or just add |
||
camera_coord2 = altaz_coord2.transform_to(camera_frame) | ||
|
||
# check transform | ||
assert camera_coord.x == camera_coord2.x | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better use |
||
|
||
|
||
def test_ground_to_tilt(): | ||
from ctapipe.coordinates import GroundFrame, TiltedGroundFrame | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pointing needs to go here