NuRadioReco.detector.RNO_G.rnog_detector module

class NuRadioReco.detector.RNO_G.rnog_detector.Detector(database_connection='RNOG_public', log_level=0, over_write_handset_values=None, database_time=None, always_query_entire_description=False, detector_file=None, select_stations=None, create_new=False)[source]

Bases: object

The RNO-G detector description.

Parameters:
database_connectionstr (Default: ‘RNOG_public’)

Allows to specify database connection. Passed to mongo-db interface.

log_levellogging.LOG_LEVEL (Default: logging.NOTSET)

Overrides verbosity level of logger. Propagates through to Response class logger. Other options are: logging.WARNING, logging.DEBUG, …

over_write_handset_valuesdict (Default: {})

Overwrite the default values for (channel) parameters which are not (yet) implemented in the database. You can not specify keys which already exist in the database. If the value is a dict it should be contain a value for each channel_id (key). (Default: None, the acutally default values for the parameters in question are defined below)

database_timedatetime.datetime or astropy.time.Time

Set database time which is used to select the primary measurement. By default (= None) the database time is set to now (time the code is running) to select the measurement which is now primary.

always_query_entire_descriptionbool (Default: False)

If True, query the entire detector describtion all at once when calling Detector.update(…) (if necessary). This value is currently set to False by default to avoid errors due to missing information in the database.

detector_filestr

File to import detector description instead of querying from DB. (Default: None -> query from DB)

select_stationsint or list(int) (Default: None)

Select a station or list of stations using their station ids for which the describtion is provided. This is useful for example in simulations when one wants to simulate only one station. The default None means to descibe all commissioned stations.

create_newbool (Default: False)

If False, and a database already exists, the existing database will be used rather than initializing a new connection. Set to True to create a new database connection.

Notes

For more information about Detector objects in NuRadioMC, see https://nu-radio.github.io/NuRadioMC/NuRadioReco/pages/detector_tree.html

Methods

export(filename[, json_kwargs, additional_data])

Export the buffered detector description.

export_as_string([...])

Export the detector description as string using json.dumps

get_absolute_position(station_id)

Get the absolute position of a specific station (relative to site)

get_amplifier_response(station_id, ...)

Returns the complex response function for the entire signal chain of a channel.

get_antenna_model(station_id, channel_id[, ...])

Parameters:

get_antenna_orientation(station_id, channel_id)

Returns get_channel_orientation

get_antenna_type(station_id, channel_id)

Returns type of antenna, i.e., "VPol" or "HPol" or "LPDA", ...

get_cable_delay(station_id, channel_id[, ...])

Return the cable delay of a signal chain as stored in the detector description.

get_channel(station_id, channel_id)

Returns a dictionary of all channel parameters

get_channel_ids(station_id)

Get channel ids for a particlular station.

get_channel_orientation(station_id, channel_id)

Returns the orientation of a specific channel/antenna

get_channel_signal_chain(station_id, channel_id)

Parameters:

get_detector_time()

Returns:

get_devices(station_id)

Get all devices for a particular station.

get_noise_temperature(station_id, channel_id)

Get noise temperture per station / channel

get_number_of_channels(station_id)

Get number of channels for a particlular station.

get_number_of_samples(station_id[, channel_id])

Get number of samples for recorded waveforms

get_relative_position(station_id, channel_id)

Get the relative position of a specific channel/antenna with respect to the station center

get_relative_position_device(station_id, ...)

Get the relative position of a specific device with respect to the station center

get_sampling_frequency(station_id[, channel_id])

Get sampling frequency per station / channel

get_signal_chain_components(station_id, ...)

Returns the names of all components in the signal chain.

get_signal_chain_response(station_id, channel_id)

Returns a detector.response.Response object which describes the complex response of the entire signal chain, i.e., the combined reponse of all components of one channel.

get_site(station_id)

This detector class is exclusive for the RNO-G detector at Summit Greenland.

get_site_coordinates([station_id])

Get the (latitude, longitude) coordinates (in degrees) for the RNO-G detector site.

get_station(station_id)

Returns a dictionary of all station parameters/information including some channel information.

get_station_ids()

Returns the list of all commissioned stations.

get_time_delay(station_id, channel_id[, ...])

