def get_rain_frequency(self, n=5):
        '''
        Populates the self.rain_frequency property
        '''
        if self.logger:
            self.logger.info('Getting rain frequency')
        values = []
        for i in range(0, n):
            try:
                value = float(self.query('!E')[0]) * 100. / 1023.
                if self.logger:
                    self.logger.debug('  Rain Freq Query = {:.1f}'.format(value))
                values.append(value)
            except:
                pass
        if len(values) >= n - 1:
            self.rain_frequency = np.median(values)
            if self.logger:
                self.logger.info('  Rain Frequency = {:.1f}'.format(self.rain_frequency))
        else:
            self.rain_frequency = None
            if self.logger:
                self.logger.info('  Failed to read Rain Frequency')
        return self.rain_frequency
dataset/ETHPy150Open panoptes/POCS/scripts/read_weather.py/AAGCloudSensor.get_rain_frequency/original