Exemple #1
0
    def begin(self, debug=False):
        """
        begin method, sets general parameters of module

        """
        self.__debug = debug
        self.antenna_provider = antennapattern.AntennaPatternProvider()
Exemple #2
0
def load_antenna_responses(antgeomap, antenna_pattern_dict):
    """
	A function to do load the antenna responses

	Load all the response objects for every antenna in the geomap.
	Insert them as a key in the dictionary so we can call them later,


	Parameters
	----------
	antgeomap: I3IceAntennaGeometry geometry object
		a map of IceAntKeys to IceAntGeo objects
	
	antenna_model_dict: dictionary
		dictionary of 

	Returns
	-------
	void
	"""

    for iceantkey, g in antgeomap:

        antenna_model = g.antennaModel  # get the antenna model

        if antenna_model not in antenna_pattern_dict.keys():
            # only add this antenna if it's not already in the dictt

            antenna_provider = antennapattern.AntennaPatternProvider()
            antenna_pattern = antenna_provider.load_antenna_pattern(
                antenna_model)
            antenna_pattern_dict[antenna_model] = antenna_pattern
    def begin(self):
        """
        begin method. This function is executed before the event loop.

        The antenna pattern provider is initialized here.
        """
        self.antenna_provider = antennapattern.AntennaPatternProvider()
        pass
Exemple #4
0
    def begin(self,
              debug=False,
              uncertainty=None,
              time_resolution=0.1 * units.ns,
              pre_pulse_time=200 * units.ns,
              post_pulse_time=200 * units.ns):
        """
        Begin method, sets general parameters of module

        Parameters
        ---------------------
        debug: bool
            enable/disable debug mode (default: False -> no debug output)
        uncertainty: dictionary (default: {})
            optional argument to specify systematic uncertainties. currently supported keys
             * 'sys_dx': systematic uncertainty of x position of antenna
             * 'sys_dy': systematic uncertainty of y position of antenna
             * 'sys_dz': systematic uncertainty of z position of antenna
            * 'sys_amp': systematic uncertainty of the amplifier aplification,
                         specify value as relative difference of linear gain
            * 'amp': statistical uncertainty of the amplifier aplification,
                     specify value as relative difference of linear gain
        time_resolution: float
            time resolution of shifting pulse times
        pre_pulse_time: float
            length of empty samples that is added before the first pulse
        post_pulse_time: float
            length of empty samples that is added after the simulated trace
        """
        self.__debug = debug
        self.__time_resolution = time_resolution
        self.__pre_pulse_time = pre_pulse_time
        self.__post_pulse_time = post_pulse_time
        self.__max_upsampling_factor = 5000
        if uncertainty is None:
            self.__uncertainty = {}
        else:
            self.__uncertainty = uncertainty
        # some uncertainties are systematic, fix them here
        if ('sys_dx' in self.__uncertainty):
            self.__uncertainty['sys_dx'] = np.random.normal(
                0, self.__uncertainty['sys_dx'])
        if ('sys_dy' in self.__uncertainty):
            self.__uncertainty['sys_dy'] = np.random.normal(
                0, self.__uncertainty['sys_dy'])
        if ('sys_dz' in self.__uncertainty):
            self.__uncertainty['sys_dz'] = np.random.normal(
                0, self.__uncertainty['sys_dz'])
        if ('sys_amp' in self.__uncertainty):
            for iCh in self.__uncertainty['sys_amp'].keys():
                self.__uncertainty['sys_amp'][iCh] = np.random.normal(
                    1, self.__uncertainty['sys_amp'][iCh])
        self.antenna_provider = antennapattern.AntennaPatternProvider()
Exemple #5
0
 def begin(self):
     self.antenna_provider = antennapattern.AntennaPatternProvider()
# see ./antenna_models_hash.json for available antenna models
antenna_model = "createLPDA_100MHz_InfAir"

# ploting range
min_freq, max_freq = 0 * units.MHz, 1000 * units.MHz
df = 1 * units.MHz
ff = np.arange(min_freq, max_freq, df)

# signal income direction
zenith, azimuth = np.deg2rad(0), np.deg2rad(0)

# antenna orientation (0, 0, 90, 0 : Upwards looking, northwards pointing lpda)
zen_boresight, azi_boresight, zen_ori, azi_ori = np.deg2rad(0), np.deg2rad(
    0), np.deg2rad(90), np.deg2rad(0)

provider = antennapattern.AntennaPatternProvider()
antenna = provider.load_antenna_pattern(antenna_model)

VEL = antenna.get_antenna_response_vectorized(ff, zenith, azimuth,
                                              zen_boresight, azi_boresight,
                                              zen_ori, azi_ori)

fig, ax = plt.subplots(1, 1)
ax.plot(ff / units.MHz, np.abs(VEL['theta']), '.-', label='eTheta')
ax.plot(ff / units.MHz, np.abs(VEL['phi']), '.-', label='ePhi')
ax.set_xlabel("frequency / MHz")
ax.set_ylabel("vector effective length / m")
fig.tight_layout()
ax.legend()
plt.savefig("VEL_%s_%d_%d.png" %
            (antenna_model, np.deg2rad(zenith), np.deg2rad(azimuth)))
Exemple #7
0
 def __init__(self, log_level=None):
     self.__t = 0
     self.logger = logging.getLogger('NuRadioReco.efieldToVoltageConverterPerEfield')
     if(log_level):
         self.logger.setLevel(log_level)
     self.antenna_provider = antennapattern.AntennaPatternProvider()