Skip to content

Commit 565c66f

Browse files
authored
Merge pull request #70 from jlenain/ctapipe-0.24-bis
Upgrade to ctapipe v0.24
2 parents 68479e4 + 2b31ca5 commit 565c66f

5 files changed

Lines changed: 22 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
runs-on: ubuntu-latest
3737
strategy:
3838
matrix:
39-
python-version: ["3.9", "3.10", "3.11"]
40-
ctapipe-version: [v0.19.3]
39+
python-version: ["3.10", "3.11"]
40+
ctapipe-version: [v0.24.0]
4141

4242
defaults:
4343
run:

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
- default
55
dependencies:
6-
- ctapipe=0.19
6+
- ctapipe=0.24
77
- h5py
88
- ipython
99
- numba

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ classifiers = [
1515
"Topic :: Scientific/Engineering :: Astronomy",
1616
"Topic :: Scientific/Engineering :: Physics",
1717
"Programming Language :: Python :: 3 :: Only",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11"
2120
]
22-
requires-python = ">=3.9"
21+
requires-python = ">=3.10"
2322
dependencies = [
24-
"ctapipe~=0.19",
23+
"ctapipe~=0.24.0",
2524
"protozfits",
26-
"scipy==1.11.4",
25+
"scipy",
2726
]
2827

2928
# needed for setuptools_scm, we don't define a static version

src/ctapipe_io_nectarcam/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
from .anyarray_dtypes import CDTS_AFTER_37201_DTYPE, CDTS_BEFORE_37201_DTYPE, TIB_DTYPE
4747
from .calibration import NectarCAMR0Corrections
48-
from .constants import N_GAINS, N_PIXELS, N_SAMPLES
48+
from .constants import N_GAINS, N_PIXELS, N_SAMPLES, nectarcam_location
4949
from .containers import (
5050
NectarCAMDataContainer,
5151
NectarCAMDataStreamContainer,
@@ -636,7 +636,9 @@ def pre_v6_data(self):
636636
return self._pre_v6_data
637637

638638
@staticmethod
639-
def create_subarray(geometry_version, tel_id=0):
639+
def create_subarray(
640+
geometry_version, tel_id=0, reference_location=nectarcam_location
641+
):
640642
"""
641643
Obtain the subarray from the EventSource
642644
Returns
@@ -675,6 +677,7 @@ def create_subarray(geometry_version, tel_id=0):
675677
name=f"MST-{tel_id} subarray",
676678
tel_descriptions=tel_descriptions,
677679
tel_positions=tel_positions,
680+
reference_location=nectarcam_location,
678681
)
679682

680683
return subarray
@@ -962,7 +965,7 @@ def fill_nectarcam_event_container_from_zfile(self, array_event, event):
962965

963966
if not self.pre_v6_data:
964967
event_container.first_cell_id = np.full(
965-
(N_PIXELS,), -1, dtype=event.first_cell_id.dtype
968+
(N_PIXELS,), np.nan, dtype=event.first_cell_id.dtype
966969
)
967970
event_container.first_cell_id[
968971
self.nectarcam_service.pixel_ids
@@ -1137,8 +1140,7 @@ def fill_r0r1_camera_container(self, zfits_event):
11371140
Fill the r0 or r1 container, depending on whether gain
11381141
selection has already happened (r1) or not (r0)
11391142
This will create waveforms of shape (N_GAINS, N_PIXELS, N_SAMPLES),
1140-
or (N_PIXELS, N_SAMPLES) respectively regardless of the n_pixels, n_samples
1141-
in the file.
1143+
regardless of the n_pixels, n_samples in the file.
11421144
Missing or broken pixels are filled using maxval of the waveform dtype.
11431145
"""
11441146

src/ctapipe_io_nectarcam/constants.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import numpy as np
2+
from astropy import units as u
3+
from astropy.coordinates.earth import EarthLocation
24

35
N_GAINS = 2
46
N_MODULES = 265
@@ -9,3 +11,10 @@
911
LOW_GAIN = 1
1012

1113
PIXEL_INDEX = np.arange(N_PIXELS)
14+
15+
# Dummy location for NectarCAM, need for ctapipe.instrument.subarray
16+
nectarcam_location = EarthLocation(
17+
lon=0 * u.deg,
18+
lat=0 * u.deg,
19+
height=0 * u.m,
20+
)

0 commit comments

Comments
 (0)