smiet.jax.utilities.utilities module

Utility module to take care of transformations to shower plane etc.

smiet.jax.utilities.utilities.geo_ce_to_e(traces_geo: Array | ndarray | bool_ | number | bool | int | float | complex, traces_ce: Array | ndarray | bool_ | number | bool | int | float | complex, x, y) Array

Wrapper function for jax_radio_tools.trace_utils.geo_ce_to_vxB_vxvxB

smiet.jax.utilities.utilities.pulse_center_trace(trace, trace_times, trace_sampling, sample_axis, sample_time_axis)

Center the pulses in the traces.

To do this, the traces are first transformed to the frequency domain, then the phase shift corresponding to a time shift that centers the pulse is applied, and finally the traces are transformed back to the time domain.

The time shift is calculated as :

delta_t = 0.5 * n_samples * trace_sampling

where t_center is the center time of the trace

The phase shift can then be calculated by: phase_shift = exp(-2j * pi * f * delta_t)

where f is the frequency array, and delta_t is the time shift needed to center the pulse.

The time shift is also applied to the time array.

Note: units of trace_times must be same as trace_sampling.

Parameters:
trace : jnp.Array

The array containing the time traces to be centered

trace_times : jnp.Array

The time array corresponding to the traces, in internal units

trace_sampling : float

The sampling interval of the time traces, in internal units

sample_axis : int

The axis of trace which contains the time samples

sample_time_axis : int

The axis of trace_times which contains the time samples

Returns:

  • centered_trace (jnp.Array) – The centered traces, in the same shape as trace

  • centered_trace_times (jnp.Array) – The centered time array, in the same shape as trace_times

smiet.jax.utilities.utilities.reconstruct_starshape_from_vxvxB(geo_traces, ce_traces, antenna_positions_vvB, number_of_arms=8)

Reconstruct traces on all arms from vxvxB-arm simulation (where geo and ce are orthogonal).

This is used for generating star-shapes from simulations that only have antennas on the vxvxB arm. The traces on the other arms are simply copied from the vxvxB arm, and the antenna positions are rotated accordingly.

Traces synthesised for all slices can also be passed. In that case, the output traces will have the same number of slices. If only at the ground, the n_slices = 1.

Parameters:
geo_traces : np.ndarray

Geomagnetic traces on the vxvxB arm, shape (n_antennas, n_samples, n_slices)

ce_traces : np.ndarray

Charge-excess traces on the vxvxB arm, shape (n_antennas, n_samples, n_slices)

antenna_positions_vvB : np.ndarray

Positions of antennas on vxvxB arm (distance in shower plane), shape (n_antennas,)

number_of_arms : int, default=8

Total number of star-shape arms to reconstruct

Returns:

  • geo_traces_starshape (np.ndarray) – Geomagnetic traces on all arms, shape (n_antennas*number_of_arms, n_samples, n_slices)

  • ce_traces_starshape (np.ndarray) – Charge-excess traces on all arms, shape (n_antennas*number_of_arms, n_samples, n_slices)

  • antenna_positions_starshape (np.ndarray) – Antenna positions on all arms, shape (n_antennas*number_of_arms, 3)

smiet.jax.utilities.utilities.transform_traces_on_vxB(traces_geoce: Array | ndarray | bool_ | number | bool | int | float | complex, x: Array | ndarray | bool_ | number | bool | int | float | complex, y: Array | ndarray | bool_ | number | bool | int | float | complex, vxB_axis_mode: str = 'replace') Array

Adjust the (synthesised) traces on the vxB axis.

This function is meant to alter the traces on the vxB axis, as in the current version of the SMIET software the vxB axis cannot be synthesised. There are several strategies to handle this, and applying them should be facilitated by this function.

Here it is assumed that the antennas are ordered with increasing phi, where phi=0 is oriented West.

Parameters:
traces_geoce : jax.typing.ArrayLike

the synthesised traces in geomagnetic and charge-excess polarisation. Shape must be of NPOL x NANTS x NSAMPLES

x : jax.typing.ArrayLike

the antenna positions along the vxB axis, shaped as (NANTS,)

y : jax.typing.ArrayLike

the antenna positions along the vxvxB axis, shaped as (NANTS,)

vxB_axis_mode : {"replace", "zero", "average"}

Operation to perform on the vxB axis. If “replace” (the default), the traces from the vxvxB component will be copied over to the vxB component. If “zero”, the vxB component will be set to zero.

Returns:

traces_vB_vvB – the synthesised traces in vB x vvB axis (shower plane)

Return type:

jax.Array