From d4ac8b3b6bdd6f6b5f49a349f904d0b831001830 Mon Sep 17 00:00:00 2001 From: David Rafferty Date: Wed, 17 Feb 2016 09:32:25 +0100 Subject: [PATCH] Adjust number of divisors check --- factor/process.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/factor/process.py b/factor/process.py index 3ea91b4c..aadd7c26 100644 --- a/factor/process.py +++ b/factor/process.py @@ -437,9 +437,11 @@ def _set_up_bands(parset, test_run=False): sys.exit(1) # Check that number of channels supports enough averaging steps - if list(duplicate_chans)[0] not in [18, 20, 24]: - log.warn('Number of channels per band is not 18, 20, or 24. Averaging will ' - 'not work well (too few divisors)') + nchans = list(duplicate_chans)[0] + n_divisors = len([x+1 for x in range(nchans) if not nchans % (x+1)]) + if n_divisors < 5: + log.warn('Number of channels per band is {}. Averaging will ' + 'not work well (too few divisors)'.format(nchans)) # Determine whether any bands need to be run through the initsubract operation. # This operation is only needed if band lacks an initial skymodel or