smiet.numpy.io.coreas_shower module

class smiet.numpy.io.coreas_shower.CoreasShower(file_path, gdas_file=None)

Bases: Shower, CoreasHDF5

A class to read in a CoREAS shower from an HDF5 file.

Whereas the smiet.numpy.io.CoreasHDF5 class provides the basic functionality to read in the settings and the shower data from a CoREAS HDF5 file, this class extends it to provide with the functionality from the smiet.numpy.io.Shower class. This allows you to interact with the antennas more easily, as the positions are more readily accessible. Also, the geometry is included such that a coordinate transformation object can be created from the shower.

Parameters:
file_path : str

The path to the CoREAS HDF5 file

gdas_file : str, optional

If provided, the atmosphere will be created using this GDAS file. This will take precedence over the atmosphere model specified in the simulation settings.

get_antenna_position(ant_names)

Get the position of the antennas in ant_names on the ground.

The position is returned in our coordinate system, where the x-axis points to the magnetic east, the y-axis to the magnetic north and the z-axis up.

Parameters:
ant_names : str or list of str

Either a single antenna names or a list of antenna names for which to retrieve the positions. All names must be present in SlicedShower.antenna_names!

Returns:

antenna_ground – The positions of the antennas in ant_names.

Return type:

np.ndarray

get_antenna_position_showerplane(ant_names)

Get the position of the antennas in ant_names in the shower plane.

The shower plane coordinate system is that from radiotools, so the x-axis points along the \(\vec{v} \times \vec{B}\) direction, the y-axis along \(\vec{v} \times ( \vec{v} \times \vec{B} )\) direction and the z-axis along \(\vec{v}\).

Parameters:
ant_names : str or list of str

Either a single antenna names or a list of antenna names for which to retrieve the positions. All names must be present in SlicedShower.antenna_names!

Returns:

antenna_showerplane – The position of the antennas in the shower plane.

Return type:

np.ndarray

get_trace_geoce(ant_name: str, bandpass: list = [0.03, 0.5], return_times: bool = False) tuple[ndarray, ndarray] | tuple[ndarray, ndarray, ndarray]

Get the traces for a given antenna, in GEO/CE components.

Notes

The traces are converted to GEO/CE components.

Parameters:
ant_name : str

The name of the antenna. Must be the same as the key in the HDF5!

bandpass : list, default=[30, 500]

If not None, the traces are bandpass filtered between the given frequencies (in MHz)

return_times : bool, default=False

If True, an array containing the time of the first sample of each slice is returned

Returns:

  • traces_geo (np.ndarray) – The geomagnetic traces, shaped as (samples,)

  • traces_ce (np.ndarray) – The charge-excess traces, shaped as (samples,)

  • return_times (float, optional) – The time of the first sample of the traces, in seconds.

get_traces_geoce(ant_names: str | list, bandpass: list = [0.03, 0.5], return_times: bool = False) tuple[ndarray, ndarray] | tuple[ndarray, ndarray, ndarray]

Get the traces for a given antenna, in GEO/CE components.

Notes

The traces are converted to GEO/CE components.

Parameters:
ant_names : Union[str, list]

The name of the antenna or names of antennas. Must have the same keys in the HDF5!

bandpass : list, default=[30, 500]

If not None, the traces are bandpass filtered between the given frequencies (in MHz)

return_times : bool, default=False

If True, an array containing the time of the first sample of each slice is returned

Returns:

  • traces_geo (np.ndarray) – The geomagnetic traces, shaped as (n_antennas, samples,)

  • traces_ce (np.ndarray) – The charge-excess traces, shaped as (n_antennas, samples,)

  • traces_start_times (shaped as n_antennas, optional) – The time of the first sample of the traces, in seconds.

get_traces_vB_vvB(ant_names: str | list, bandpass: list = [0.03, 0.5], return_times: bool = False) tuple[ndarray, ndarray] | tuple[ndarray, ndarray, ndarray]

Get the traces for a given antenna, in v x B and v x (v x B) components.

Parameters:
ant_names : Union[str, list]

The name of the antenna or names of antennas. Must have the same keys in the HDF5!

bandpass : list, default=[30, 500]

If not None, the traces are bandpass filtered between the given frequencies (in MHz)

return_times : bool, default=False

If True, an array containing the time of the first sample of each slice is returned

Returns:

  • traces_vxB (np.ndarray) – The v x B traces, shaped as (n_antennas, samples,)

  • traces_vxvxB (np.ndarray) – The v x (v x B) traces, shaped as (n_antennas, samples,)

  • traces_start_times (shaped as n_antennas, optional) – The time of the first sample of the traces, in seconds.