Exemplo n.º 1
0
    def __init__(self, position, center_frequency, bandwidth, resistance,
                 orientation=(0,0,1), effective_height=None, noisy=True,
                 unique_noise_waveforms=10):
        if effective_height is None:
            # Calculate length of half-wave dipole
            self.effective_height = 3e8 / center_frequency / 2
        else:
            self.effective_height = effective_height

        # Get the critical frequencies in Hz
        f_low = center_frequency - bandwidth/2
        f_high = center_frequency + bandwidth/2

        # Get arbitrary x-axis orthogonal to orientation
        tmp_vector = np.zeros(3)
        while np.array_equal(np.cross(orientation, tmp_vector), (0,0,0)):
            tmp_vector = np.random.rand(3)
        ortho = np.cross(orientation, tmp_vector)
        # Note: ortho is not normalized, but will be normalized by Antenna init

        super().__init__(position=position, z_axis=orientation, x_axis=ortho,
                         antenna_factor=1/self.effective_height,
                         temperature=ice.temperature(position[2]),
                         freq_range=(f_low, f_high), resistance=resistance,
                         unique_noise_waveforms=unique_noise_waveforms,
                         noisy=noisy)

        # Build scipy butterworth filter to speed up response function
        b, a  = scipy.signal.butter(1, 2*np.pi*np.array(self.freq_range),
                                    btype='bandpass', analog=True)
        self.filter_coeffs = (b, a)
Exemplo n.º 2
0
    def __init__(self,
                 response_data,
                 position,
                 center_frequency,
                 bandwidth,
                 resistance,
                 z_axis=(0, 0, 1),
                 x_axis=(1, 0, 0),
                 efficiency=1,
                 noisy=True,
                 unique_noise_waveforms=10):
        # Parse the response data
        self._theta_response = response_data[0]
        self._phi_response = response_data[1]
        self._response_freqs = response_data[2]
        self._response_zens = response_data[3]
        self._response_azis = response_data[4]

        # Get the critical frequencies in Hz
        f_low = center_frequency - bandwidth / 2
        f_high = center_frequency + bandwidth / 2

        super().__init__(position=position,
                         z_axis=z_axis,
                         x_axis=x_axis,
                         efficiency=efficiency,
                         freq_range=(f_low, f_high),
                         temperature=ice.temperature(position[2]),
                         resistance=resistance,
                         noisy=noisy,
                         unique_noise_waveforms=unique_noise_waveforms)
Exemplo n.º 3
0
 def test_creation(self, dipole):
     """Test that the antenna's creation goes as expected"""
     assert dipole.name == "ant"
     assert np.array_equal(dipole.position, [0, 0, -250])
     assert np.array_equal(dipole.z_axis, [0, 0, 1])
     assert dipole.x_axis[2] == 0
     assert dipole.antenna_factor == 2 * 250e6 / 3e8
     assert dipole.efficiency == 1
     assert np.array_equal(dipole.freq_range, [100e6, 400e6])
     assert dipole.temperature == pytest.approx(ice.temperature(-250))
     assert dipole.resistance == 100
     assert dipole.threshold == 75e-6
     assert dipole.noisy
Exemplo n.º 4
0
    def __init__(self,
                 response_data,
                 position,
                 center_frequency,
                 bandwidth,
                 resistance,
                 orientation=(0, 0, 1),
                 efficiency=1,
                 noisy=True,
                 unique_noise_waveforms=10):
        # Parse the response data
        self._theta_response = response_data[0]
        self._phi_response = response_data[1]
        self._response_freqs = response_data[2]
        self._response_zens = response_data[3]
        self._response_azis = response_data[4]

        # Get the critical frequencies in Hz
        f_low = center_frequency - bandwidth / 2
        f_high = center_frequency + bandwidth / 2

        # Get arbitrary x-axis orthogonal to orientation
        tmp_vector = np.zeros(3)
        while np.array_equal(np.cross(orientation, tmp_vector), (0, 0, 0)):
            tmp_vector = np.random.rand(3)
        ortho = np.cross(orientation, tmp_vector)
        # Note: ortho is not normalized, but will be normalized by Antenna's init

        super().__init__(position=position,
                         z_axis=orientation,
                         x_axis=ortho,
                         efficiency=efficiency,
                         freq_range=(f_low, f_high),
                         temperature=ice.temperature(position[2]),
                         resistance=resistance,
                         noisy=noisy,
                         unique_noise_waveforms=unique_noise_waveforms)