Skip to content

Commit

Permalink
Adjust number of divisors check
Browse files Browse the repository at this point in the history
  • Loading branch information
darafferty committed Feb 17, 2016
1 parent 0de0446 commit d4ac8b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions factor/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d4ac8b3

Please sign in to comment.