pixie16.analyze module¶
Functions to help analyze PIXIE-16 data
- pixie16.analyze.calculate_CFD(traces, t=None, CFD_threshold=None, w=1, B=5, D=5, L=1, Nbkgd=100)¶
Calculate the CFD trace as is done by the PIXIE
Also provide the option to change parameters used in the calculations (The calculations we do here is for the 500 MHz version).
The input can be 1d or 2d in which case the output will be also 1d or 2d.
- input:
traces (N, M) numpy array: N= number of traces, M=number of data points t (M, 1) numpy arrray, the time axes for the traces
- output:
CFD (N, M-B-D-L+1) numpy array zero_crossing (N, 1) numpy array: the time of the zero crossing errors True/False array if CFD could be established or not
- pixie16.analyze.calculate_CFD_using_FF(traces, t=None, CFD_threshold=None, FF_threshold=None, Lf=10, Gf=10, w=1, B=5, D=5, L=1, Nbkgd=10, FF_delay=0, CFD_delay=0)¶
Calculate the CFD trace as is done by the PIXIE
Also provide the option to change parameters used in the calculations (The calculations we do here is for the 500 MHz version).
The input can be 1d or 2d in which case the output will be also 1d or 2d.
- input:
traces (N, M) numpy array: N= number of traces, M=number of data points t (M, 1) numpy arrray, the time axes for the traces
- output:
CFD (N, M-B-D-L+1) numpy array cfdtime (N, 1) numpy array: the time of the zero crossing FF numpy array: fast filter used for the calculation IDXerr numpy array: index of CFD errors
- pixie16.analyze.calculate_fast_filter(traces: numpy.ndarray, L: int = 1, G: int = 1, filter_range: int = 0) numpy.ndarray ¶
Calculate the fast filter response.
- Parameters:
traces – 1D or 2D array of 1 or N traces of lengths M.
L – in FPGA units, 1 = 10 ns
G – in FPGA units, 1 = 10 ns
filter_range – number of FPGA steps in 2^filter_range that are summed up
- Returns:
The calculated fast filter response of the whole trace.
- Return type:
np.ndarray
- pixie16.analyze.calculate_filter(traces, L=10, G=10)¶
Calculate the fast and slow filter response from the PIXIE
This implements the filter response as discribted on page 81 in section 6.1 of the manual.
The input can be 1d or 2d in which case the output will be also 1d or 2d.
- input:
traces (N, M) numpy array. N traces with a length of M L integer: length of the integration time G integer: gap between the two integration region
- output:
result (N, M-2L-G+1)
- pixie16.analyze.convert_trace_to_FPGA(traces: numpy.ndarray, filter_range: int = 0)¶
Sum up 2**filter_range steps in trace to match FPGA clock cycle.
The FPGA (100 MHz = 10 ns) always handels at least 5 data points (2ns) at a time. It does this by adding up 5 data points into a single point.
For some calculations the FPGA sums up more data points (up to 2^filter_range), for example, for the energy calculations the minimum filter_range setting is 1.
- Parameters:
traces – A 1D or 2D array of 2 ns time step data. For 1D, the number of data points, M, needs to be a multiple of 5*2^filter_range. For 2D, the size N,M of the array needs to confirm to N traces with a length of M, where M needs to fulfill the same constraints as in the 1D case.
filter_range – 5*2^filter_range points will be added up
Result
------ – For the 1D case, return a ndarray with size M/(5*2^filter_range) and for the 2D case, return a N,M/(5*2^filter_range) array
- pixie16.analyze.ensure_2d_array(f)¶
Convert 1D numpy array to 2D arrays and back.
Using this decorator ensures that the first argument is always a 2d array. This way all functions below only need to handle that case.
- pixie16.analyze.get_fast_trigger_index(traces, threshold)¶
Return the indices where the trace value is >= threshold.