Skip to content

Commit 48f7e24

Browse files
authored
Merge pull request #310 from cta-observatory/lstcam_calib
Use lstcam_calib instead of lstchain for the calibration
2 parents 831ce71 + f865da4 commit 48f7e24

File tree

8 files changed

+35
-28
lines changed

8 files changed

+35
-28
lines changed

Diff for: .github/workflows/ci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
strategy:
3232
matrix:
3333
include:
34-
- python-version: "3.9"
35-
3634
- python-version: "3.10"
3735

3836
- python-version: "3.11"

Diff for: environment.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ dependencies:
2121
- click
2222
- pymongo
2323
- scikit-learn=1.2
24-
- protobuf=3.20
25-
- ctapipe_io_lst=0.22
24+
- ctapipe_io_lst=0.24
2625
- ctaplot~=0.6.4
2726
- pyirf~=0.10
28-
- lstchain>=0.10.7
27+
- lstchain>=0.10.13
2928
- tenacity
29+
- pip:
30+
- lstcam_calib
3031
# dev dependencies
3132
- pytest
3233
- pytest-cov

Diff for: extra/history_files/sequence_LST1_04183.history

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
04179 onsite_create_drs4_pedestal_file v0.7.0 2021-12-19 22:11 None None 0
2-
04183 onsite_create_calibration_file v0.7.0 2021-12-19 22:11 None None 0
1+
04179 lstcam_calib_onsite_create_drs4_pedestal_file v0.7.0 2021-12-19 22:11 None None 0
2+
04183 lstcam_calib_onsite_create_calibration_file v0.7.0 2021-12-19 22:11 None None 0

Diff for: pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ classifiers = [
2626
"Topic :: Scientific/Engineering :: Astronomy",
2727
"Topic :: Scientific/Engineering :: Physics",
2828
"Programming Language :: Python :: 3",
29-
"Programming Language :: Python :: 3.9",
3029
"Programming Language :: Python :: 3.10",
3130
"Programming Language :: Python :: 3.11",
3231
]
3332

34-
requires-python = ">=3.9"
33+
requires-python = ">=3.10"
3534
dependencies = [
3635
"astropy~=5.0",
37-
"lstchain>=0.10.7",
36+
"lstchain>=0.10.13",
3837
"matplotlib",
3938
"numpy",
4039
"pandas",
@@ -48,6 +47,7 @@ dependencies = [
4847
"pymongo",
4948
"gammapy~=1.1",
5049
"tenacity",
50+
"lstcam_calib",
5151
]
5252

5353
dynamic = ["version"]

Diff for: src/osa/configs/sequencer.cfg

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ DL2_PROD_ID: model2
4141

4242
[lstchain]
4343
# Calibration steps in calibration pipeline script
44-
drs4_baseline: onsite_create_drs4_pedestal_file
45-
charge_calibration: onsite_create_calibration_file
44+
#drs4_baseline: onsite_create_drs4_pedestal_file
45+
#charge_calibration: onsite_create_calibration_file
46+
drs4_baseline: lstcam_calib_onsite_create_drs4_pedestal_file
47+
charge_calibration: lstcam_calib_onsite_create_calibration_file
4648
use_ff_heuristic_id: False
4749

4850
# Data processing steps in datasequence script

Diff for: src/osa/scripts/calibration_pipeline.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,23 @@ def is_calibration_produced(drs4_pedestal_run_id: int, pedcal_run_id: int) -> bo
4444
def drs4_pedestal_command(drs4_pedestal_run_id: int) -> list:
4545
"""Build the create_drs4_pedestal command."""
4646
base_dir = Path(cfg.get("LST1", "BASE")).resolve()
47+
command = cfg.get("lstchain", "drs4_baseline")
4748
return [
48-
"onsite_create_drs4_pedestal_file",
49-
f"--run_number={drs4_pedestal_run_id}",
50-
f"--base_dir={base_dir}",
49+
command,
50+
"-r", str(drs4_pedestal_run_id),
51+
"-b", base_dir,
5152
"--no-progress",
5253
]
5354

54-
5555
def calibration_file_command(drs4_pedestal_run_id: int, pedcal_run_id: int) -> list:
5656
"""Build the create_calibration_file command."""
5757
base_dir = Path(cfg.get("LST1", "BASE")).resolve()
58+
command = cfg.get("lstchain", "charge_calibration")
5859
cmd = [
59-
"onsite_create_calibration_file",
60-
f"--pedestal_run={drs4_pedestal_run_id}",
61-
f"--run_number={pedcal_run_id}",
62-
f"--base_dir={base_dir}",
60+
command,
61+
"-p", str(drs4_pedestal_run_id),
62+
"-r", str(pedcal_run_id),
63+
"-b", base_dir,
6364
]
6465
# In case of problems with trigger tagging:
6566
if cfg.getboolean("lstchain", "use_ff_heuristic_id"):

Diff for: src/osa/scripts/tests/test_osa_scripts.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,11 @@ def test_drs4_pedestal_cmd(base_test_dir):
301301

302302
cmd = drs4_pedestal_command(drs4_pedestal_run_id="01804")
303303
expected_command = [
304-
"onsite_create_drs4_pedestal_file",
305-
"--run_number=01804",
306-
f"--base_dir={base_test_dir}",
304+
cfg.get("lstchain", "drs4_baseline"),
305+
"-r",
306+
"01804",
307+
"-b",
308+
base_test_dir,
307309
"--no-progress",
308310
]
309311
assert cmd == expected_command
@@ -314,10 +316,13 @@ def test_calibration_file_cmd(base_test_dir):
314316

315317
cmd = calibration_file_command(drs4_pedestal_run_id="01804", pedcal_run_id="01809")
316318
expected_command = [
317-
"onsite_create_calibration_file",
318-
"--pedestal_run=01804",
319-
"--run_number=01809",
320-
f"--base_dir={base_test_dir}",
319+
cfg.get("lstchain", "charge_calibration"),
320+
"-p",
321+
"01804",
322+
"-r",
323+
"01809",
324+
"-b",
325+
base_test_dir,
321326
]
322327
assert cmd == expected_command
323328

Diff for: src/osa/tests/test_jobs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def test_set_cache_dirs():
395395
def test_calibration_history_level():
396396
from osa.job import check_history_level
397397

398-
levels = {"onsite_create_drs4_pedestal_file": 1, "onsite_create_calibration_file": 0}
398+
levels = {cfg.get("lstchain", "drs4_baseline"): 1, cfg.get("lstchain", "charge_calibration"): 0}
399399
level, exit_status = check_history_level(calibration_history_file, levels)
400400
assert level == 0
401401
assert exit_status == 0

0 commit comments

Comments
 (0)