Skip to content

Commit

Permalink
Define optics instead of relying on ctapipe-exta
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Dec 17, 2019
1 parent 10076c3 commit 3bf0a39
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions ctapipe_io_lst/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
EventSource for LSTCam protobuf-fits.fz-files.
Needs protozfits v1.4.2 from github.com/cta-sst-1m/protozfitsreader
"""
import numpy as np
import struct
Expand All @@ -28,10 +26,19 @@
from .version import get_version

__version__ = get_version(pep440=False)
print(__version__)
__all__ = ['LSTEventSource']



OPTICS = OpticsDescription(
'LST',
equivalent_focal_length=u.Quantity(28, u.m),
num_mirrors=1,
mirror_area=u.Quantity(386.73, u.m**2),
num_mirror_tiles=198,
)


def load_camera_geometry(version=3):
''' Load camera geometry from bundled resources of this repo '''
f = resource_filename(
Expand All @@ -40,6 +47,7 @@ def load_camera_geometry(version=3):
return CameraGeometry.from_table(f)



class LSTEventSource(EventSource):
"""EventSource for LST r0 data."""

Expand Down Expand Up @@ -127,14 +135,11 @@ def subarray(self):

tel_id = 1

# optics info from standard optics.fits.gz file
optics = OpticsDescription.from_name("LST")

# camera info from LSTCam-[geometry_version].camgeom.fits.gz file
camera = load_camera_geometry(version=self.geometry_version)

tel_descr = TelescopeDescription(
name='LST', tel_type='LST', optics=optics, camera=camera
name='LST', tel_type='LST', optics=OPTICS, camera=camera
)

tels = {tel_id: tel_descr}
Expand Down Expand Up @@ -162,14 +167,11 @@ def _generator(self):
# Instrument information
for tel_id in self.data.lst.tels_with_data:

# optics info from standard optics.fits.gz file
optics = OpticsDescription.from_name("LST")

# camera info from LSTCam-[geometry_version].camgeom.fits.gz file
camera = load_camera_geometry(version=self.geometry_version)

tel_descr = TelescopeDescription(
name='LST', tel_type='LST', optics=optics, camera=camera
name='LST', tel_type='LST', optics=OPTICS, camera=camera
)

self.n_camera_pixels = tel_descr.camera.n_pixels
Expand Down

0 comments on commit 3bf0a39

Please sign in to comment.