NuRadioReco.modules.likelihood_reconstruction.shower_simulator module
- class NuRadioReco.modules.likelihood_reconstruction.shower_simulator.ShowerSimulator(station_id, config_file, detector_simulation_filter_amp, detectorfile=None, det=None, use_channels=None, reference_channel=0, evt_time=datetime.datetime(2018, 1, 1, 0, 0), add_cable_delay=True, pre_pulse_time=200)[source]
Bases:
objectClass to simulate voltage traces for a specific shower(s) with user-defined vertex, energy, direction, etc. The Askaryan emission, propagation effects and detector response are simulated consistently with simulation.py, but no noise is added and triggers aren’t run. This is, e.g., useful for studies where only the MC true neutrino signal is of interest, and it can act as a pure neutrino signal model, which is needed in forward-folding reconstruction.
- Parameters:
- station_id: int
Station in the detector description to run the simulation for
- config_file: string
path to config file
- detector_simulation_filter_amp: function
Function to use as the _detector_simulation_filter_amp in the simulation class, e.g, hardware response and/or bandpass filter of the detector.
- detectorfile: string
path to the json file containing the detector description
- det: detector object
Pass a detector class object
- use_channels: list(int)
Channels in the station to run the simulation for. If None, all channels in the station will be used.
- reference_channel: int
Channel to calculate reference time for if no trace_start_times are provided. The pulse should appear pre_pulse_time into the trace for this channel.
- evt_time: datetime object
The time of the simulated event, default 1/1/2018
- add_cable_delay: bool
Whether to add the cable delay of the detector to the simulated traces, default True.
- pre_pulse_time: float
Time of the readout pulse in the reference channel relative to the start of the trace, if vertex_time is 0, default 200 ns. Ignored if trace_start_times are provided.
Methods
simulate_showers(showers, trace_start_times=None)
Simulate the traces for a list of shower objects.
simulate_single_shower(energy, zenith, azimuth, vertex, vertex_time, type, charge_excess_profile_id=1, trace_start_times=None)
Simulate the traces for a single shower with the given parameters.
simulate_single_shower_spherical_vertex_coordinates(energy, zenith, azimuth, vertex_r, vertex_theta, vertex_phi, vertex_time, type, charge_excess_profile_id=1, trace_start_times=None)
Reparameterization of simulate_single_shower where the vertex position is given in spherical coordinates instead of Cartesian coordinates.
simulate_single_shower_forward_folding(energy, zenith, azimuth, vertex_r_rel, vertex_theta_rel, vertex_phi_rel, pulse_time, type, trace_start_times, charge_excess_profile_id=1)
Reparameterization of simulate_single_shower where the vertex position is given in spherical coordinates relative to the reference antenna, and the pulse_time is the approximate time of the pulse in the reference antenna relative to the trace start times (does not account for antenna group delay). This reparametrization is useful for forward-folding reconstruction since it decreases the correlation between the parameters.
- simulate_showers(showers, trace_start_times=None)[source]
Simulate the traces for a list of user-defined showers (e.g. from a neutrino interaction).
- Parameters:
- showers: list of NuRadioReco.framework.radio_shower.RadioShower objects
List of shower objects to simulate.
- trace_start_times: array-like
Start times of the traces for each readout channel. If None, the start times will be set such that the pulse appears self.pre_pulse_time + shower[shp.vertex_time] into the trace of the reference channel.
- Returns:
- station: NuRadioReco.framework.station.Station
Station object containing the simulated channels.
- traces: numpy.ndarray
Numpy array of the simulated traces
- trace_start_times:
Start times of the traces for each readout channel calculated dynamically if not trace_start_times is provided.
- simulate_single_shower(energy, zenith, azimuth, vertex, vertex_time, type, charge_excess_profile_id=1, trace_start_times=None)[source]
Simulate the traces for a single shower with the given parameters, which can be used to simulate the neutrino signal with a given energy, direction, vertex position, and vertex time.
- Parameters:
- energy: float
Energy of the shower to simulate
- zenith: float
Zenith angle of the shower to simulate
- azimuth: float
Azimuth angle of the shower to simulate
- vertex: array-like
Vertex position of the shower in Cartesian coordinates (x,y,z)
- vertex_time: float
Time of the shower
- type: string
Type of the shower, either “HAD” or “EM”
- charge_excess_profile_id: int
Id of the charge excess profile to use for the simulation, default 1.
- trace_start_times: array-like
Start times of the traces for each readout channel. If None, the start times will be set such that the pulse appears self.pre_pulse_time + vertex_time into the trace of the reference channel. If a single trace_start_time is provided, it will be used for all channels.
- Returns:
- station: NuRadioReco.framework.station.Station
Station object containing the simulated channels.
- traces: numpy.ndarray
Numpy array of the simulated traces
- trace_start_times:
Start times of the traces for each readout channel which are automatically calcualted if trace_start_times is None.
- simulate_single_shower_spherical_vertex_coordinates(energy, zenith, azimuth, vertex_r, vertex_theta, vertex_phi, vertex_time, type, charge_excess_profile_id=1, trace_start_times=None)[source]
Reparameterization of simulate_single_shower where the vertex position is given in spherical coordinates instead of Cartesian coordinates. This often gives less correlated parameters for forward-folding reconstruction.
- Parameters:
- energy: float
Energy of the shower to simulate
- zenith: float
Zenith angle of the shower to simulate
- azimuth: float
Azimuth angle of the shower to simulate
- vertex_r: float
Radial distance of the shower vertex from the origin
- vertex_theta: float
Polar angle of the shower vertex
- vertex_phi: float
Azimuthal angle of the shower vertex
- vertex_time: float
Time of the shower
- type: string
Type of the shower, either “HAD” or “EM”
- charge_excess_profile_id: int
Id of the charge excess profile to use for the simulation, default 1.
- trace_start_times: array-like
Start times of the traces for each readout channel. If None, the start times will be set such that the pulse appears self.pre_pulse_time + vertex_time into the trace of the reference channel. If a single trace_start_time is provided, it will be used for all channels.
- Returns:
- station: NuRadioReco.framework.station.Station
Station object containing the simulated channels.
- traces: numpy.ndarray
Numpy array of the simulated traces
- trace_start_times:
Start times of the traces for each readout channel. If None, the start times will be set such that the pulse appears self.pre_pulse_time + vertex_time into the trace of the reference channel. If a single trace_start_time is provided, it will be used for all channels.
- simulate_single_shower_forward_folding(energy, zenith, azimuth, vertex_r_rel, vertex_theta_rel, vertex_phi_rel, pulse_time, type, trace_start_times, charge_excess_profile_id=1)[source]
Reparameterization of simulate_single_shower where the vertex position is given in spherical coordinates relative to the reference antenna, and the pulse_time is the approximate time of the pulse relative to the trace start times (does not account for antenna group delay). This reparametrization is useful for forward-folding reconstruction since it decreases the correlation between the parameters.
- Parameters:
- energy: float
Energy of the shower to simulate
- zenith: float
Zenith angle of the shower to simulate
- azimuth: float
Azimuth angle of the shower to simulate
- vertex_r_rel: float
Radial distance of the shower vertex from the reference antenna
- vertex_theta_rel: float
Polar angle of the shower vertex relative to the reference antenna
- vertex_phi_rel: float
Azimuthal angle of the shower vertex relative to the reference antenna
- pulse_time: float
Time of the pulse in the trace of the reference channel relative to the trace_start_time (doesn’t account for antenna group delays). This convention removes the correlation between the vertex time and the radial distance of the vertex, which are otherwise highly correlated.
- type: string
Type of the shower, either “HAD” or “EM”
- trace_start_times: array-like
Start times of the traces for each readout channel. The readout window has to be fixed for stable forward-folding reconstruction and should be taken from the trace start times of the data traces that the reconstruction is performed on.
- charge_excess_profile_id: int
id of the charge excess profile to use for the simulation, default 1.
- Returns:
- station: NuRadioReco.framework.station.Station
Station object containing the simulated channels.
- traces: numpy.ndarray
Numpy array of the simulated traces