Coordinates (coordinates
)¶
Introduction¶
ctapipe.coordinates
contains coordinate frame definitions and
coordinate transformation routines that are associated with the
reconstruction of Cherenkov telescope events.
It is built on astropy.coordinates
,
which internally use the ERFA coordinate transformation library,
the open-source-licensed fork of the IAU SOFA system.
Getting Started¶
The coordinate library defines a set of frames,
which represent different coordinate reprentations.
Coordinates should be described using an astropy.coordinates.SkyCoord
in the appropriate frame.
The following special frames are defined for CTA:
they can be transformed to and from any other astropy.coordinates
frame, like
astropy.coordinates.AltAz
or astropy.coordinates.ICRS
(RA/Dec)
The two different coordinate frames are shown here:
"""
Plot the same event in two camera displays showing the
different coordinate frames for camera coordinates.
"""
from ctapipe.instrument import CameraGeometry
from ctapipe.visualization import CameraDisplay
import matplotlib.pyplot as plt
from ctapipe.coordinates import EngineeringCameraFrame
from ctapipe.image.toymodel import Gaussian
import astropy.units as u
def main():
fig, axs = plt.subplots(1, 2, constrained_layout=True, figsize=(6, 3))
model = Gaussian(0 * u.m, 0.1 * u.m, 0.3 * u.m, 0.05 * u.m, 25 * u.deg)
cam = CameraGeometry.from_name("FlashCam")
image, *_ = model.generate_image(cam, 2500)
CameraDisplay(cam, ax=axs[0], image=image)
CameraDisplay(
cam.transform_to(EngineeringCameraFrame()), ax=axs[1], image=image,
)
axs[0].set_title("CameraFrame")
axs[1].set_title("EngineeringCameraFrame")
plt.show()
if __name__ == "__main__":
main()
The CameraFrame
is used internally in ctapipe
and comes from sim_telarray
.
It abstracts the transformation differences between 1 and 2 mirror telescopes away.
The EngineeringCameraFrame
is used by MAGIC, FACT and the H.E.S.S. analysis
software.
Reference/API¶
ctapipe.coordinates Package¶
Coordinates.
Functions¶
|
Project position in the tilted system onto the ground. |
Classes¶
|
Telescope coordinate frame. |
|
Camera coordinate frame. |
|
Engineering camera coordinate frame. |
|
Nominal coordinate frame. |
|
Ground coordinate frame. |
|
Tilted ground coordinate frame. |
ctapipe.coordinates.camera_frame Module¶
Classes¶
|
Camera coordinate frame. |
ctapipe.coordinates.telescope_frame Module¶
The code in this module is basically a copy of http://docs.astropy.org/en/stable/_modules/astropy/coordinates/builtin_frames/skyoffset.html
We are just not creating a metaclass and a factory but directly building the corresponding class.
Classes¶
|
Telescope coordinate frame. |
ctapipe.coordinates.nominal_frame Module¶
The code in this module is basically a copy of http://docs.astropy.org/en/stable/_modules/astropy/coordinates/builtin_frames/skyoffset.html
We are just not creating a metaclass and a factory but directly building the corresponding class.
Classes¶
|
Nominal coordinate frame. |
ctapipe.coordinates.ground_frames Module¶
This module defines the important coordinate systems to be used in reconstruction with the CTA pipeline and the transformations between this different systems. Frames and transformations are defined using the astropy.coordinates framework. This module defines transformations for ground based cartesian and planar systems.
For examples on usage see examples/coordinate_transformations.py
This code is based on the coordinate transformations performed in the read_hess code
TODO:
Tests Tests Tests!
Functions¶
|
Project position in the tilted system onto the ground. |
Classes¶
|
Ground coordinate frame. |
|
Tilted ground coordinate frame. |