Skip to content

Commit

Permalink
Add a note to CameraGeometry docs
Browse files Browse the repository at this point in the history
Note that from_name() is not guaranteed to correspond with event data.

Closes #2484
  • Loading branch information
kosack authored and maxnoe committed Mar 22, 2024
1 parent c6e1953 commit efa305f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/ctapipe/instrument/camera/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,13 +581,25 @@ def image_from_cartesian_representation(self, image_2d):

@classmethod
def from_name(cls, name="NectarCam", version=None):
"""
Construct a CameraGeometry using the name of the camera and array.
"""Construct a CameraGeometry using the name of the camera and array.
This expects that there is a resource accessible via
`~ctapipe.utils.get_table_dataset` called ``"[array]-[camera].camgeom.fits.gz"``
or ``"[array]-[camera]-[version].camgeom.fits.gz"``
Notes
-----
Warning: This method loads a pre-generated ``CameraGeometry`` and is
thus not guranteed to be the same pixel ordering or even positions that
correspond with event data! Therefore if you are analysing data, you
should not rely on this method, but rather open the data with an
``EventSource`` and use the ``CameraGeometry`` that is provided by
``source.subarray.tel[i].camera.geometry`` or by
``source.subarray.camera_types[type_name].geometry``. This will
guarantee that the pixels in the event data correspond with the
``CameraGeometry``
Parameters
----------
name : str
Expand All @@ -598,6 +610,7 @@ def from_name(cls, name="NectarCam", version=None):
Returns
-------
new CameraGeometry
"""

if version is None:
Expand Down

0 comments on commit efa305f

Please sign in to comment.