Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into srcdep_radmax
  • Loading branch information
SeiyaNozaki committed Jul 11, 2022
2 parents d73ae0d + 0a4ceac commit 29fe165
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dependencies:
- seaborn
- jinja2=3.0 # pinned for bokeh 1.0 compatibility
- pip:

- ctapipe_io_lst~=0.18.1
- ctapipe_io_lst~=0.18.2
- ctaplot~=0.6.2
- pyirf~=0.6.0
3 changes: 1 addition & 2 deletions lstchain/calib/camera/flatfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ def calculate_relative_gain(self, event):

self.collect_sample(charge, pixel_mask, arrival_time)

sample_age = self.trigger_time - self.time_start

sample_age = (self.trigger_time - self.time_start).to_value(u.s)
# check if to create a calibration event
if (self.num_events_seen > 0 and
(sample_age > self.sample_duration or
Expand Down
4 changes: 1 addition & 3 deletions lstchain/calib/camera/pedestals.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ def calculate_pedestals(self, event):

self.collect_sample(charge, pixel_mask)

sample_age = self.trigger_time - self.time_start


sample_age = (self.trigger_time - self.time_start).to_value(u.s)
# check if to create a calibration event
if (self.num_events_seen > 0 and
(sample_age > self.sample_duration or
Expand Down
2 changes: 2 additions & 0 deletions lstchain/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def observed_dl1_files(temp_dir_observed_files, run_summary_path):
"2516351600",
"--dragon-module-id",
"132",
"--default-trigger-type=tib",
)

run_program(
Expand Down Expand Up @@ -163,6 +164,7 @@ def observed_dl1_files(temp_dir_observed_files, run_summary_path):
test_drive_report,
'--run-summary-path',
run_summary_path,
"--default-trigger-type=tib",
)

run_program(
Expand Down
2 changes: 1 addition & 1 deletion lstchain/image/tests/test_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_calculate_noise_parameters(mc_gamma_testfile, observed_dl1_files):
observed_dl1_files["dl1_file1"]
)
assert extra_noise_in_dim_pixels == 0.0
assert np.isclose(extra_bias_in_dim_pixels, 11.3, atol=0.1)
assert np.isclose(extra_bias_in_dim_pixels, 11.02, atol=0.1)
assert extra_noise_in_bright_pixels == 0.0


Expand Down
8 changes: 8 additions & 0 deletions lstchain/scripts/lstchain_data_r0_to_dl1.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@
)
)

parser.add_argument(
'--default-trigger-type',
help='Alias for LSTEventSource.default_trigger_type, can be set to "tib" for runs with UCTS problems.',
)


def main():
args = parser.parse_args()
Expand Down Expand Up @@ -201,6 +206,9 @@ def main():
if args.pedestal_ids_path is not None:
lst_event_source['pedestal_ids_path'] = args.pedestal_ids_path

if args.default_trigger_type is not None:
lst_event_source["default_trigger_type"] = args.default_trigger_type

lst_r0_corrections = lst_event_source['LSTR0Corrections']
if args.pedestal_file is not None:
lst_r0_corrections['drs4_pedestal_path'] = args.pedestal_file
Expand Down
2 changes: 1 addition & 1 deletion lstchain/scripts/tests/test_lstchain_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_validity_tune_nsb(tune_nsb):
if "extra_noise_in_dim_pixels" in line:
assert line == ' "extra_noise_in_dim_pixels": 0.0,'
if "extra_bias_in_dim_pixels" in line:
assert line == ' "extra_bias_in_dim_pixels": 11.304,'
assert line == ' "extra_bias_in_dim_pixels": 11.019,'
if "transition_charge" in line:
assert line == ' "transition_charge": 8,'
if "extra_noise_in_bright_pixels" in line:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def find_scripts(script_dir, prefix):
'astropy~=4.2',
'bokeh~=1.0',
'ctapipe~=0.12.0',
'ctapipe_io_lst~=0.18.1',
'ctapipe_io_lst~=0.18.2',
'ctaplot~=0.6.2',
'eventio>=1.5.1,<2.0.0a0', # at least 1.1.1, but not 2
'gammapy~=0.19.0',
Expand Down

0 comments on commit 29fe165

Please sign in to comment.