Skip to content

Commit

Permalink
quick fix of example, CameraFrame nore requires x and y as sperate in…
Browse files Browse the repository at this point in the history
…puts it seems (#816)
  • Loading branch information
thomasarmstrong authored and kosack committed Nov 14, 2018
1 parent 4a0c8d4 commit 3958639
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/coordinate_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ def cam_to_tel():

# Coordinates in any fram can be given as a numpy array of the xyz positions
# e.g. in this case the position on pixels in the camera
pix = [np.ones(2048), np.ones(2048), np.zeros(2048)] * u.m
pix_x = np.ones(2048) * u.m
pix_y = np.ones(2048) * u.m
# first define the camera frame
camera_coord = CameraFrame(pix, focal_length=15 * u.m, rotation=0 * u.deg)
camera_coord = CameraFrame(pix_x, pix_y, focal_length=15 * u.m, rotation=0 * u.deg)

# then use transform to function to convert to a new system making sure
# to give the required values for the conversion (these are not checked
Expand All @@ -43,8 +44,9 @@ def cam_to_tel():
# The astropy system is clever enough to transform through several intermediate
# steps to get to the sytem you want (provided it has sufficient information)
def cam_to_nom():
pix = [np.ones(2048), np.ones(2048), np.zeros(2048)] * u.m
camera_coord = CameraFrame(pix, focal_length=15 * u.m)
pix_x = np.ones(2048) * u.m
pix_y = np.ones(2048) * u.m
camera_coord = CameraFrame(pix_x, pix_y, focal_length=15 * u.m)
# In this case we bypass the telescope system
nom_coord = camera_coord.transform_to(
NominalFrame(
Expand Down

0 comments on commit 3958639

Please sign in to comment.