NuRadioReco.modules.likelihood_reconstruction.electricFieldLikelihoodReconstructor module

class NuRadioReco.modules.likelihood_reconstruction.electricFieldLikelihoodReconstructor.electricFieldLikelihoodReconstructor[source]

Bases: object

Class for reconstructing electric fields in a station, e.g., a dual polarized antenna or the upwardfacing LPDAs in an RNO-G shallow station. This class forward-folds an analytical electric field, assumed to be the same in all channels, and compares it to a measured set of data traces in a likelihood objective function. The -2DeltaLLH is minimized in two stages, first using a matched filter to fit the shape of the signal and second a -2DeltaLLH minimization to fine-tune the reconstructed parameters. The likelihood is calculated using the spectrum of the noise, which enables correct error estimates of reconstructed parameters.

This class is similar to voltageToAnalyticEfieldConverter, but uses a likelihood based on the noise spectrum instead of a chi-square and has an improved minimization strategy.

The class assumes that the hardware response is subtracted from the data, e.g., hardwareResponseIncorporator.run(event, station, det, sim_to_data=False, mingainlin=0.001) has been run.

For a full description of the method, see Section III.C in https://arxiv.org/abs/2510.21925.

Methods

begin(n_channels, n_samples, sampling_rate, ...)

run(evt, station, det[, use_channels, ...])

Run the likelihood reconstruction of electric field.

begin(n_channels, n_samples, sampling_rate, noise_spectra, Vrms, filter_settings_list, use_chi2=False, zenith_azimuth_free=False, debug=False, travel_time_shifts=None)[source]
Parameters:
n_channels: int

Number of channels to be used in the reconstruction

n_samples: int

Number of samples in the traces

sampling_rate: float

Sampling rate of the traces

noise_spectra: np.ndarray

Noise spectrum for each channel to be used for the likelihood calculation, i.e., sqrt(mean(abs(rfft(noise_traces))^2)). The overall normalizations of the spectra are ignored and set through the parameter Vrms.

Vrms: float

RMS of the noise in each channel. Used for the likelihood calculation.

filter_settings_list: list of dicts, optional

List of filter settings to be applied to the electric field signal. The same filters must have been applied to the data and noise before this module is run.

use_chi2: bool, optional

Whether to use chi2 minimization instead of likelihood. Mostly used for debugging and method comparison.

zenith_azimuth_free: bool, optional

Whether to reconstruct the zenith and azimuth arrival direction of the electric field in the minimization, or keep them fixed. The initial (or fixed) value used is the reconstructed values present in the station object or the MC values in the sim_station object.

travel_time_shifts: np.ndarray

Travel times for the electric field to reach each antenna. If no travel time shifts are provided, they are calculated in efieldToVoltageConverter, which assumes the electric field is a plane wave. It is useful to provide ray-traced travel time shifts e.g. for deep in-ice antennas, where the plane wave approximation doesn’t hold.

debug: bool, optional

Extra plots and printouts for debugging

run(evt, station, det, use_channels=None, signal_search_window=None, use_MC_direction=False, second_order=False, full_output=False, save_filtered_efield=True)[source]

Run the likelihood reconstruction of electric field.

Parameters:
evt: NuRadioReco.framework.event.Event

The event to run the module on.

station: NuRadioReco.framework.station.Station

The station object containing the channels with the data traces.

det: NuRadioReco.framework.detector.Detector

The detector description.

use_channels: list, optional

List of channel IDs to be used for the reconstruction. If None, all channels are used.

signal_search_window: tuple, optional

Time window (start, end) to search for the signal in the traces.

use_MC_direction: bool, optional

Whether to use the Monte Carlo true arrival direction for the reconstruction if it is present in the sim_station object. Default: False

second_order: bool, optional

If True, fit include the second order term in the frequency domain of the electric field as a fitting parameter. Otherwise, the second order term is fixed to 0. Default: False

full_output: bool, optional

If True, return the reconstructed signal, the signal parameters and the minus two log-likelihood of the reconstructed signal. Default: False

save_filtered_efield: bool, optional

Wether saved efield and its fluence are for the filtered or unfiltered electric field. If True, the module works in a way that is consistent with voltageToEfieldConverter and voltageToAnalyticEfieldConverter. Default: True

Returns:
fitted_signal: np.ndarray

The reconstructed signal in the readout traces. Only returned if full_output enabled

fitted_params_best: np.ndarray

The best fit parameters of the signal model. Only returned if full_output enabled

minus_two_llh_best: float

The minus two log-likelihood value of the reconstructed signal. Only returned if full_output enabled