Skip to content
Snippets Groups Projects
Commit 5e218dba authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Merge branch 'TMSS-747-fix-cobalt-blocksize-calc' into 'master'

TMSS-747: Fix COBALT beamformer model in the blocksize calculation. Added...

Closes TMSS-747

See merge request !451
parents 6df0ec44 dbb4cfc0
No related branches found
No related tags found
1 merge request!451TMSS-747: Fix COBALT beamformer model in the blocksize calculation. Added...
from fractions import gcd
try:
from math import gcd
except ImportError:
from fractions import gcd
__all__ = ["lcm"]
def lcm(a, b):
""" Return the Least Common Multiple of a and b. """
return abs(a * b) / gcd(a, b) if a and b else 0
return int(abs(a * b) / gcd(a, b) if a and b else 0)
......@@ -96,7 +96,7 @@ class BlockConstraints(object):
NR_PPF_TAPS = 16
MAX_THREADS_PER_BLOCK = 1024
CORRELATOR_BLOCKSIZE = 16
BEAMFORMER_NR_DELAYCOMPENSATION_CHANNELS = 64
BEAMFORMER_NR_DELAYCOMPENSATION_CHANNELS = 256
BEAMFORMER_DELAYCOMPENSATION_BLOCKSIZE = 16
# Process correlator settings
......
......@@ -99,5 +99,20 @@ class TestBlockSize(unittest.TestCase):
self.assertAlmostEquals(c._samples2time(bs.integrationSamples), integrationTime, delta = integrationTime * 0.05)
@unit_test
def testCoherentStokesBlocksize(self):
""" Test the coherent stokes block size against reference output, based on cases that used to fail in production.
If the output of these calculations change, make sure the described configurations do actually work in COBALT! """
coh = StokesSettings()
coh.nrChannelsPerSubband = 16
coh.timeIntegrationFactor = 1
c = BlockConstraints(coherentStokesSettings=[coh])
bs = BlockSize(c)
self.assertEqual(bs.blockSize, 196608)
if __name__ == "__main__":
unittest.main(verbosity=2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment