NuRadioReco.detector.antennapattern module
- NuRadioReco.detector.antennapattern.interpolate_linear(x, x0, x1, y0, y1, interpolation_method='complex')[source]
Linearly interpolate between two (arrays of) complex numbers
All arguments may be scalars or arrays as long as they broadcast against each other. Where the two data points coincide (
x0 == x1)y0is returned.- Parameters:
- x: float or array of floats
the requested position(s)
- x0, y0: float or complex float (or arrays thereof)
the first data point
- x1, y1: float or complex float (or arrays thereof)
the second data point
- interpolation_method: string
specifies if interpolation is in
complex (default) i.e. real and imaginary part
magnitude and phase
- Returns:
- y: complex float or array of complex floats
the interpolated value(s)
- NuRadioReco.detector.antennapattern.interpolate_linear_vectorized(x, x0, x1, y0, y1, interpolation_method='complex')
Linearly interpolate between two (arrays of) complex numbers
All arguments may be scalars or arrays as long as they broadcast against each other. Where the two data points coincide (
x0 == x1)y0is returned.- Parameters:
- x: float or array of floats
the requested position(s)
- x0, y0: float or complex float (or arrays thereof)
the first data point
- x1, y1: float or complex float (or arrays thereof)
the second data point
- interpolation_method: string
specifies if interpolation is in
complex (default) i.e. real and imaginary part
magnitude and phase
- Returns:
- y: complex float or array of complex floats
the interpolated value(s)
- NuRadioReco.detector.antennapattern.get_interpolation_weight(x, x0, x1)[source]
Fraction of the way from
x0tox1at whichxlies, 0 for x0 == x1
- NuRadioReco.detector.antennapattern.interpolate_bilinear(x, nodes_x, y, nodes_y, corners, interpolation_method='complex')[source]
Interpolate within a 2-D grid cell from the values at its four corners
corners[..., i, j]is the value at(nodes_x[i], nodes_y[j]).The ‘complex’ interpolation is linear in the values, so the cell collapses into a single weighted sum of the four corners, which is ~3x faster than interpolating one axis after the other. The ‘magphase’ interpolation is not linear in the values and has to go axis by axis.
- Parameters:
- x, y: float
the requested position within the cell
- nodes_x, nodes_y: array of floats
the two bracketing nodes of either axis
- corners: array of complex floats
the values at the four corners, shape
(..., 2, 2)- interpolation_method: string
- Returns:
- values: array of complex floats
the interpolated values, shape
(...)
- NuRadioReco.detector.antennapattern.is_equidistant(nodes, rtol=0.0001)[source]
Check whether the grid nodes are equally spaced (within
rtolof the spacing)
- NuRadioReco.detector.antennapattern.get_bracketing_indices(x, nodes, equidistant=False)[source]
Find the indices of the two grid nodes bracketing the requested position(s)
The nodes are only required to be sorted, not equally spaced. Positions outside the node range are clamped to the outermost interval (i.e. they are extrapolated); callers are expected to handle out-of-range values themselves if that is not wanted.
- Parameters:
- x: float or array of floats
the requested position(s)
- nodes: array of floats
the (sorted) grid nodes
- equidistant: bool (default: False)
if True the indices are calculated from the grid boundaries instead of looked up. This is much faster for large
xbut only correct for equally spaced nodes (cf.is_equidistant).
- Returns:
- i_lower, i_upper: array of ints
indices of the nodes below and above
x. They are identical if the grid has only a single node.
- NuRadioReco.detector.antennapattern.get_group_delay(vector_effective_length, df)[source]
helper function to calculate the group delay from the vector effecitve length
- Parameters:
- vector_effective_length: complex float
the vector effective length of an antenna
- df: float
the size of a frequency bin
- Returns:
- dt: float
the group delay
- NuRadioReco.detector.antennapattern.parse_RNOG_XFDTD_file(path_gain, path_phases, encoding=None)[source]
” reads in XFDTD data
- Parameters:
- path_gain: string
path to gain file
- path_phases:
path to phases file
- Returns:
- all paramters of the file as numpy arrays
- NuRadioReco.detector.antennapattern.preprocess_RNOG_XFDTD(path_gain, path_phases, outputfilename, n_index=1.74, encoding=None)[source]
” Preprocess an antenna pattern in XFDTD file format. The vector effective length is calculated and the output is saved to the NuRadioReco pickle format.
This conversion function ASSUMES THAT THE XFDTD SIMULATION IS DONE IN AIR! HERE WE DO A FIRST ORDER RESCALING TO A DIFFERENT INDEX OF REFRACTION by just rescaling the frequencies by f -> f/n.
- Parameters:
- path_gain: string
path to gain file
- path_phases: string
path to phases file
- outputfilename: string
path to outputfilename
- n_index: float
refractive index for requested antenna file. The method assumes that simulations are done in air (n = 1)
- NuRadioReco.detector.antennapattern.parse_WIPLD_file(ad1, ra1, orientation, gen_num=1, s_parameters=None)[source]
reads in WIPLD data
- Parameters:
- ad1: string
path to ad1 file
- ra1: string
path to radiation pattern file
- orientation: string
path to orientation file
- gen_num: int
which antenna (one or two) to pull from
- s_parameters: list of 2 ints
determines which s-parametr to extract (ex: [1,2] extracts S_12 parameter).
- Returns:
- all parameters of the files
- NuRadioReco.detector.antennapattern.preprocess_WIPLD_old(path, gen_num=1, s_parameters=None)[source]
preprocesses WIPLD file
this function implements the older insufficient calculation of the vector effective length. This VEL only relates the incident electric field to the open circuit voltage and not the voltage in a 50 Ohm system.
- Parameters:
- path: string
path to folder containing ad1, ra1, and orientation files.
- gen_num: int
which antenna (one or two) to pull from
- s_parameters: list of 2 ints
determines which s-parametr to extract (ex: [1,2] extracts S_12 parameter).
- Returns:
- orientation theta: float
orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- orientation phi: float
orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- rotation theta: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- rotation phi: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- ff2: array of floats
array of frequencies
- theta: float
zenith angle of inicdent electric field
- phi: float
azimuth angle of incident electric field
- H_phi: float
the complex realized vector effective length of the ePhi polarization component
- H_theta: float
the complex realized vector effective length of the eTheta polarization component
- NuRadioReco.detector.antennapattern.save_preprocessed_WIPLD_old(path)[source]
saves preprocessed WIPLD files to a pickle file
- Parameters:
- path: string
path to folder containing ad1, ra1, and orientation files.
- NuRadioReco.detector.antennapattern.preprocess_WIPLD(path, gen_num=1, s_parameters=None)[source]
preprocesses WIPLD file
this function implements the older insufficient calculation of the vector effective length. This VEL only relates the incident electric field to the open circuit voltage and not the voltage in a 50 Ohm system.
- Parameters:
- path: string
path to folder containing ad1, ra1, and orientation files.
- gen_num: int
which antenna (one or two) to pull from
- s_parameters: list of 2 ints
determines which s-parametr to extract (ex: [1,2] extracts S_12 parameter).
- Returns:
- orientation theta: float
orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- orientation phi: float
orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- rotation theta: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- rotation phi: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- ff2: array of floats
array of frequencies
- theta: float
zenith angle of inicdent electric field
- phi: float
azimuth angle of incident electric field
- H_phi: float
the complex realized vector effective length of the ePhi polarization component
- H_theta: float
the complex realized vector effective length of the eTheta polarization component
- NuRadioReco.detector.antennapattern.save_preprocessed_WIPLD(path)[source]
saves preprocessed WIPLD files to a pickle file
- Parameters:
- path: string
path to folder containing ad1, ra1, and orientation files.
- NuRadioReco.detector.antennapattern.save_preprocessed_WIPLD_forARA(path)[source]
this function saves the realized gain in an ARASim readable format
- Parameters:
- path: string
path to folder containing ad1, ra1, and orientation files.
- NuRadioReco.detector.antennapattern.get_pickle_antenna_response(path, return_verified=False)[source]
Opens and return the pickle file containing the preprocessed e.g. WIPL-D antenna simulation in NuRadioReco conventions.
If the pickle file is not present on the local file system, or if the file is outdated (verified via a sha1 hash sum), the file will be downloaded from a central data server.
- Parameters:
- path: string
the path to the pickle file
- return_verified: bool (default: False)
if True, the function will return a boolean indicating whether the file was verified/downloaded or not.
- Returns:
- res: 9 lists
list containing the following elements:
- orientation_theta: float
orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- orientation_phi: float
orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- rotation_theta: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- rotation_phi: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- ff: array of floats
array of frequencies
- thetas: array of floats
zenith angle of inicdent electric field
- phis: array of floats
azimuth angle of incident electric field
- H_phi: array of floats
the complex realized vector effective length of the ePhi polarization component
- H_theta: array of floats
the complex realized vector effective length of the eTheta polarization component
- verified: bool
boolean indicating whether the file was verified/downloaded or not (only returned if
return_verified == True)
- NuRadioReco.detector.antennapattern.parse_ARA_file(ara)[source]
Helper function that parses the ARAsim ASCII files containig antenna responses
- Parameters:
- ara: string
path to the file
- Returns:
- ff: array of floats
frequencies
- thetas: array of floats
zenith angle of inicdent electric field
- phis: array of floats
azimuth angle of inicdent electric field
- gains: array of floats
corresponding linear gain values
- phases: array of floats
corresponding phases
- NuRadioReco.detector.antennapattern.preprocess_ARA(path)[source]
preprocess an antenna pattern in the ARASim ASCII file format.
The vector effective length is calculated and the output is saved to the NuRadioReco pickle format.
- Parameters:
- path: string
the path to the file
- NuRadioReco.detector.antennapattern.parse_HFSS_file(hfss)[source]
Helper function that parses the HFSS files containig antenna responses
- Parameters:
- hfss: string
path to the file
- Returns:
- ff: array of floats
frequencies
- thetas: array of floats
zenith angle of inicdent electric field
- phis: array of floats
azimuth angle of inicdent electric field
- magnitudes_theta: array of floats
corresponding logarithmic magnitude values theta component
- magnitudes_phi: array of floats
corresponding logarithmic magnitude values phi component
- phases_phi: array of floats
corresponding phases phi component
- phases_theta: array of floats
corresponding phases theta component
- NuRadioReco.detector.antennapattern.preprocess_HFSS(path)[source]
preprocess an antenna pattern in the HFSS file format. The realized vector effective length is calculated and the output is saved in the NuRadioReco pickle format.
The vector effective length calculation still needs to be verified.
The frequencies, theta, phi, magnitude theta, magnitude phi, phase theta and phase phi are read from the csv file and than ordered according to the NuRadioReco format.
- Parameters:
- path: string
the path to the file
- NuRadioReco.detector.antennapattern.preprocess_XFDTD(path)[source]
preprocess an antenna pattern in the XFDTD file format. The realized vector effective length is calculated and the output is saved to the NuRadioReco pickle format.
- Parameters:
- path: string
the path to the file
- NuRadioReco.detector.antennapattern.parse_LOFAR_txt_file(path_theta, path_phi)[source]
Extract the values from a simulation file for the LOFAR LBA antenna model.
- Parameters:
- path_thetastr
Path to the file containing the values for the theta component
- path_phistr
Path to the file containing the values for the phi component
- NuRadioReco.detector.antennapattern.preprocess_LOFAR_txt(directory, ant='LBA', orientation=None)[source]
Function to process the TXT files from the old LOFAR antenna model (only tested for LBA). The paths to these files is currently hardcoded. Because of a weird issue which requires minus signs to be added for the X and Y dipoles separately, the orientation can be specified to create separate antenna models for each. If the orientation is not set, the values for the Y dipole are returned.
- Parameters:
- directorystr
Path to where the text files are stored
- antstr, default=’LBA’
The antenna type, either LBA or HBA (not tested)
- orientationstr, default=None
If set, must be either X or Y.
- NuRadioReco.detector.antennapattern.preprocess_FEKO_mat(path, polarization='X', downscale_freq=1, downscale_zenith=4, downscale_azimuth=4)[source]
used to convert FEKO_AAVS2_single_elem_50ohm_50_350MHz_{polarization}pol.mat for the SKALA4 antenna to a pickle file
The file contains the embedded element simulation of the SKALA4 antenna in the frequency range of 50-350 MHz. The values correspond to the far-field emission of this antenna; it is converted to the realized vector effective length for a receiving antenna using Eq. 6 in [1].
- Parameters:
- directorystr
The path to the directory where the files are stored
- polarizationstr, default=’X’
X polarization is the antenna in east-west orientation, Y polarization is the antenna in north-south orientation.
- downscale_freqint, default: 1
The downscaling factor for the frequency spacing. The native frequency spacing is 1 MHz, and the default downscaling factor is 1 (no downscaling).
- downscale_zenithint, default: 4
The downscaling factor for the zenith spacing. The native zenith spacing is 0.5 degrees, and the default downscaling factor is 4, resulting in a spacing of 2 degrees.
- downscale_azimuthint, default: 4
The downscaling factor for the azimuth spacing. The native azimuth spacing is 0.5 degrees, and the default downscaling factor is 4, resulting in a spacing of 2 degrees.
References
- NuRadioReco.detector.antennapattern.get_onsky_rotation(zenith, azimuth)[source]
Rotation matrix from the ground (x, y, z) into the on-sky (eR, eTheta, ePhi) system
Equivalent to
radiotools.coordinatesystems.cstrafobut constructs only the transformation needed here. The matrix is orthonormal, i.e. its transpose describes the inverse transformation.- Parameters:
- zenith, azimuth: float
direction defining the on-sky coordinate system
- Returns:
- rotation: array of floats
the 3x3 rotation matrix
- NuRadioReco.detector.antennapattern.get_antenna_basis(theta1, phi1, theta2, phi2, description)[source]
Basis spanned by two (almost) perpendicular directions and their cross product
The two directions are only required to be almost perpendicular, so the basis is not necessarily orthonormal.
- Parameters:
- theta1, phi1: float
zenith and azimuth angle of the first direction (for antennas: the boresight)
- theta2, phi2: float
zenith and azimuth angle of the second direction (for antennas: perpendicular to the boresight, e.g. the normal of the plane containing the tines of an LPDA)
- description: string
what is being defined, used for the error message
- Returns:
- basis: array of floats
the 3x3 matrix of the three basis vectors
- NuRadioReco.detector.antennapattern.make_perpendicular(theta1, phi1, theta2, phi2, description, tolerance=0.0017453292519943296)[source]
Rotate the second direction into the plane perpendicular to the first
Some antenna models store a rounded angle (89.9544 deg instead of 90 deg), which makes the basis spanned by the two directions non-orthogonal. The transformation between two such bases is not a rotation and rescales the vector effective length slightly. A deviation larger than tolerance is a genuine geometry and is left untouched.
- Parameters:
- theta1, phi1: float
zenith and azimuth angle of the first direction
- theta2, phi2: float
zenith and azimuth angle of the second direction, the one that is corrected
- description: string
what is being corrected, used for the log message
- tolerance: float (default: 0.1 deg)
largest deviation from perpendicular that is corrected
- Returns:
- theta2, phi2: float
the corrected second direction
- class NuRadioReco.detector.antennapattern.AntennaPatternBase[source]
Bases:
objectBase class of utility class that handles access and buffering to antenna pattern
Methods
get_antenna_response_vectorized(freq, ...)Get the antenna response for a specific frequency, zenith and azimuth angle.
- get_antenna_response_vectorized(freq, zenith, azimuth, orientation_theta, orientation_phi, rotation_theta, rotation_phi)[source]
Get the antenna response for a specific frequency, zenith and azimuth angle.
All angles are specified in the NuRadio coordinate system. All units are in NuRadio default units.
This function does three things:
_get_theta_and_phi: transform the requested signal direction into the coordinate system of the antenna simulation, taking the orientation and rotation of the antenna into account_get_antenna_response_vectorized_raw: interpolate the stored antenna pattern at that requested direction (properly transformed) and frequencies (in the native simulated coordinate system)rotate the interpolated vector effective length, so that its two components refer to the on-sky unit vectors of the NuRadio coordinate system
- Parameters:
- freqfloat or array of floats
frequency
- zenithfloat
zenith angle of incoming signal direction
- azimuthfloat
azimuth angle of incoming signal direction
- orientation_theta: float
orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- orientation_phi: float
orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- rotation_theta: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- rotation_phi: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- Returns:
- vel: dictonary of complex arrays
theta and phi component of the vector effective length, both components are complex floats or arrays of complex floats of the same length as the frequency input
- class NuRadioReco.detector.antennapattern.AntennaPattern(antenna_model, path='/home/runner/work/NuRadioMC/NuRadioMC/NuRadioReco/detector/AntennaModels', interpolation_method='complex', do_consistency_check=True)[source]
Bases:
AntennaPatternBaseUtility class that handles access and buffering to simulated antenna pattern. The class accesses the NuRadioReco pickle format file which contains the preprocessed antenna pattern.
The pickle file contains 9 lists of the following elements:
- orientation_theta: float
orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- orientation_phi: float
orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- rotation_theta: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- rotation_phi: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- ff: array of floats
array of frequencies
- thetas: array of floats
zenith angle of inicdent electric field
- phis: array of floats
azimuth angle of incident electric field
- H_phi: array of floats
the complex realized vector effective length of the ePhi polarization component
- H_theta: array of floats
the complex realized vector effective length of the eTheta polarization component
The three angular/spectral axes are sampled on a regular (but not necessarily equally spaced) grid, i.e. the VEL is stored as a
(n_freqs, n_phi, n_theta)cube.- Attributes:
- VEL
- VEL_phi
- VEL_theta
Methods
get_antenna_response_vectorized(freq, ...)Get the antenna response for a specific frequency, zenith and azimuth angle.
- Parameters:
- antenna_model: string
name of antenna model
- path: string
path to folder containing the antenna models
- interpolation_mode: string
specify in which domain the interpolation should be performed, can be either
‘complex’ (default) interpolate real and imaginary part of vector effective length
‘magphase’ interpolate magnitude and phase of vector effective length
- consistency_check: bool (default: True)
If True, the consistency of the antenna response is checked but only if antenna file could not be verified (via hash sum).
- Attributes:
- VEL
- VEL_phi
- VEL_theta
Methods
get_antenna_response_vectorized(freq, ...)Get the antenna response for a specific frequency, zenith and azimuth angle.
- property VEL
- property VEL_theta
- property VEL_phi
- get_antenna_response_vectorized(freq, zenith, azimuth, orientation_theta, orientation_phi, rotation_theta, rotation_phi)
Get the antenna response for a specific frequency, zenith and azimuth angle.
All angles are specified in the NuRadio coordinate system. All units are in NuRadio default units.
This function does three things:
_get_theta_and_phi: transform the requested signal direction into the coordinate system of the antenna simulation, taking the orientation and rotation of the antenna into account_get_antenna_response_vectorized_raw: interpolate the stored antenna pattern at that requested direction (properly transformed) and frequencies (in the native simulated coordinate system)rotate the interpolated vector effective length, so that its two components refer to the on-sky unit vectors of the NuRadio coordinate system
- Parameters:
- freqfloat or array of floats
frequency
- zenithfloat
zenith angle of incoming signal direction
- azimuthfloat
azimuth angle of incoming signal direction
- orientation_theta: float
orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- orientation_phi: float
orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- rotation_theta: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- rotation_phi: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- Returns:
- vel: dictonary of complex arrays
theta and phi component of the vector effective length, both components are complex floats or arrays of complex floats of the same length as the frequency input
- class NuRadioReco.detector.antennapattern.AntennaPatternAnalytic(antenna_model, cutoff_freq=None, max_VEL=None)[source]
Bases:
AntennaPatternBaseutility class that handles access and buffering to analytic antenna pattern
Methods
get_antenna_response_vectorized(freq, ...)Get the antenna response for a specific frequency, zenith and azimuth angle.
parametric_phase(freq[, phase_type])Phase of the analytic antenna models as a function of frequency
- Parameters:
- antenna_model: string
Name of antenna model. Current implemented models are ‘analytic_LPDA’, ‘analytic_VPol’, and ‘analytic_HPol’. By using the default values of cutoff_freq and max_VEL, these models approximate the createLPDA_100MHz_InfFirn_n1.4, RNOG_vpol_v3_5inch_center_n1.74, and RNOG_hpol_v4_8inch_center_n1.74 antenna models, respectively.
- cutoff_freq: float
Sets the low frequency cutoff for the LPDA and VPol models, and the peak frequency for the HPol model. Setting cutoff_freq=None, the default values are used: ‘analytic_LPDA’: 110 MHz, ‘analytic_VPol’: 220 MHz, ‘analytic_HPol’: 500 MHz.
- max_VEL: float
Sets the maximum value of the vector effective length for the antenna models. Setting max_VEL=None, the default values are used: ‘analytic_LPDA’: 0.55 m, ‘analytic_VPol’: 0.18 m, ‘analytic_HPol’: 0.055 m.
Methods
get_antenna_response_vectorized(freq, ...)Get the antenna response for a specific frequency, zenith and azimuth angle.
parametric_phase(freq[, phase_type])Phase of the analytic antenna models as a function of frequency
- parametric_phase(freq, phase_type='theoretical')[source]
Phase of the analytic antenna models as a function of frequency
- Parameters:
- freq: array of floats
frequencies at which to evaluate the phase
- phase_type: string
one of ‘theoretical’, ‘frontlobe_lpda’, ‘side_lpda’, ‘back_lpda’, ‘VPol_third_order’ or ‘HPol_third_order’
- Returns:
- phase: array of floats
the phase in radians
- get_antenna_response_vectorized(freq, zenith, azimuth, orientation_theta, orientation_phi, rotation_theta, rotation_phi)
Get the antenna response for a specific frequency, zenith and azimuth angle.
All angles are specified in the NuRadio coordinate system. All units are in NuRadio default units.
This function does three things:
_get_theta_and_phi: transform the requested signal direction into the coordinate system of the antenna simulation, taking the orientation and rotation of the antenna into account_get_antenna_response_vectorized_raw: interpolate the stored antenna pattern at that requested direction (properly transformed) and frequencies (in the native simulated coordinate system)rotate the interpolated vector effective length, so that its two components refer to the on-sky unit vectors of the NuRadio coordinate system
- Parameters:
- freqfloat or array of floats
frequency
- zenithfloat
zenith angle of incoming signal direction
- azimuthfloat
azimuth angle of incoming signal direction
- orientation_theta: float
orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- orientation_phi: float
orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
- rotation_theta: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- rotation_phi: float
rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- Returns:
- vel: dictonary of complex arrays
theta and phi component of the vector effective length, both components are complex floats or arrays of complex floats of the same length as the frequency input
- class NuRadioReco.detector.antennapattern.AntennaPatternProvider(*args, **kwargs)[source]
Bases:
objectProvider class for antenna pattern. The usage of antenna pattern through this class ensures that an antenna pattern is loaded only once into memory which takes a significant time and occupies a significant amount of memory.
Methods
load_antenna_pattern(name, **kwargs)loads an antenna pattern and returns the antenna pattern class
- Parameters:
- log_level: int
the log level of the antenna pattern logger
Methods
load_antenna_pattern(name, **kwargs)loads an antenna pattern and returns the antenna pattern class
- load_antenna_pattern(name, **kwargs)[source]
loads an antenna pattern and returns the antenna pattern class
- Parameters:
- name: string
the name of the antenna pattern
- **kwargs: dict
key word arguments that are passed to the init function of the
AntennaPatternclass (see documentation of this class for further information)
- Returns:
- antenna_patternAntennaPattern or AntennaPatternAnalytic
Return the loaded antenna pattern object.