Skip to content

Commit db64b0c

Browse files
authored
Merge pull request #2942 from cta-observatory/subarray_service_data
Implement service data loading
2 parents 5561e92 + 44200ee commit db64b0c

10 files changed

Lines changed: 1262 additions & 47 deletions

File tree

docs/changes/2942.feature.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Add service data loading to SubarrayDescription.
2+
3+
* Add ``SubarrayDescription.from_service_data()`` classmethod to construct
4+
subarrays from service data files (array element IDs, positions, and subarray
5+
definitions). This also adds mapping between the array elements IDs and CTAO official telescope names (e.g. LSTN-001).

src/ctapipe/exceptions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ def __init__(self, module):
1717

1818
class InputMissing(ValueError):
1919
"""Raised in case an input was not specified."""
20+
21+
22+
class UnknownSubarray(CTAPipeException):
23+
"""Raised if a subarray id is not found in the service data."""
24+
25+
26+
class UnknownTelescopeID(KeyError):
27+
"""Raised when an unknown telescope id is encountered"""
28+
29+
30+
class IncompatibleDataModelVersion(CTAPipeException):
31+
"""Raised when data model version is not compatible"""

src/ctapipe/instrument/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ReflectorShape,
1616
SizeType,
1717
)
18-
from .subarray import SubarrayDescription, UnknownTelescopeID
18+
from .subarray import SubarrayDescription, UnknownSubarray, UnknownTelescopeID
1919
from .telescope import TelescopeDescription
2020
from .trigger import SoftwareTrigger
2121
from .warnings import FromNameWarning
@@ -32,6 +32,7 @@
3232
"SubarrayDescription",
3333
"TelescopeDescription",
3434
"UnknownTelescopeID",
35+
"UnknownSubarray",
3536
"FocalLengthKind",
3637
"ReflectorShape",
3738
"SizeType",

0 commit comments

Comments
 (0)