Skip to content

Commit d4ac8b3

Browse files
committed
Adjust number of divisors check
1 parent 0de0446 commit d4ac8b3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

factor/process.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,11 @@ def _set_up_bands(parset, test_run=False):
437437
sys.exit(1)
438438

439439
# Check that number of channels supports enough averaging steps
440-
if list(duplicate_chans)[0] not in [18, 20, 24]:
441-
log.warn('Number of channels per band is not 18, 20, or 24. Averaging will '
442-
'not work well (too few divisors)')
440+
nchans = list(duplicate_chans)[0]
441+
n_divisors = len([x+1 for x in range(nchans) if not nchans % (x+1)])
442+
if n_divisors < 5:
443+
log.warn('Number of channels per band is {}. Averaging will '
444+
'not work well (too few divisors)'.format(nchans))
443445

444446
# Determine whether any bands need to be run through the initsubract operation.
445447
# This operation is only needed if band lacks an initial skymodel or

0 commit comments

Comments
 (0)