Skip to content
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
7 changes: 3 additions & 4 deletions invisible_cities/cities/beersheba.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,13 @@
from .. types.symbols import InterpolationMethod
from .. types.symbols import CutType
from .. types.symbols import DeconvolutionMode

from .. types.ic_types import Tuple2Dor3D

from typing import Tuple
from typing import List
from typing import Optional
from typing import Union


def event_info_adder(timestamp : float, dst : pd.DataFrame):
return dst.assign(time=timestamp/1e3, nsipm=0, Xrms=0, Yrms=0)

Expand All @@ -104,8 +103,8 @@ def deconvolve_signal(det_db : pd.DataFrame,
e_cut : float,
n_iterations : int,
iteration_tol : float,
sample_width : List[float],
bin_size : List[float],
sample_width : Tuple2Dor3D,
bin_size : Tuple2Dor3D,
satellite_params : Union[dict, NoneType],
diffusion : Optional[Tuple[float, float, float]]=(1., 1., 0.3),
energy_type : Optional[HitEnergy]=HitEnergy.Ec,
Expand Down
6 changes: 3 additions & 3 deletions invisible_cities/config/beersheba.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ same_peak = True

deconv_params = dict(
q_cut = 10,
drop_dist = [10., 10.],
drop_dist = (10., 10.),
psf_fname = '$ICDIR/database/test_data/PSF_dst_sum_collapsed.h5',
e_cut = 1e-3,
n_iterations = 100,
iteration_tol = 0.01,
sample_width = [10., 10.],
bin_size = [ 1., 1.],
sample_width = (10., 10.),
bin_size = ( 1., 1.),
energy_type = Ec,
diffusion = (1.0, 1.0),
deconv_mode = joint,
Expand Down
6 changes: 3 additions & 3 deletions invisible_cities/reco/deconv_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from .. types.ic_types import NoneType
from .. types.symbols import InterpolationMethod
from .. types.symbols import CutType

from .. types.ic_types import Tuple2Dor3D

def collect_component_sizes(im_mask : np.ndarray) -> (np.ndarray, np.ndarray):
'''
Expand Down Expand Up @@ -236,7 +236,7 @@ def drop_event(df):

return drop_event

def deconvolution_input(sample_width : List[float ],
def deconvolution_input(sample_width : Tuple2Dor3D,
det_grid : List[np.ndarray],
inter_method : InterpolationMethod = InterpolationMethod.cubic
) -> Callable:
Expand Down Expand Up @@ -350,7 +350,7 @@ def find_nearest(array : np.ndarray,
@check_annotations
def deconvolve(n_iterations : int,
iteration_tol : float,
sample_width : List[float],
sample_width : Tuple2Dor3D,
det_grid : List[np.ndarray],
satellite_start_iter : Union[int, NoneType],
satellite_max_size : int,
Expand Down
4 changes: 4 additions & 0 deletions invisible_cities/types/ic_types.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
from enum import Enum
from collections import OrderedDict
from typing import Union
from typing import Tuple

import numpy as np

NN= -999999 # No Number, a trick to aovid nans in data structs

NoneType = type(None)

Tuple2Dor3D = Union[Tuple[float, float], Tuple[float, float, float]]

class NNN:

def __getattr__(self, _):
Expand Down