(self)
return stats
Get demodulator statistics

        Returns:
            Dictionary with the receiver stats following the format expected by
            the Monitor class (from monitor.py), i.e., each dictionary element
            as a tuple "(value, unit)".
Get demodulator statistics
Get demodulator statistics
def get_stats(self):
        """Get demodulator statistics

        Returns:
            Dictionary with the receiver stats following the format expected by
            the Monitor class (from monitor.py), i.e., each dictionary element
            as a tuple "(value, unit)".

        """
        res = self._get('s400SignalLockStatus' + self.demod,
                        's400SignalStrength' + self.demod,
                        's400CarrierToNoise' + self.demod,
                        's400UncorrectedPackets' + self.demod,
                        's400BER' + self.demod)

        if res is None:
            return

        signal_lock_raw = res[0][1]
        signal_raw = res[1][1]
        c_to_n_raw = res[2][1]
        uncorr_raw = res[3][1]
        ber_raw = res[4][1]

        # Parse
        signal_lock = (signal_lock_raw == 'locked')
        stats = {'lock': (signal_lock, None)}

        # Metrics that require locking
        #
        # NOTE: the S400 does not return the signal level if unlocked.
        if (signal_lock):
            level = float('nan') if (signal_raw
                                     == '< 70') else float(signal_raw)
            cnr = float('nan') if (c_to_n_raw == '< 3') else float(c_to_n_raw)
            stats['snr'] = (cnr, "dB")
            stats['level'] = (level, "dBm")
            stats['ber'] = (float(ber_raw), None)
            stats['pkt_err'] = (int(uncorr_raw), None)

        return stats
def get_stats ( self ) : res = self . _get ( 's400SignalLockStatus' + self . demod , 's400SignalStrength' + self . demod , 's400CarrierToNoise' + self . demod , 's400UncorrectedPackets' + self . demod , 's400BER' + self . demod ) if res is None : return signal_lock_raw = res [ 0 ] [ 1 ] signal_raw = res [ 1 ] [ 1 ] c_to_n_raw = res [ 2 ] [ 1 ] uncorr_raw = res [ 3 ] [ 1 ] ber_raw = res [ 4 ] [ 1 ] # Parse signal_lock = ( signal_lock_raw == 'locked' ) stats = { 'lock' : ( signal_lock , None ) } # Metrics that require locking # # NOTE: the S400 does not return the signal level if unlocked. if ( signal_lock ) : level = float ( 'nan' ) if ( signal_raw == '< 70' ) else float ( signal_raw ) cnr = float ( 'nan' ) if ( c_to_n_raw == '< 3' ) else float ( c_to_n_raw ) stats [ 'snr' ] = ( cnr , "dB" ) stats [ 'level' ] = ( level , "dBm" ) stats [ 'ber' ] = ( float ( ber_raw ) , None ) stats [ 'pkt_err' ] = ( int ( uncorr_raw ) , None ) return stats