Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Change WFSim SR1 photoionization file format since pkl is banned #411

Merged
merged 5 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion wfsim/core/afterpulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ def electron_afterpulse(self, signal_pulse, signal_pulse_instruction):
delaytime_pmf_hist = self.resource.uniform_to_ele_ap

# To save calculation we first find out how many photon will give rise ap
# Number of "created electrons" in liquid xenon
n_electron = np.random.poisson(delaytime_pmf_hist.n
* len(signal_pulse._photon_timings)
* len(signal_pulse._photon_timings) # Number of "detected" photons
* self.config['photoionization_modifier'])

ap_delay = delaytime_pmf_hist.get_random(n_electron)
Expand Down
3 changes: 1 addition & 2 deletions wfsim/load_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def config_to_file(config):
"s2_luminescence_gg": "garfield_timing_map_gas_gap_sr0.npy",
'gas_gap_map': 'gas_gap_warping_map_January_2021.pkl',
'garfield_gas_gap_map': 'garfield_gas_gap_map_sr0.json',
'ele_ap_pdfs': 'x1t_se_afterpulse_delaytime.pkl.gz',
'noise_file': 'x1t_noise_170203_0850_00_small.npz',
'fdc_3d': 'XnT_3D_FDC_xyt_dummy_all_zeros_v0.1.json.gz',
'field_dependencies_map': '',
Expand Down Expand Up @@ -359,7 +358,7 @@ def _rz_map(z, xy, **kwargs):

# Electron After Pulses
if config.get('enable_electron_afterpulses', False):
self.uniform_to_ele_ap = straxen.get_resource(files['ele_ap_pdfs'], fmt='pkl.gz')
self.uniform_to_ele_ap = straxen.get_resource(config.get('ele_ap_pdfs', ''), fmt='dill')

# S2 photons timing optical propagation delays
if config.get('s2_time_spline', False):
Expand Down