Skip to content

Commit

Permalink
Implement minimal EventSource API
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Aug 30, 2023
1 parent 3c3bba4 commit b20eccb
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/ctapipe_io_zfits/dl0.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
import logging
from contextlib import ExitStack

from typing import Tuple, Dict

from ctapipe.containers import ObservationBlockContainer, SchedulingBlockContainer
from ctapipe.io import DataLevel
from ctapipe.instrument import SubarrayDescription

__all__ = [
"ProtozfitsDL0EventSource",
]
Expand All @@ -20,6 +26,34 @@ class ProtozfitsDL0EventSource(EventSource):
will then look for the other data files according to the filename and
directory schema layed out in the draft of the ACADA - DPPS ICD.
"""
def __init__(self, input_url, **kwargs):
super().__init__(input_url=input_url, **kwargs)
self._subarray = None
self._observation_blocks = {}
self._scheduling_blocks = {}

@property
def is_simulation(self) -> bool:
return False

@property
def datalevels(self) -> Tuple[DataLevel]:
return (DataLevel.DL0, )

@property
def subarray(self) -> SubarrayDescription:
return self._subarray

@property
def observation_blocks(self) -> Dict[int, ObservationBlockContainer]:
return self._observation_blocks

@property
def scheduling_blocks(self) -> Dict[int, SchedulingBlockContainer]:
return self._scheduling_blocks

def _generator(self):
pass

@classmethod
def is_compatible(cls, input_url):
Expand Down Expand Up @@ -67,3 +101,4 @@ def is_compatible(cls, input_url):
return False

return True

0 comments on commit b20eccb

Please sign in to comment.