NuRadioMC.SignalProp.propagation_base_class module

class NuRadioMC.SignalProp.propagation_base_class.ray_tracing_base(medium, attenuation_model=None, log_level=30, n_frequencies_integration=None, n_reflections=None, config=None, detector=None, ray_tracing_2D_kwards={})[source]

Bases: object

base class of ray tracer. All ray tracing modules need to prodide the following functions

Methods

apply_propagation_effects(efield, i_solution)

Apply propagation effects to the electric field Note that the 1/r weakening of the electric field is already accounted for in the signal generation

find_solutions()

find all solutions between x1 and x2

get_attenuation(iS, frequency[, ...])

calculates the signal attenuation due to attenuation in the medium (ice)

get_config()

Function that returns the configuration currently used by the raytracer

get_launch_vector(iS)

calculates the launch vector (in 3D) of solution iS

get_number_of_raytracing_solutions()

Function that returns the maximum number of raytracing solutions that can exist between each given pair of start and end points

get_number_of_solutions()

returns the number of solutions

get_output_parameters()

Returns a list with information about parameters to include in the output data structure that are specific to this raytracer

get_path(iS[, n_points])

helper function that returns the 3D ray tracing path of solution iS

get_path_length(iS[, analytic])

calculates the path length of solution iS

get_raytracing_output(i_solution)

Write parameters that are specific to this raytracer into the output data.

get_receive_vector(iS)

calculates the receive vector (in 3D) of solution iS

get_reflection_angle(iS)

calculates the angle of reflection at the surface (in case of a reflected ray)

get_solution_type(iS)

returns the type of the solution

get_travel_time(iS[, analytic])

calculates the travel time of solution iS

has_solution()

checks if ray tracing solution exists

set_config(config)

Function to change the configuration file used by the raytracer

set_start_and_end_point(x1, x2)

Set the start and end points between which raytracing solutions shall be found It is recommended to also reset the solutions from any previous raytracing to avoid confusing them with the current solution

use_optional_function(function_name, *args, ...)

Use optional function which may be different for each ray tracer.

get_results

reset_solutions

class initilization

Parameters:
medium: medium class

class describing the index-of-refraction profile

attenuation_model: string

signal attenuation model (so far only “SP1” is implemented)

log_level: logging object

specify the log level of the ray tracing class

  • logging.ERROR

  • logging.WARNING

  • logging.INFO

  • logging.DEBUG

default is WARNING

n_frequencies_integration: int

the number of frequencies for which the frequency dependent attenuation length is being calculated. The attenuation length for all other frequencies is obtained via linear interpolation.

n_reflections: int (default 0)

in case of a medium with a reflective layer at the bottom, how many reflections should be considered

config: nested dictionary

loaded yaml config file

detector: detector object
ray_tracing_2D_kwards: dict

Additional arguments which are passed to ray_tracing_2D

Methods

apply_propagation_effects(efield, i_solution)

Apply propagation effects to the electric field Note that the 1/r weakening of the electric field is already accounted for in the signal generation

find_solutions()

find all solutions between x1 and x2

get_attenuation(iS, frequency[, ...])

calculates the signal attenuation due to attenuation in the medium (ice)

get_config()

Function that returns the configuration currently used by the raytracer

get_launch_vector(iS)

calculates the launch vector (in 3D) of solution iS

get_number_of_raytracing_solutions()

Function that returns the maximum number of raytracing solutions that can exist between each given pair of start and end points

get_number_of_solutions()

returns the number of solutions

get_output_parameters()

Returns a list with information about parameters to include in the output data structure that are specific to this raytracer

get_path(iS[, n_points])

helper function that returns the 3D ray tracing path of solution iS

get_path_length(iS[, analytic])

calculates the path length of solution iS

get_raytracing_output(i_solution)

Write parameters that are specific to this raytracer into the output data.

get_receive_vector(iS)

calculates the receive vector (in 3D) of solution iS

get_reflection_angle(iS)

calculates the angle of reflection at the surface (in case of a reflected ray)

get_solution_type(iS)

returns the type of the solution

get_travel_time(iS[, analytic])

calculates the travel time of solution iS

has_solution()

checks if ray tracing solution exists

set_config(config)

Function to change the configuration file used by the raytracer

set_start_and_end_point(x1, x2)

Set the start and end points between which raytracing solutions shall be found It is recommended to also reset the solutions from any previous raytracing to avoid confusing them with the current solution

use_optional_function(function_name, *args, ...)

Use optional function which may be different for each ray tracer.

get_results

reset_solutions

reset_solutions()[source]
set_start_and_end_point(x1, x2)[source]

Set the start and end points between which raytracing solutions shall be found It is recommended to also reset the solutions from any previous raytracing to avoid confusing them with the current solution

