template_synthesis.jax.synthesis module

class template_synthesis.jax.synthesis.TemplateSynthesis(atm_model: int = 17, freq_ar: list = None)

Bases: object

Class to manage the template synthesis.

get_ant_names() list[str]

Get the names of all internal antennas.

Returns:

ant_names

Return type:

list of str

get_time_axis() Array

Get the time axis for all antennas.

Returns:

time_axis – The time axis for each antenna, shaped as (# antennas, # time samples)

Return type:

np.ndarray

load_template(template_file: str = 'default_template.h5', save_dir: str = '/home/mdesmet/Gitlab/smiet-cr-synthesis/template_synthesis/jax/../templates') None

Load the template from a saved state, as done by save_template().

Parameters:
template_file : str, default='default_template.h5'

the file to save the template into

save_dir : str, default='template_synthesis/templates'

the directory to save the template into

make_template(origin: SlicedShower, ce_linear: bool = True) None

Process a SlicedShower into a template.

Parameters:
origin : template_synthesis.jax.io.sliced_shower.SlicedShower

The origin shower

ce_linear : bool, default=True

Whether to use linear variant of the CE component correction

map_template(target: BaseShower, ce_linear: bool = False) Array

Map the template to a target profile, represented in a target BaseShower.

Calculates the trace for every antenna present in the template.

Parameters:
target : BaseShower

The target BaseShower object, containing the longitudinal profile, zenith, azimuth, geomagnetic angle, xmax and nmax

Returns:

total_synth – The synthesised geomagnetic & charge-excess trace for all antennas. Shape is {GEO, CE} x ANT x SAMPLES

Return type:

jax.Array

read_spectral_file(filename: str) None

Read spectral parameters from a file with filename in the spectral_parameters/ directory.

Parameters:
filename : str

The name of the spectral parameters file

save_template(template_file: str = 'default_template.h5', save_dir: str = '/home/mdesmet/Gitlab/smiet-cr-synthesis/template_synthesis/jax/../templates') None

Save the internal state of the synthesis class to disk.

Parameters:
template_file : str, default='default_template.h5'

the file to save the template into

save_dir : str, default='template_synthesis/templates'

the directory to save the template into

template_synthesis.jax.synthesis.amplitude_function(params: Array | ndarray | bool | number | bool | int | float | complex, frequencies: Array | ndarray | bool | number | bool | int | float | complex, d_noise: float = 0.0) Array

Calculate the amplitude frequency spectrum corresponding to the parameters params.

Parameters:
params : jax.typing.ArrayLike

The spectral parameters. If it is a multidimensional array, the first dimension must contain the parameters.

frequencies : jax.typing.ArrayLike

The values of the frequencies to evaluate - remove central frequency beforehand!

d_noise : float, default=0.0

The noise floor level

Return type:

The evaluated amplitude frequency spectrum with shape VIEW x FREQ x SLICES