Skip to content

Commit

Permalink
Merge pull request #208 from nu-radio/unify_analog_components
Browse files Browse the repository at this point in the history
i made the format of the amp response the same as in the other experiments. comments a clearer now.
  • Loading branch information
lpyras committed Mar 17, 2020
2 parents 0a63e55 + 28d056d commit f266eff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions NuRadioReco/detector/RNO_G/analog_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ def get_amp_gain(ff):

def get_amp_phase(ff):
amp_phase = amp_phase_f(ff)
return amp_phase
return np.exp(1j * amp_phase)

amp_response['gain'] = get_amp_gain
amp_response['phase'] = get_amp_phase

return amp_response['gain'](ff) * np.exp(1j * amp_response['phase'](ff))
# def get_amp_response(ff):
# return amp_response['gain'](ff) * amp_response['phase'](ff)

return amp_response

def load_amp_measurement(amp_measurement='surface_-60dBm_chan0_RI_20dB'): # use this function to read in RI data
"""
Expand All @@ -77,7 +80,11 @@ def load_amp_measurement(amp_measurement='surface_-60dBm_chan0_RI_20dB'): # use
amp_gain_f = interp1d(ff, gain, bounds_error=False, fill_value=1) # all requests outside of measurement range are set to 1

amp_measures['gain'] = amp_gain_f
amp_measures['phase'] = amp_phase_f
amp_measures['phase'] = np.exp(1j * amp_phase_f)

#def get_amp_measure(ff):
# return amp_measures['gain'](ff) * amp_measures['phase'](ff)

return amp_measures

return amp_measures['gain'](ff) * np.exp(1j * amp_measures['phase'](ff))

1 change: 1 addition & 0 deletions NuRadioReco/modules/RNO_G/hardwareResponseIncorporator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def get_filter(self, frequencies, station_id, channel_id, det, sim_to_data=False
"""
amp_type = det.get_amplifier_type(station_id, channel_id)
amp_response = analog_components.load_amp_response(amp_type) #it reads the log file. change this to load_amp_measurement if you want the RI file
amp_response = amp_response['gain'](frequencies) * amp_response['phase'](frequencies)

if mingainlin!=None:
mingainlin = float(mingainlin)
Expand Down

0 comments on commit f266eff

Please sign in to comment.