Return the sum of the time delay of all components in the signal chain calculated from the phase

has_station(station_id)

Returns true if the station is commission.

update(time)

Updates the detector.

is_channel_noiseless

export(filename, json_kwargs=None, additional_data=None)[source]

Export the buffered detector description.

Parameters:
filename: str

Filename of the exported detector description

json_kwargs: dict

Arguments passed to json.dumps(..). (Default: None -> dict(indent=0, default=_json_serial))

additional_data: dict (Default: None)

If specified the content of this dict will be added to the exported detector description.

export_as_string(skip_signal_chain_response=True, dumps_kwargs=None)[source]

Export the detector description as string using json.dumps

Parameters:
skip_signal_chain_response: bool

If true drop the data of the response chain from the detector description (because this creates large files). (Default: True)

dumps_kwargs: dict

Arguments passed to json.dumps(..). (Default: None -> dict(indent=4, default=str))

get_detector_time()[source]
Returns:
time: datetime.datetime

Detector time

update(time)[source]

Updates the detector. If configure in constructor this function with trigger the database query.

Parameters:
time: `datetime.datetime` or ``astropy.time.Time``

Unix time of measurement.

get_station_ids()[source]

Returns the list of all commissioned stations. Returns ——-

station_ids: list(int)

List of all commissioned station ids.

has_station(station_id)[source]

Returns true if the station is commission. First checks buffer. If not in buffer, queries (and buffers) the basic information of all stations and checks if station is among them.

Parameters:
station_id: int

Station id which uniquely idendifies a station

Returns:
has_station: bool

Returns True if the station could be found. A found station will be in the buffer.

get_channel(station_id, channel_id)[source]

Returns a dictionary of all channel parameters

Parameters:
station_id: int

The station id

channel_id: int

The channel id

Returns:
channel_info: dict

Dictionary of channel parameters

get_station(station_id)[source]

Returns a dictionary of all station parameters/information including some channel information. The channel’s (signal chain) response is not necessarily returned (they might be if they are already in the buffer but this is not ensured). To get the complete channel information call self.get_channel(station_id, channel_id).

Parameters:
station_id: int

The station id

Returns:
station_info: dict

Dictionary of station parameters/information

get_absolute_position(station_id)[source]

Get the absolute position of a specific station (relative to site)

Parameters:
station_id: int

the station id

Returns:
pos: np.array(3,)

3-dim array of absolute station position in easting, northing and depth wrt. to snow level at time of measurement

get_relative_position(station_id, channel_id)[source]

Get the relative position of a specific channel/antenna with respect to the station center

Parameters:
station_id: int

The station id

channel_id: int

The channel id

Returns:
pos: np.array(3,)

3-dim array of relative station position

get_channel_orientation(station_id, channel_id)[source]

Returns the orientation of a specific channel/antenna

Orientation:
  • theta: For LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry

  • phi: Counting from East counterclockwise; for LPDA: outward along boresight; for dipoles: upward along axis of azimuthal symmetry

Rotation:
  • theta: Is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the tines

  • phi: Is perpendicular to ‘orientation’, for LPDAs: vector perpendicular to the plane containing the tines

Parameters:
station_id: int

The station id

channel_id: int

The channel id

Returns:
orientation: array of floats

(orientation_theta, orientation_phi, rotation_theta, rotation_phi): tuble of floats

get_antenna_orientation(station_id, channel_id)[source]

Returns get_channel_orientation

get_channel_signal_chain(station_id, channel_id)[source]
Parameters:
station_id: int

The station id

channel_id: int

The channel id

Returns:
channel_signal_chain: dict

Returns dictionary which contains a list (“signal_chain”) which contains (the names of) components/response which are used to describe the signal chain of the channel

get_amplifier_response(station_id, channel_id, frequencies)[source]

Returns the complex response function for the entire signal chain of a channel.

This includes not only the (main) amplifier but also cables and other components. Note that while group delays are appropriately accounted for, an overall time delay (mostly due to cable delay) has been removed and is instead accounted for by get_time_delay.

Parameters:
station_id: int

The station id

channel_id: int

The channel id

frequencies: array of floats

Array of frequencies for which the response is returned

Returns:
response: array of complex floats

Complex response function

See also

