template_synthesis.jax.io.sliced_shower module

class template_synthesis.jax.io.sliced_shower.SlicedShower(file_path: str, slicing_grammage: int = 5, atm_model: int = 17, slice_trace: int | None = None, slice_ant: int | None = None)

Bases: BaseShower

Class to read in showers from each slice from CoREAS simulations, inherited from BaseShower.

Parameters:
file_path : str

The filepath to the simulation to read.

slicing_grammage : int, default=5

The width between atmospheric slices in g/cm^2

atm_model : int, default=17

The atmospheric model used. Default is 17, which is the US standard atmosphere. See utilities/atmosphere/atm_models.py for all possible atmospheric models.

slice_trace : Union[int, None], default = None

The index to slice the trace. Used to reduce the number of samples by removing slice_trace numbers of samples. Default is None, which uses the full time trace

slice_ant : Union[int, None], default = None

The index to slice the antennas. Used to reduce the number of antennas by removing slice_ant numbers for antennas between distance from the core. This is done to have coveraage for all distances from the core. Default is None, which uses all antennas in the dataset.

filter_trace(trace: Array | ndarray | bool | number | bool | int | float | complex, f_min: float, f_max: float) Array

Filter the trace until we get traces that match the frequency interval.

This implementation only works consistently with a 1-D array, but a TODO would be to allow this to work with multidimensional arrays.

Parameters:
trace : jax.typing.ArrayLike

The unfiltered electric field trace. NOTE: TRACE MUST BE IN FIRST AXIS!

f_min : float

The minimum frequency in which we want to filter the trace

f_max : float

The maximum frequency in which we want to filter the trace

Returns:

filtered_trace – The trace that is filtered between the frequency range [f_min, f_max]

Return type:

jax.Array

get_coreas_settings() dict

Get specific configurations from the CoREAS simulation that is useful for the synthesis.

Returns:

coreas_settings – A dictionary containing important information about the configuration of the CoREAS simulation

Return type:

dict

static get_geometry(file: File) tuple[float, float]

Retrieve the geometry (zenith, angle) in degrees.

get_traces(return_start_time: bool = False) tuple[Array, Array, Array] | tuple[Array, Array]

Get all traces for all antennas.

Parameters:
return_start_time : bool, default=False

If True, an array containing the time of the first sample of all slices is returned

Returns:

  • trace_geo (jax.Array) – The geomagnetic trace in shapes ANT x SAMPLES x SLICES

  • trace_ce (jax.Array) – The charge-excess trace in shapes ANT x SAMPLES x SLICES

  • trace_start_time (jax.Array (returned only if return_start_times is True)) – The time of the first sample of the trace of size N_SLICES x ANT

property name : str
property trace_length : int

Length of the trace.

template_synthesis.jax.io.sliced_shower.filter_trace(trace: Array | ndarray | bool | number | bool | int | float | complex, trace_sampling: float, f_min: float, f_max: float, sample_axis: int = 0) Array

Filter the trace within the frequency domain of interest.

Parameter:

tracejax.typing.ArrayLike

The trace to filter. Shape is SAMPLES x …

trace_samplingfloat

The sampling rate of the traces

f_minfloat

The minimum frequency in which to filter, in MHz

f_maxfloat

The maximum frequency in which to filter, in MHz

sample_axisint, default=0

The axis in which the filtering takes place. Default is 0, i.e. the first axis

returns:

filtered_trace – The filtered trace within the requested frequency domain

rtype:

jax.Array