Skip to content

Commit ea18449

Browse files
committed
Rationalized use of constants (number of camera pixels)
1 parent 23eaa32 commit ea18449

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/nectarchain/user_scripts/ltibaldo/pedestal_NSB.py

Lines changed: 12 additions & 9 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")
@@ -91,11 +94,11 @@
9194
pixel_display = [100, 144, 240, 723, 816, 1034, 1516]
9295
fill_value = np.nan
9396

94-
pixel_process = np.arange(1855)
97+
pixel_process = np.arange(N_PIXELS)
9598
# pixel_process = pixel_display
9699

97-
slopes_width_hg = np.full([len(pedfiles), 1855], fill_value=fill_value)
98-
slopes_width_lg = np.full([len(pedfiles), 1855], fill_value=fill_value)
100+
slopes_width_hg = np.full([len(pedfiles), N_PIXELS], fill_value=fill_value)
101+
slopes_width_lg = np.full([len(pedfiles), N_PIXELS], fill_value=fill_value)
99102

100103
for itemp, uberset in enumerate(pedfiles):
101104
temp = uberset["T"]
@@ -106,10 +109,10 @@
106109
if not os.path.exists(outdir):
107110
os.makedirs(outdir)
108111

109-
slopes_ped_hg = np.full(1855, fill_value=fill_value)
110-
slopes_rms_hg = np.full(1855, fill_value=fill_value)
111-
slopes_ped_lg = np.full(1855, fill_value=fill_value)
112-
slopes_rms_lg = np.full(1855, fill_value=fill_value)
112+
slopes_ped_hg = np.full(N_PIXELS, fill_value=fill_value)
113+
slopes_rms_hg = np.full(N_PIXELS, fill_value=fill_value)
114+
slopes_ped_lg = np.full(N_PIXELS, fill_value=fill_value)
115+
slopes_rms_lg = np.full(N_PIXELS, fill_value=fill_value)
113116

114117
removed_pixels = 0
115118
flagged_pixels = 0
@@ -297,8 +300,8 @@
297300
if not os.path.exists(outdir):
298301
os.makedirs(outdir)
299302

300-
slopes_hg = np.full(1855, fill_value=fill_value)
301-
slopes_lg = np.full(1855, fill_value=fill_value)
303+
slopes_hg = np.full(N_PIXELS, fill_value=fill_value)
304+
slopes_lg = np.full(N_PIXELS, fill_value=fill_value)
302305
x = [data["T"] for data in pedfiles]
303306

304307
print("Working on temperature variations")

0 commit comments

Comments
 (0)