get_time_delay
get_signal_chain_response(station_id, channel_id)[source]

Returns a detector.response.Response object which describes the complex response of the entire signal chain, i.e., the combined reponse of all components of one channel. For example: IGLU, fiber-cable, DRAB, coax-cable, RADIANT.

Parameters:
station_id: int

The station id

channel_id: int

The channel id

Returns:
response: detector.response.Response

Returns combined response of the channel

get_signal_chain_components(station_id, channel_id)[source]

Returns the names of all components in the signal chain.

Parameters:
station_id: int

The station id

channel_id: int

The channel id

Returns:
signal_chain_components: dict

A dictionaries with the keys being the names of the components and the values their weights in the signal chain. (For an explanation of a weight see detector.response.Response)

get_devices(station_id)[source]

Get all devices for a particular station.

Parameters:
station_id: int

Station id

Returns:
devices: dict(str)

Dictonary of all devices with {id: name}.

get_relative_position_device(station_id, device_id)[source]

Get the relative position of a specific device with respect to the station center

Parameters:
station_id: int

The station id

device_id: int

Device identifier

Returns:
pos: np.array(3,)

3-dim array of relative station position

get_number_of_channels(station_id)[source]

Get number of channels for a particlular station. It will query the basic information of all stations in the Database if necessary. Raises an error if the station is not commission.

Parameters:
station_id: int

Station id which uniquely idendifies a station

Returns:
channel_ids: int

Number of all channels for the requested station

get_channel_ids(station_id)[source]

Get channel ids for a particlular station. It will query the basic information of all stations in the Database if necessary. Raises an error if the station is not commission.

Parameters:
station_id: int

Station id which uniquely idendifies a station

Returns:
channel_ids: list(int)

A list of all channel ids for the requested station

get_antenna_model(station_id, channel_id, zenith=None)[source]
Parameters:
station_id: int

Station id

channel_id: int

Channel id

zenith: float (Default: None)

So far has no use in this class. Only defined to keep the interface in parity to other detector classes

Returns:
antenna_model: string

Name of the antenna model (describing the Vector effective length VEL)

get_antenna_type(station_id, channel_id)[source]

Returns type of antenna, i.e., “VPol” or “HPol” or “LPDA”, …

Parameters:
station_id: int

Station id

channel_id: int

Channel id

Returns:
ant_type: string

Accronym/abbrivatipn of the antenna type

get_number_of_samples(station_id, channel_id=None)[source]

Get number of samples for recorded waveforms

All RNO-G channels have the same number of samples, the argument channel_id is not used but we keep it here for consistency with outer detector classes.

Parameters:
station_id: int

Station id

Returns:
number_of_samples: int

Number of samples with which each waveform is recorded

get_sampling_frequency(station_id, channel_id=None)[source]

Get sampling frequency per station / channel

All RNO-G channels have the same sampling frequency, the argument channel_id is not used but we keep it here for consistency with other detector classes.

Parameters:
station_id: int

Station id

channel_id: int (default: None)

Not Used!

Returns:
sampling_rate: int

Sampling frequency

get_noise_temperature(station_id, channel_id)[source]

Get noise temperture per station / channel

is_channel_noiseless(station_id, channel_id)[source]
get_cable_delay(station_id, channel_id, use_stored=True)[source]

Return the cable delay of a signal chain as stored in the detector description.

This interface is required by simulation.py. See get_time_delay for description of arguments.

get_time_delay(station_id, channel_id, cable_only=False, use_stored=True)[source]

Return the sum of the time delay of all components in the signal chain calculated from the phase

Parameters:
station_id: int

The station id

channel_id: int

The channel id

cable_only: bool

If True: Consider only cables to calculate delay. (Default: False)

use_stored: bool

If True, take time delay as stored in DB rather than calculated from response. (Default: True)

Returns:
time_delay: float

Sum of the time delays of all components in the signal chain for one channel

get_site(station_id)[source]

This detector class is exclusive for the RNO-G detector at Summit Greenland.

Returns:
site: str

Returns “summit”

get_site_coordinates(station_id=None)[source]

Get the (latitude, longitude) coordinates (in degrees) for the RNO-G detector site.

Parameters:
station_id: int

the station ID (not used, only for compatibility with other detector classes)