NuRadioReco.detector.generic_detector module
- class NuRadioReco.detector.generic_detector.GenericDetector(*args, **kwargs)[source]
Bases:
DetectorBase
Used the same way as the main detector class, but works with incomplete detector descriptions. The user can define a default station. If any property is missing from one of the other station, the value from the default station will be used instead. If no channels are specified for a station, the channels from the default station will be used instead. For cases when the station design has a lot of channels, a default channel can also be defined. The default channel has to be part of the default station. It works the same way as the default station: Any property missing from one of the other channels will be taken from the default channel. The GenericDetector also ignores commission and decommission times and should therefore not be used for real data, but only for simulation studies. This detector only accepts json detector descriptions or dictionary.
- Attributes:
antenna_by_depth
Getter function for the
antenna_by_depth
attributeassume_inf
Getter function for the
assume_inf
attribute
Methods
add_generic_station
(station_dict)Add a generic station to the detector.
add_station_properties_for_event
(properties, ...)Adds an entry to the list of event-specific changes to the detector description.
get_absolute_position
(station_id)get the absolute position of a specific station
get the absolute position of a specific station
get_amplifier_measurement
(station_id, channel_id)returns a unique reference to the amplifier measurement
get_amplifier_response
(station_id, ...)Returns the amplifier response for the amplifier of a given channel
get_amplifier_type
(station_id, channel_id)returns the type of the amplifier
get_antenna_deployment_time
(station_id, ...)returns the time of antenna deployment
get_antenna_model
(station_id, channel_id[, ...])determines the correct antenna model from antenna type, position and orientation of antenna
get_antenna_orientation
(station_id, channel_id)returns the orientation of a specific antenna
get_antenna_type
(station_id, channel_id)returns the antenna type
get_cable_delay
(station_id, channel_id)returns the cable delay of a channel
get_cable_type_and_length
(station_id, channel_id)returns the cable type (e.g.
get_channel
(station_id, channel_id)returns a dictionary of all channel parameters
get_channel_group_id
(station_id, channel_id)returns the group ID of a channel.
get_channel_ids
(station_id)get the channel ids of a station
Get the properties of the default channel
Get the ID of the default channel
Get the properties of the default station
Get the ID of the default station
Returns the time that the detector is currently set to
get_device
(station_id, device_id)returns a dictionary of all device parameters
get_device_ids
(station_id)get the device ids of a station
get_noise_RMS
(station_id, channel_id[, stage])returns the noise RMS that was precomputed from forced triggers
get_noise_temperature
(station_id, channel_id)returns the noise temperature of the channel
get_number_of_channels
(station_id)Get the number of channels per station
get_number_of_devices
(station_id)Get the number of devices per station
get_number_of_samples
(station_id, channel_id)returns the number of samples of a channel
get_parallel_channels
(station_id)get a list of parallel antennas
get_raw_channel
(station_id, channel_id)Get the properties of a channel as they are in the original detector description, i.e. without missing properties being replaced by those from the default channel.
get_raw_station
(station_id)Get the properties of a station as they are in the original detector description, i.e. without missing properties being replaced by those from the default station.
get_reference_station
(station_id)Get the properties of the reference station
get_reference_station_id
(station_id)Get the properties of the reference station
Get the whole dictionary of reference stations
Get the properties of the reference stations
get_relative_position
(station_id, channel_id)get the relative position of a specific channels/antennas with respect to the station center
get_sampling_frequency
(station_id, channel_id)returns the sampling frequency
get_site
(station_id)get the site where the station is deployed (e.g.
get_site_coordinates
(station_id)get the (latitude, longitude) coordinates (in degrees) for a given detector site.
returns a sorted list of all station ids present in the database
get_station_properties_for_event
(run_number, ...)Returns all event-specific changes that have been stored in the detector description for a given station and event
get_unique_time_periods
(station_id)returns the time periods in which the station configuration (including all channels) was constant
has_station
(station_id)checks if a station is present in the database
is_channel_noiseless
(station_id, channel_id)returns true if the detector description has the field noiseless and if this field is True.
set_event
(run_number, event_id)Sets the run number and event ID for which the detector description should be returned.
update
(time)updates the detector description to a new time
get_station
Initialize the stations detector properties.
- Parameters:
- json_filenamestr
the path to the json detector description file (if first checks a path relative to this directory, then a path relative to the current working directory of the user) default value is ‘ARIANNA/arianna_detector_db.json’
- default_station:
This option is deprecated. ONLY in case no ‘reference_station’ is set in the station parameters of the detector description, the ‘default_station’ is used as reference for the time being. ID of the station that should be used as the default station. The default station needs to have a complete detector description. If a property is missing in any of the other stations, the value from the default station will be used instead.
- default_channel:
This option is deprecated. ONLY in case no ‘reference_channel’ is set in the channel parameters of the detector description, the ‘default_channel’ is used as reference for the time being. ID of the channel that should be used as the default channel. This channel has to be part of the reference station and have a complete detector description. If a property is missing in any of the other channels, the value from the default channel will be used instead.
- default_device:
This option is deprecated. ONLY in case no ‘reference_device’ is set in the device parameters of the detector description, the ‘default_device’ is used as reference for the time being. ID of the device that should be used as the default device. This channel has to be part of the reference station and have a complete detector description. If a property is missing in any of the other devices, the value from the default device will be used instead.
- source: str
‘json’ or ‘dictionary’ default value is ‘json’ If ‘json’ is passed, the JSON dictionary at the location specified by json_filename will be used If ‘dictionary’ is passed, the dictionary specified by the parameter ‘dictionary’ will be used
- dictionary: dict
If ‘dictionary’ is passed to the parameter source, the dictionary passed to this parameter will be used for the detector description.
- assume_infBool
Default to True, if true forces antenna models to have infinite boundary conditions, otherwise the antenna madel will be determined by the station geometry.
- antenna_by_depth: bool (default False)
if True the antenna model is determined automatically depending on the depth of the antenna. This is done by appending e.g. ‘_InfFirn’ to the antenna model name. if False, the antenna model as specified in the database is used.
- Attributes:
antenna_by_depth
Getter function for the
antenna_by_depth
attributeassume_inf
Getter function for the
assume_inf
attribute
Methods
add_generic_station
(station_dict)Add a generic station to the detector.
add_station_properties_for_event
(properties, ...)Adds an entry to the list of event-specific changes to the detector description.
get_absolute_position
(station_id)get the absolute position of a specific station
get the absolute position of a specific station
get_amplifier_measurement
(station_id, channel_id)returns a unique reference to the amplifier measurement
get_amplifier_response
(station_id, ...)Returns the amplifier response for the amplifier of a given channel
get_amplifier_type
(station_id, channel_id)returns the type of the amplifier
get_antenna_deployment_time
(station_id, ...)returns the time of antenna deployment
get_antenna_model
(station_id, channel_id[, ...])determines the correct antenna model from antenna type, position and orientation of antenna
get_antenna_orientation
(station_id, channel_id)returns the orientation of a specific antenna
get_antenna_type
(station_id, channel_id)returns the antenna type
get_cable_delay
(station_id, channel_id)returns the cable delay of a channel
get_cable_type_and_length
(station_id, channel_id)returns the cable type (e.g.
get_channel
(station_id, channel_id)returns a dictionary of all channel parameters
get_channel_group_id
(station_id, channel_id)returns the group ID of a channel.
get_channel_ids
(station_id)get the channel ids of a station
Get the properties of the default channel
Get the ID of the default channel
Get the properties of the default station
Get the ID of the default station
Returns the time that the detector is currently set to
get_device
(station_id, device_id)returns a dictionary of all device parameters
get_device_ids
(station_id)get the device ids of a station
get_noise_RMS
(station_id, channel_id[, stage])returns the noise RMS that was precomputed from forced triggers
get_noise_temperature
(station_id, channel_id)returns the noise temperature of the channel
get_number_of_channels
(station_id)Get the number of channels per station
get_number_of_devices
(station_id)Get the number of devices per station
get_number_of_samples
(station_id, channel_id)returns the number of samples of a channel
get_parallel_channels
(station_id)get a list of parallel antennas
get_raw_channel
(station_id, channel_id)Get the properties of a channel as they are in the original detector description, i.e. without missing properties being replaced by those from the default channel.
get_raw_station
(station_id)Get the properties of a station as they are in the original detector description, i.e. without missing properties being replaced by those from the default station.
get_reference_station
(station_id)Get the properties of the reference station
get_reference_station_id
(station_id)Get the properties of the reference station
Get the whole dictionary of reference stations
Get the properties of the reference stations
get_relative_position
(station_id, channel_id)get the relative position of a specific channels/antennas with respect to the station center
get_sampling_frequency
(station_id, channel_id)returns the sampling frequency
get_site
(station_id)get the site where the station is deployed (e.g.
get_site_coordinates
(station_id)get the (latitude, longitude) coordinates (in degrees) for a given detector site.
returns a sorted list of all station ids present in the database
get_station_properties_for_event
(run_number, ...)Returns all event-specific changes that have been stored in the detector description for a given station and event
get_unique_time_periods
(station_id)returns the time periods in which the station configuration (including all channels) was constant
has_station
(station_id)checks if a station is present in the database
is_channel_noiseless
(station_id, channel_id)returns true if the detector description has the field noiseless and if this field is True.
set_event
(run_number, event_id)Sets the run number and event ID for which the detector description should be returned.
update
(time)updates the detector description to a new time
get_station
- add_generic_station(station_dict)[source]
Add a generic station to the detector. The station is treated like a generic station in the original detector description file, i.e. all missing properties and all channels will be taken from the reference station. If a station with the same ID already exists, this function does nothing.
- Parameters:
- station_dict: dictionary
dictionary containing the station properties. Needs to at least include a station_id, any other missing parameters will be taken from the reference station
- add_station_properties_for_event(properties, station_id, run_number, event_id)[source]
Adds an entry to the list of event-specific changes to the detector description.
- Parameters:
- properties: dictionary
Dictionary of the properties that should be changed, with keys being any of the property names in the detector description and values the values that these properties should be changed to
- station_id: integer
ID of the station whose properties should be changed
- run_number: integer
Run number of the event for which the changes are valid
- event_id: integer
Event ID of the event for which the changes are valid
- get_station_properties_for_event(run_number, event_id, station_id=None)[source]
Returns all event-specific changes that have been stored in the detector description for a given station and event
- Parameters:
- run_number: integer
Run number of the event for which the changes should be returned
- event_id: integer
Event ID of the event for which the changes should be returned
- station_id: integer or None
ID of the station for which the changes should be returned If station_id is None, changes for all stations are returned
- set_event(run_number, event_id)[source]
Sets the run number and event ID for which the detector description should be returned. This is needed if event-specific changes to the detector description have been stored. If run_number or event_id are not set (or are set to None), event-specific changes to the detector will be ignored
- Parameters:
- run_number: integer
Run number of the event the detector should be set to
- event_id: integer
ID of the event the detector should be set to
- get_raw_station(station_id)[source]
Get the properties of a station as they are in the original detector description, i.e. without missing properties being replaced by those from the default station. Event-specific changes are also ignored.
- Parameters:
- station_id: integer
ID of the requested station
- get_raw_channel(station_id, channel_id)[source]
Get the properties of a channel as they are in the original detector description, i.e. without missing properties being replaced by those from the default channel.
- Parameters:
- station_id: integer
ID of the requested channel’s station
- channel_id: integer
ID of the requested channel
- has_station(station_id)[source]
checks if a station is present in the database
- Parameters:
- station_id: int
the station id
- Returns bool
- update(time)[source]
updates the detector description to a new time
- Parameters:
- time: astropy.time.Time
the time to update the detector description to for backward compatibility datetime is also accepted, but astropy.time is prefered
- property antenna_by_depth
Getter function for the
antenna_by_depth
attribute
- property assume_inf
Getter function for the
assume_inf
attribute
- get_absolute_position(station_id)
get the absolute position of a specific station
- Parameters:
- station_id: int
the station id
- Returns:
- 3-dim array of absolute station position in easting, northing and depth wrt. to snow level at
- time of measurement
- get_absolute_position_site(site)
get the absolute position of a specific station
- Parameters:
- site: string
the position identifier e.g. “G”
- Returns:
- 3-dim array of absolute station position in easting, northing and depth wrt. to snow level at
- time of measurement
- get_amplifier_measurement(station_id, channel_id)
returns a unique reference to the amplifier measurement
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns string
- get_amplifier_response(station_id, channel_id, frequencies)
Returns the amplifier response for the amplifier of a given channel
- Parameters:
- station_id: int
The ID of the station
- channel_id: int
The ID of the channel
- frequencies: array of floats
The frequency array for which the amplifier response shall be returned
- get_amplifier_type(station_id, channel_id)
returns the type of the amplifier
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns string
- get_antenna_deployment_time(station_id, channel_id)
returns the time of antenna deployment
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns datetime
- get_antenna_model(station_id, channel_id, zenith=None)
determines the correct antenna model from antenna type, position and orientation of antenna
so far only infinite firn and infinite air cases are differentiated
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- zenith: float or None (default)
the zenith angle of the incoming signal direction
- Returns string
- get_antenna_orientation(station_id, channel_id)
returns the orientation of a specific antenna
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns:
- tuple of floats
orientation theta: orientation of the antenna, as a zenith angle (0deg is the zenith, 180deg is straight down); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
orientation phi: orientation of the antenna, as an azimuth angle (counting from East counterclockwise); for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry
rotation theta: rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
rotation phi: rotation of the antenna, is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the the tines
- get_antenna_type(station_id, channel_id)
returns the antenna type
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns string
- get_cable_delay(station_id, channel_id)
returns the cable delay of a channel
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns float (delay time)
- get_cable_type_and_length(station_id, channel_id)
returns the cable type (e.g. LMR240) and its length
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns tuple (string, float)
- get_channel(station_id, channel_id)
returns a dictionary of all channel parameters
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns:
- dict of channel parameters
- get_channel_group_id(station_id, channel_id)
returns the group ID of a channel. If the channel has no group ID, the channel ID is returned.
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns:
- group_idint
the channel group ID
- get_channel_ids(station_id)
get the channel ids of a station
- Parameters:
- station_id: int
the station id
- Returns list of ints
- get_detector_time()
Returns the time that the detector is currently set to
- get_device(station_id, device_id)
returns a dictionary of all device parameters
- Parameters:
- station_id: int
the station id
- device_id: int
the device id
- Returns:
- dict of device parameters
- get_device_ids(station_id)
get the device ids of a station
- Parameters:
- station_id: int
the station id
- Returns list of ints
- get_noise_RMS(station_id, channel_id, stage='amp')
returns the noise RMS that was precomputed from forced triggers
- Parameters:
- station_id: int
station id
- channel_id: int
the channel id, not used at the moment, only station averages are computed
- stage: string (default ‘amp’)
specifies the stage of reconstruction you want the noise RMS for, stage can be one of
‘raw’ (raw measured trace)
‘amp’ (after the amp was deconvolved)
‘filt’ (after the trace was highpass with 100MHz
- Returns:
- RMS: float
the noise RMS (actually it is the standard deviation but as the mean should be zero its the same)
- get_noise_temperature(station_id, channel_id)
returns the noise temperature of the channel
- Parameters:
- station_id: int
station id
- channel_id: int
the channel id
- get_number_of_channels(station_id)
Get the number of channels per station
- Parameters:
- station_id: int
the station id
- Returns int
- get_number_of_devices(station_id)
Get the number of devices per station
- Parameters:
- station_id: int
the station id
- Returns int
- get_number_of_samples(station_id, channel_id)
returns the number of samples of a channel
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns int
- get_parallel_channels(station_id)
get a list of parallel antennas
- Parameters:
- station_id: int
the station id
- Returns list of list of ints
- get_relative_position(station_id, channel_id, mode='channel')
get the relative position of a specific channels/antennas with respect to the station center
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- mode_id: str
specify if relative position of a channel or a device is asked for
- Returns:
- 3-dim array of relative station position
- get_sampling_frequency(station_id, channel_id)
returns the sampling frequency
- Parameters:
- station_id: int
the station id
- channel_id: int
the channel id
- Returns float
- get_site(station_id)
get the site where the station is deployed (e.g. MooresBay or South Pole)
- Parameters:
- station_id: int
the station id
- Returns string
- get_site_coordinates(station_id)
get the (latitude, longitude) coordinates (in degrees) for a given detector site.
- Parameters:
- station_id: int
the station ID
- get_station(station_id)
- get_station_ids()
returns a sorted list of all station ids present in the database
- get_unique_time_periods(station_id)
returns the time periods in which the station configuration (including all channels) was constant
- Parameters:
- station_id: int
the station id
- Returns datetime tuple
- is_channel_noiseless(station_id, channel_id)
returns true if the detector description has the field noiseless and if this field is True.
Allows to run a noiseless simulation on specific channels (for example to simulate a single-antenna proxy along with the phased array)
- Parameters:
- station_id: int
station id
- channel_id: int
the channel id