Beispiel #1
0
def testMessageConst_getDataBits1():
    '''
  Test constant message data bits lookup
  '''
    message = MessageConst(1)
    dataAll_idx = numpy.asarray([0, 1, 2, 6], dtype=numpy.long)
    bits = message.getDataBits(dataAll_idx)
    assert bits.shape == (4, )
    assert bits.dtype == numpy.uint8
    assert (bits == 0).all()
def testMessageConst_getDataBits1():
  '''
  Test constant message data bits lookup
  '''
  message = MessageConst(1)
  dataAll_idx = numpy.asarray([0, 1, 2, 6], dtype=numpy.long)
  bits = message.getDataBits(dataAll_idx)
  assert bits.shape == (4,)
  assert bits.dtype == numpy.uint8
  assert (bits == 0).all()
Beispiel #3
0
def test_DopplerBase_computeDataNChipVector1():
  '''
  Test combination of data and code
  '''
  doppler = DopplerBase()
  chipAll_idx = numpy.linspace(0, 1022, 1023, dtype=numpy.long)
  message = Message(-1)
  code = PrnCode(1)
  vect = doppler.computeDataNChipVector(chipAll_idx,
                                        GPS.L1CA,
                                        message,
                                        code)

  assert len(vect) == 1023
  assert ((vect > 0) == code.getCodeBits(chipAll_idx)).all()
Beispiel #4
0
def test_DopplerZero_batch():
  '''
  Verifies execution of the batch computation with zero doppler.
  '''
  doppler = zeroDoppler(1000., 50., GPS.L1CA.CENTER_FREQUENCY_HZ)
  userTimeAll_s = numpy.linspace(0.,
                                 NormalRateConfig.SAMPLE_BATCH_SIZE /
                                 NormalRateConfig.SAMPLE_RATE_HZ,
                                 NormalRateConfig.SAMPLE_BATCH_SIZE,
                                 endpoint=False)
  amplitude = AmplitudePoly(AmplitudeBase.UNITS_AMPLITUDE, ())
  noiseParams = NoiseParameters(GPS.L1CA.CENTER_FREQUENCY_HZ, 0.)
  message = Message(1)
  code = PrnCode(1)
  res = doppler.computeBatch(userTimeAll_s,
                             amplitude,
                             noiseParams,
                             GPS.L1CA,
                             NormalRateConfig.GPS.L1.INTERMEDIATE_FREQUENCY_HZ,
                             message,
                             code,
                             NormalRateConfig,
                             True)

  signal1, doppler1 = res

  doppler.setCodeDopplerIgnored(True)
  res = doppler.computeBatch(userTimeAll_s,
                             amplitude,
                             noiseParams,
                             GPS.L1CA,
                             NormalRateConfig.GPS.L1.INTERMEDIATE_FREQUENCY_HZ,
                             message,
                             code,
                             NormalRateConfig,
                             True)
  signal2, doppler2 = res

  assert (signal1 == signal2).all()
  assert (doppler1 == doppler2).all()
Beispiel #5
0
def test_DopplerBase_computeBatch():
  '''
  Test signal generation
  '''
  doppler = DopplerBase(distance0_m=0., tec_epm2=0.)
  userTimeAll_s = numpy.asarray([0.])
  amplitude = AmplitudePoly(AmplitudeBase.UNITS_AMPLITUDE, ())
  noiseParams = NoiseParameters(NormalRateConfig.SAMPLE_RATE_HZ, 0.)
  message = Message(1)
  code = PrnCode(1)
  try:
    doppler.computeBatch(userTimeAll_s,
                         amplitude,
                         noiseParams,
                         GPS.L1CA,
                         NormalRateConfig.GPS.L1.INTERMEDIATE_FREQUENCY_HZ,
                         message,
                         code,
                         NormalRateConfig,
                         False)
    assert False
  except NotImplementedError:
    pass
Beispiel #6
0
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
"""
The :mod:`peregrine.iqgen.bits.satellite_glo` module contains classes and
functions related to GLONASS satellite configuration.

"""
import peregrine.iqgen.bits.signals as signals
from peregrine.iqgen.bits.message_const import Message
from peregrine.iqgen.bits.prn_glo_l1l2 import PrnCode as GLO_CA_Code
from peregrine.iqgen.bits.satellite_base import Satellite

import numpy

DEFAULT_MESSAGE = Message(1)


class GLOSatellite(Satellite):
    '''
  GLONASS satellite object.
  '''
    def __init__(self, prnNo):
        '''
    Constructs satellite object

    Parameters
    ----------
    prnNo : int
      GPS satellite number for selecting PRN.
    '''