Skip to content

Commit

Permalink
714 Use IC io load_dst instead of pandas read_hdf to load PSFs
Browse files Browse the repository at this point in the history
[author: aretno]
The use of read_hdf function as it is fails in higher pandas
versions. This uses the standard IC function to load dataframes to
discouple the version problem from beersheba city.

[reviewer: mmkekic]
This PR fixes the reader of psf_file that was doomed to fail in more
recent pandas version. Good job, we are one step closer to updating
our environment!
  • Loading branch information
mmkekic authored and bpalmeiro committed Apr 10, 2020
2 parents 3b59d3b + 4a41eb9 commit be2ef24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion invisible_cities/cities/beersheba.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from .. io. mcinfo_io import mc_info_writer
from .. io.run_and_event_io import run_and_event_writer
from .. io. dst_io import store_pandas_as_tables
from .. io. dst_io import load_dst

from .. evm.event_model import HitEnergy

Expand Down Expand Up @@ -110,7 +111,7 @@ def deconvolve_signal(psf_fname : str,
bin_size = np.asarray(bin_size )
diffusion = np.asarray(diffusion )

psfs = pd.read_hdf(psf_fname)
psfs = load_dst(psf_fname, 'PSF', 'PSFs')
deconvolution = deconvolve(n_iterations, iteration_tol, sample_width, bin_size, inter_method)

if energy_type not in HitEnergy :
Expand Down

0 comments on commit be2ef24

Please # to comment.