NuRadioReco.framework.station module
- class NuRadioReco.framework.station.Station(station_id)[source]
Bases:
BaseStation
- Parameters:
- parameter_typesparameter class or list of classes
The parameter classes are defined in
NuRadioReco.framework.parameters
Methods
add_channel
(channel[, overwrite])Adds a channel to the station.
add_parameter_type
(parameter_type)Add a parameter class to the list of allowed parameter classes.
add_sim_station
(sim_station)Adds a SimStation to the Station.
get_channel_ids
([return_group_ids])Return all channel ids in the station
returns a sorted list with the electric field IDs of all simElectricFields of the simStation
Returns the first/earliest trigger.
get_parameter
(key)Get a parameter
get_parameter_error
(key)Get the error of a parameter
Get all parameters
Returns the primary trigger of the station.
Returns the SimStation of the Station.
get_station_time
([format])Returns the station time as an astropy.time.Time object
get_trigger
(name)returns the trigger with the name 'name'
get_trigger_channel
(channel_id)Returns the trigger channel of channel with id channel_id.
Returns a dictionary of the triggers.
has_parameter
(key)Returns True if the parameter key is present, False otherwise
has_parameter_error
(key)Returns True if an uncertainty for the parameter key is present, False otherwise
Returns whether the Station has a SimStation.
has_trigger
(trigger_name)Checks if station has a trigger with a certain name.
has_triggered
([trigger_name])Checks if the station has triggered.
iter_channels
([use_channels, sorted])Iterates over all channels of the station.
iter_trigger_channels
([use_channels])Iterates over all channels of the station and yields channel.get_trigger_channel() for each.
remove_channel
(channel_id)Removes a channel from the station by deleting is from the channels dictionary.
remove_parameter
(key)Remove a parameter
removes all triggers from the station
set station type to cosmic rays (relevant e.g. for refraction into the snow).
set station type to neutrino
set_parameter
(key, value)Set a parameter
set_parameter_error
(key, value)Set the error of a parameter
set_sim_station
(sim_station)Sets the SimStation of the Station.
set_station_time
(time[, format])Set the (absolute) time for the station (stored as astropy.time.Time).
set_trigger
(trigger)sets a trigger for the station.
set_triggered
([triggered])Convenience function to set a simple trigger.
add_electric_field
deserialize
get_ARIANNA_parameter
get_ARIANNA_parameters
get_channel
get_electric_fields
get_electric_fields_for_channels
get_id
get_magnetic_field_vector
get_number_of_channels
get_reference_direction
get_reference_reconstruction
has_ARIANNA_parameter
has_channel
is_cosmic_ray
is_neutrino
iter_channel_group
serialize
set_ARIANNA_parameter
set_electric_fields
set_reference_reconstruction
- set_sim_station(sim_station)[source]
Sets the SimStation of the Station. If a SimStation is already present, it is overwritten.
- Parameters:
- sim_stationNuRadioReco.framework.sim_station.SimStation
The SimStation to set as the SimStation of the Station.
- add_sim_station(sim_station)[source]
Adds a SimStation to the Station. If a SimStation is already present, the new SimStation is merged to the existing one.
- Parameters:
- sim_stationNuRadioReco.framework.sim_station.SimStation
The SimStation to add to the Station.
- get_sim_station()[source]
Returns the SimStation of the Station.
- Returns:
- NuRadioReco.framework.sim_station.SimStation
The SimStation of the Station.
- has_sim_station()[source]
Returns whether the Station has a SimStation.
- Returns:
- bool
True if the Station has a SimStation, False otherwise.
- iter_channels(use_channels=None, sorted=False)[source]
Iterates over all channels of the station.
If use_channels is not None, only the channels with the ids in use_channels are iterated over. If sorted is True, the channels are iterated over in ascending order of their ids.
- Parameters:
- use_channelslist of int, optional
List of channel ids to iterate over. If None, all channels are iterated over.
- sortedbool, optional
If True, the channels are iterated over in ascending order of their ids.
- Yields:
- NuRadioReco.framework.channel.Channel
The next channel in the iteration.
- iter_trigger_channels(use_channels=None)[source]
Iterates over all channels of the station and yields channel.get_trigger_channel() for each.
If use_channels is not None, only the channels with the ids in use_channels are iterated over.
- Parameters:
- use_channelslist of int, optional
List of channel ids to iterate over. If None, all channels are iterated over.
- Yields:
- NuRadioReco.framework.channel.Channel
The next (trigger) channel in the iteration.
- get_trigger_channel(channel_id)[source]
Returns the trigger channel of channel with id channel_id.
If the trigger channel is not set, the channel itself is returned (i.e. this is equivalent to
get_channel
)- Parameters:
- channel_idint
The id of the channel for which to get the trigger channel.
- Returns:
- channel:
NuRadioReco.framework.channel.Channel
The trigger channel of the channel with id channel_id.
- channel:
- get_channel_ids(return_group_ids=False)[source]
Return all channel ids in the station
- Parameters:
- return_group_idsbool, default: False
If True, return a list of channel_group_ids instead of channel ids. Note that if no channel group ids are defined, these are the same as the channel ids
- Returns:
- channel_idslist
List of all channel ids
- add_channel(channel, overwrite=False)[source]
Adds a channel to the station. If a channel with the same id is already present, it is overwritten.
- Parameters:
- channel
NuRadioReco.framework.channel.Channel
The channel to add to the station.
- overwritebool, (Default: True)
If True, allow to overwrite an existing channel (i.e., a channel with the same id). If False, raise AttributeError if a channel with the same id is being added.
- channel
- remove_channel(channel_id)[source]
Removes a channel from the station by deleting is from the channels dictionary. The channel_id should be the id of the Channel, but supplying the Channel object itself is also supported.
- Parameters:
- channel_idint or NuRadioReco.framework.channel.Channel
The Channel (id) to remove from the Station.
- add_electric_field(electric_field)
- add_parameter_type(parameter_type)
Add a parameter class to the list of allowed parameter classes.
- Parameters:
- parameter_typeparameter class
The parameter class is defined in
NuRadioReco.framework.parameters
- get_ARIANNA_parameter(key)
- get_ARIANNA_parameters()
- get_electric_field_ids()
returns a sorted list with the electric field IDs of all simElectricFields of the simStation
- Returns:
- efield_ids: list
- get_electric_fields()
- get_electric_fields_for_channels(channel_ids=None, ray_path_type=None)
- get_first_trigger()
Returns the first/earliest trigger. Returns None if no trigger fired.
- get_id()
- get_parameter(key)
Get a parameter
- get_parameter_error(key)
Get the error of a parameter
- get_parameters()
Get all parameters
- get_primary_trigger()
Returns the primary trigger of the station. If no primary trigger exists, it returns None
- get_station_time(format='isot')
Returns the station time as an astropy.time.Time object
The station time corresponds to the absolute time at which the event starts, i.e. all times in Channel, Trigger and ElectricField objects are measured relative to this time.
- Parameters:
- format: str
Format in which the time object is displayed. (Default: isot)
- Returns:
- station_time: astropy.time.Time
- get_trigger(name)
returns the trigger with the name ‘name’
- Parameters:
- name: string
the name of the trigger
- Returns:
- trigger: Trigger
- get_triggers()
Returns a dictionary of the triggers. key is the trigger name, value is a trigger object
- has_ARIANNA_parameter(key)
- has_parameter(key)
Returns True if the parameter key is present, False otherwise
- has_parameter_error(key)
Returns True if an uncertainty for the parameter key is present, False otherwise
- has_trigger(trigger_name)
Checks if station has a trigger with a certain name. WARNING: This function does not check if the trigger has triggered.
- Parameters:
- trigger_name: string
the name of the trigger
- Returns bool
- has_triggered(trigger_name=None)
Checks if the station has triggered. If trigger_name is set, check if the trigger with that name has triggered.
- Parameters:
- trigger_name: string or None (default None)
- if None: The function returns False if not trigger was set. If one or multiple triggers were set,
it returns True if any of those triggers triggered
if trigger name is set: return if the trigger with name ‘trigger_name’ has a trigger
- is_cosmic_ray()
- is_neutrino()
- remove_parameter(key)
Remove a parameter
- remove_triggers()
removes all triggers from the station
- set_ARIANNA_parameter(key, value)
- set_electric_fields(electric_fields)
- set_is_cosmic_ray()
set station type to cosmic rays (relevant e.g. for refraction into the snow)
- set_is_neutrino()
set station type to neutrino
- set_parameter(key, value)
Set a parameter
- set_parameter_error(key, value)
Set the error of a parameter
- set_station_time(time, format=None)
Set the (absolute) time for the station (stored as astropy.time.Time).
- Parameters:
- time: astropy.time.Time or datetime.datetime or float
If “time” is a float, you have to specify its format.
- format: str
Only used when “time” is a float. Format to interpret “time”. (Default: None)
- set_trigger(trigger)
sets a trigger for the station. If a trigger with the same name already exists, it will be overridden
- Parameters:
- trigger: Trigger
the trigger object to set
- set_triggered(triggered=True)
Convenience function to set a simple trigger. The recommended interface is to set triggers through the set_trigger() interface.