Skip to content

Commit

Permalink
Merge pull request #20 from cta-observatory/add_geom
Browse files Browse the repository at this point in the history
Add geom
  • Loading branch information
FrancaCassol authored Dec 16, 2019
2 parents c8b91d2 + c15cd77 commit 1e795de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions ctapipe_io_lst/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import numpy as np
import struct
from astropy import units as u
from pkg_resources import resource_filename
import os
from os import listdir
from astropy.time import Time
Expand All @@ -27,6 +28,14 @@
__all__ = ['LSTEventSource']


def load_camera_geometry(version=3):
''' Load camera geometry from bundled resources of this repo '''
f = resource_filename(
'ctapipe_io_lst', 'resources/LSTCam-{:03d}'.format(version)
)
return CameraGeometry.from_table(f)


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

Expand Down Expand Up @@ -116,8 +125,7 @@ def subarray(self):
optics = OpticsDescription.from_name("LST")

# camera info from LSTCam-[geometry_version].camgeom.fits.gz file
geometry_version = 2
camera = CameraGeometry.from_name("LSTCam", geometry_version)
camera = load_camera_geometry(version=3)

tel_descr = TelescopeDescription(
name='LST', tel_type='LST', optics=optics, camera=camera
Expand Down
Binary file not shown.
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
setup(
name='ctapipe_io_lst',
packages=find_packages(),
version='0.3.1',
version='0.4.0',
description='ctapipe plugin for reading LST prototype files',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -19,6 +19,9 @@
'ctapipe',
'protozfits',
],
package_data={
'ctapipe_io_lst': ['resources/*'],
},
tests_require=['pytest'],
setup_requires=['pytest_runner'],
author='Franca Cassol',
Expand Down

0 comments on commit 1e795de

Please sign in to comment.