Skip to content

Commit 7cd5353

Browse files
committed
Avoid using hardcoded values in multiple places for number of camera pixels
1 parent 71a5384 commit 7cd5353

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/nectarchain/user_scripts/ltibaldo/pedestal_temperature.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
import pandas as pd
66
import seaborn as sns
77
import tables
8+
9+
# Imports from ctapipe
810
from ctapipe.coordinates import EngineeringCameraFrame
911
from ctapipe.instrument import CameraGeometry
1012
from ctapipe.visualization import CameraDisplay
13+
from ctapipe_io_nectarcam.constants import N_PIXELS
1114
from scipy import stats
1215

1316
sns.set(style="whitegrid")
@@ -27,15 +30,15 @@
2730
pixel_display = [100, 144, 663, 1058, 491, 631, 656, 701, 756, 757, 1612, 1629]
2831

2932
fill_value = np.nan
30-
slopes_ped_hg = np.full(1855, fill_value=fill_value)
31-
slopes_rms_hg = np.full(1855, fill_value=fill_value)
32-
slopes_ped_lg = np.full(1855, fill_value=fill_value)
33-
slopes_rms_lg = np.full(1855, fill_value=fill_value)
33+
slopes_ped_hg = np.full(N_PIXELS, fill_value=fill_value)
34+
slopes_rms_hg = np.full(N_PIXELS, fill_value=fill_value)
35+
slopes_ped_lg = np.full(N_PIXELS, fill_value=fill_value)
36+
slopes_rms_lg = np.full(N_PIXELS, fill_value=fill_value)
3437

3538
removed_pixels = 0
3639
flagged_pixels = 0
3740

38-
for pixel_id in np.arange(1855):
41+
for pixel_id in np.arange(N_PIXELS):
3942
print("Working on pixel {}".format(pixel_id))
4043
# fill panda dataframe
4144
temperatures = []

0 commit comments

Comments
 (0)