NuRadioReco.detector.response module

class NuRadioReco.detector.response.Response(frequency, y, y_unit, time_delay=0, weight=1, name='default', station_id=None, channel_id=None, remove_time_delay=True, debug_plot=False, log_level=0, attenuator_in_dB=0)[source]

Bases: object

This class provides an interface to read-in and apply the complex response functions of the various components of the signal chain of a RNO-G channel. The class allows to combine the response of several components into one response by multiplying them.

Examples

response = det.get_signal_chain_response(station_id=24, channel_id=0)

# Multipy the response to a trace. The multiply operator takes care of everything
trace_at_readout = trace_at_antenna * response

# getting the complex response as array
freq = np.arange(50, 1000) * units.MHz
complex_resp = response(freq)

Methods

__call__(freq[, component_names, blacklist])

Returns the complex response for a given frequency.

get_names()

Get list of the names of all individual responses

get_time_delay()

Get time delay from DB

get_time_delays()

Get time delay from DB

remove(name)

Remove a component response from the response object.

plot

Parameters:
frequencylist(float)

The frequency vector at which the response is measured. Unit has to be GHz.

y[list(float), list(float)]

The measured response. First entry is the vector of the measured amplitude, the second entry is the measured phase. The unit of both entries is specified with the next argument.

y_unit[str, str]

The first entry specifies the unit of the measured amplitude. Options are “dB”, “MAG” and “mag”. The second entry specifies the unit of the measured phase. Options are “rad” and “deg”.

time_delayfloat (Default: 0)

“Average” group delay. Read from database. Will be used to normalize the phase and stored alongside response

weightfloat (Default: 1)

Specifies the weight with which this component reponse “adds” to the total signal-chain response or data. Its the exponent of the complex multiplicitive gain. That means that a value of 1 means to linear multiply this reponse while a value of -1 means to divide by this reponse.

namestr (Default: “default”)

Give the response a name. This is only use for printing purposes.

station_idint (Default: None)

Associated station id.

channel_idint (Default: None)

Associated channel id.

remove_time_delaybool (Default: True)

If True, remove time_delay from response.

debug_plotbool (Default: False)

If True, produce a debug plot

attenuator_in_dBfloat (Default: 0)

Allows to add an additional attenuation/gain to the response. This is useful to simulate or correct of the the effect of an attenuator. The value is in dB. A value of 10dB will increase the response by 10 dB. (Default: 0 -> no attenuation)

log_levellogging.LOG_LEVEL (Default: logging.NOTSET)

Overrides verbosity level of logger. Other options are: logging.WARNING, logging.DEBUG, …

Methods

__call__(freq[, component_names, blacklist])

Returns the complex response for a given frequency.

get_names()

Get list of the names of all individual responses

get_time_delay()

Get time delay from DB

get_time_delays()

Get time delay from DB

remove(name)

Remove a component response from the response object.

plot

get_names()[source]

Get list of the names of all individual responses

remove(name)[source]

Remove a component response from the response object.

Parameters:
name: str

Name of the component to remove

plot(ax1=None, show=False, in_dB=True, plt_kwargs={})[source]
get_time_delay()[source]

Get time delay from DB

get_time_delays()[source]

Get time delay from DB

NuRadioReco.detector.response.subtract_time_delay_from_response(frequencies, resp, phase=None, time_delay=None)[source]

Remove a constant time delay from a complex response function

Parameters:
frequenciesarray of floats

Corresponding frequencies

resparray of (complex) floats

Complex response function (if phase is None), Real gain of a complex response function (if phase is not None).

phasearray of floats

Phase of the complex response function (optional). (Default: None)

time_delayfloat

Time delay to be removed

Returns:
resp: array of complex floats

Corrected response function