template_synthesis.numpy.utilities package

template_synthesis.numpy.utilities.angle_between(v1, v2)

Returns the angle in radians between vectors ‘v1’ and ‘v2’

Parameters:
v1 : array_like

First vector

v2 : array_like

Second vector

Returns:

angle – The angle (in radians) between the vectors

Return type:

float

Examples

>>> angle_between((1, 0, 0), (0, 1, 0))
1.5707963267948966
>>> angle_between((1, 0, 0), (1, 0, 0))
0.0
>>> angle_between((1, 0, 0), (-1, 0, 0))
3.141592653589793
template_synthesis.numpy.utilities.e_to_geo_ce(traces, x, y)

Decouples the electric field in the shower plane, i.e. the electric field should be in the (vxB, vxvxB, v) CS, into the geomagnetic and charge-excess components.

Parameters:
traces : np.ndarray

The traces in the shower plane, shaped as (samples, polarisations)

x : float

The antenna position along the vxB axis

y : float

The antenna position along the vxvxB axis

Returns:

  • e_geo (np.ndarray) – The geomagnetic component of the electric field

  • e_ce (np.ndarray) – The charge-excess component of the electric field

template_synthesis.numpy.utilities.geo_ce_to_e(traces, x, y)

Reconstruct a three-dimensional electric field in the shower plane, i.e. the (vxB, vxvxB, v) CS, from the geomagnetic component of the charge-excess components. The v-component is set to zero.

Parameters:
traces : np.ndarray

The electric field traces, shaped as (samples, components)

x : float

The antenna position along the vxB axis

y : float

The antenna position along the vxvxB axis

Returns:

e_field – The three-dimensional electric field, in the shower plane CS, shaped as (samples, polarisations)

Return type:

np.ndarray

Submodules