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

Commit

Permalink
Change photoionization file format to avoid pkl (#411)
Browse files Browse the repository at this point in the history
* Photoionization file

* Photoionization file 2

* Minor change

---------

Co-authored-by: Diego Ramírez García <diego.ramirez@physik.uni-freiburg.de>
  • Loading branch information
shenyangshi and ramirezdiego authored Sep 7, 2023
1 parent c12e411 commit 026f910
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 026f910

Please sign in to comment.