Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waveform noise tuner #1282

Merged
merged 21 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lstchain/reco/r0_to_dl1.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ def r0_to_dl1(
pulse_templates = {tel_id: NormalizedPulseTemplate.load_from_eventsource(
subarray.tel[tel_id].camera.readout, resample=True)
for tel_id in config['source_config']['LSTEventSource']['allowed_tels']}
if 'nsb_tuning_rate' in config['waveform_nsb_tuning'].keys():
if 'nsb_tuning_rate_GHz' in config[
'waveform_nsb_tuning'].keys():
moralejo marked this conversation as resolved.
Show resolved Hide resolved
# get value from config to possibly extract it beforehand on multiple files for averaging purposes
# or gain time
nsb_tuning_rate = config['waveform_nsb_tuning'][
Expand All @@ -438,8 +439,10 @@ def r0_to_dl1(
logger.info(f'{nsb_tuning_rate:.3f} GHz for telescope ids:')
logger.info(f'{allowed_tels}')

nsb_per_tel = np.ones(np.max(allowed_tels)+1) * nsb_tuning_rate
nsb_tuner = WaveformNsbTunner(nsb_per_tel * u.GHz,
nsb_per_tel = {tel_id: nsb_tuning_rate * u.GHz for tel_id in
allowed_tels}

nsb_tuner = WaveformNsbTunner(nsb_per_tel,
moralejo marked this conversation as resolved.
Show resolved Hide resolved
pulse_templates,
charge_spe_cumulative_pdf,
pre_computed_multiplicity)
Expand Down
2 changes: 1 addition & 1 deletion lstchain/scripts/lstchain_tune_nsb_waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def main():

dict_nsb = {
"nsb_tuning": True,
"nsb_tuning_rate": np.round(extra_nsb_rate, decimals=3),
"nsb_tuning_rate_GHz": np.round(extra_nsb_rate, decimals=3),
"spe_location": str(get_resource_path("data/SinglePhE_ResponseInPhE_expo2Gaus.dat"))
}

Expand Down
Loading