NuRadioMC.SignalProp.directRayTracing module
- class NuRadioMC.SignalProp.directRayTracing.direct_ray_tracing(medium, attenuation_model=None, log_level=30, n_frequencies_integration=None, n_reflections=None, config=None, detector=None, ray_tracing_2D_kwards={})[source]
Bases:
ray_tracing_base
Raytracing module for direct ray (straight line) propagation.
Methods
apply_propagation_effects
(efield, iS)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 all solutions between x1 and x2
get_attenuation
(iS, frequency[, ...])calculates the signal attenuation due to attenuation in the medium (ice)
Function that returns the configuration currently used by the raytracer
calculates the launch vector (in 3D) of solution iS
Function that returns the maximum number of raytracing solutions that can exist between each given pair of start and end points
returns the number of solutions
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])Calculates the path from the shower to the observer of the iS'th solution and splits it into segments (points).
get_path_length
(iS)calculates the path length of solution iS
get_raytracing_output
(i_solution)Write parameters that are specific to this raytracer into the output data.
calculates the receive vector (in 3D) of solution iS
calculates the angle of reflection at the surface (in case of a reflected ray)
returns the type of the solution
get_travel_time
(iS)Calculate the travel time for the signal traveling along the 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, iS)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 all solutions between x1 and x2
get_attenuation
(iS, frequency[, ...])calculates the signal attenuation due to attenuation in the medium (ice)
Function that returns the configuration currently used by the raytracer
calculates the launch vector (in 3D) of solution iS
Function that returns the maximum number of raytracing solutions that can exist between each given pair of start and end points
returns the number of solutions
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])Calculates the path from the shower to the observer of the iS'th solution and splits it into segments (points).
get_path_length
(iS)calculates the path length of solution iS
get_raytracing_output
(i_solution)Write parameters that are specific to this raytracer into the output data.
calculates the receive vector (in 3D) of solution iS
calculates the angle of reflection at the surface (in case of a reflected ray)
returns the type of the solution
get_travel_time
(iS)Calculate the travel time for the signal traveling along the 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
- 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_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]
Calculates the path from the shower to the observer of the iS’th solution and splits it into segments (points). The returned path is an array with dimensions [n_points, 3].
- 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_path_length(iS)[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)[source]
Calculate the travel time for the signal traveling along the solution. Takes into account the varying index of refraction along the path.
- get_reflection_angle()[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
- apply_propagation_effects(efield, iS)[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_attenuation(iS, frequency, max_detector_freq=None)
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)
- get_config()
Function that returns the configuration currently used by the raytracer
- 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_results()
- has_solution()
checks if ray tracing solution exists
- reset_solutions()
- set_config(config)
Function to change the configuration file used by the raytracer
- Parameters:
- config: dict
The new configuration settings
- 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
- 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)
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]))