Parameters:
x1: np.array of shape (3,), default unit

start point of the ray

x2: np.array of shape (3,), default unit

stop point of the ray

use_optional_function(function_name, *args, **kwargs)[source]

Use optional function which may be different for each ray tracer. If the name of the function is not present for the ray tracer this function does nothing.

Parameters:
function_name: string

name of the function to use

*args: type of the argument required by function

all the neseccary arguments for the function separated by a comma

**kwargs: type of keyword argument of function

all all the neseccary keyword arguments for the function in the form of key=argument and separated by a comma

Examples

use_optional_function('set_shower_axis',np.array([0,0,1]))
use_optional_function('set_iterative_sphere_sizes',sphere_sizes=np.aray([3,1,.5]))
find_solutions()[source]

find all solutions between x1 and x2

has_solution()[source]

checks if ray tracing solution exists

get_number_of_solutions()[source]

returns the number of solutions

get_results()[source]
get_solution_type(iS)[source]

returns the type of the solution

Parameters:
iS: int

choose for which solution to compute the launch vector, counting starts at zero

Returns:
solution_type: int

integer corresponding to the types in the dictionary solution_types

get_path(iS, n_points=1000)[source]

helper function that returns the 3D ray tracing path of solution iS

Parameters:
iS: int

ray tracing solution

n_points: int

number of points of path

get_launch_vector(iS)[source]

calculates the launch vector (in 3D) of solution iS

Parameters:
iS: int

choose for which solution to compute the launch vector, counting starts at zero

Returns:
launch_vector: 3dim np.array

the launch vector

get_receive_vector(iS)[source]

calculates the receive vector (in 3D) of solution iS

Parameters:
iS: int

choose for which solution to compute the launch vector, counting starts at zero

Returns:
receive_vector: 3dim np.array

the receive vector

get_reflection_angle(iS)[source]

calculates the angle of reflection at the surface (in case of a reflected ray)

Parameters:
iS: int

choose for which solution to compute the launch vector, counting starts at zero

Returns:
reflection_angle: float or None

the reflection angle (for reflected rays) or None for direct and refracted rays

get_path_length(iS, analytic=True)[source]

calculates the path length of solution iS

Parameters:
iS: int

choose for which solution to compute the launch vector, counting starts at zero

analytic: bool

If True the analytic solution is used. If False, a numerical integration is used. (default: True)

Returns:
distance: float

distance from x1 to x2 along the ray path

get_travel_time(iS, analytic=True)[source]

calculates the travel time of solution iS

Parameters:
iS: int

choose for which solution to compute the launch vector, counting starts at zero

analytic: bool

If True the analytic solution is used. If False, a numerical integration is used. (default: True)

Returns:
time: float

travel time

get_attenuation(iS, frequency, max_detector_freq=None)[source]

calculates the signal attenuation due to attenuation in the medium (ice)

Parameters:
iS: int

choose for which solution to compute the launch vector, counting starts at zero

frequency: array of floats

the frequencies for which the attenuation is calculated

max_detector_freq: float or None

the maximum frequency of the final detector sampling (the simulation is internally run with a higher sampling rate, but the relevant part of the attenuation length calculation is the frequency interval visible by the detector, hence a finer calculation is more important)

Returns:
attenuation: array of floats

the fraction of the signal that reaches the observer (only ice attenuation, the 1/R signal falloff not considered here)

apply_propagation_effects(efield, i_solution)[source]

Apply propagation effects to the electric field Note that the 1/r weakening of the electric field is already accounted for in the signal generation

Parameters:
efield: ElectricField object

The electric field that the effects should be applied to

i_solution: int

Index of the raytracing solution the propagation effects should be based on

Returns:
efield: ElectricField object

The modified ElectricField object

get_output_parameters()[source]

Returns a list with information about parameters to include in the output data structure that are specific to this raytracer

! be sure that the first entry is specific to your raytracer !

Returns:
list with entries of form [{‘name’: str, ‘ndim’: int}]

! be sure that the first entry is specific to your raytracer ! ‘name’: Name of the new parameter to include in the data structure ‘ndim’: Dimension of the data structure for the parameter

get_raytracing_output(i_solution)[source]

Write parameters that are specific to this raytracer into the output data.

Parameters:
i_solution: int

The index of the raytracing solution

Returns:
dictionary with the keys matching the parameter names specified in get_output_parameters and the values being
the results from the raytracing
get_number_of_raytracing_solutions()[source]

Function that returns the maximum number of raytracing solutions that can exist between each given pair of start and end points

get_config()[source]

Function that returns the configuration currently used by the raytracer

set_config(config)[source]

Function to change the configuration file used by the raytracer

Parameters:
config: dict

The new configuration settings