Commits
Laszlo Szucs authored 775304384f9
1828 1828 | r_mask = mask_frac_rad * max(imsize[0], imsize[1]) * qaTool.convert(cell[0], 'arcsec')['value'] |
1829 1829 | |
1830 1830 | # Assume that the beam is 5 pixels wide if synthesized_beam is not provided |
1831 1831 | if beam is None: |
1832 1832 | beam = qaTool.convert(cell[0], 'arcsec')['value'] * 5.0 |
1833 1833 | else: |
1834 1834 | beam = qaTool.convert(beam['minor'], 'arcsec')['value'] |
1835 1835 | |
1836 1836 | new_niter_f = int(kappa / loop_gain * (r_mask / beam) ** 2 * residual_max / threshold_value) |
1837 1837 | new_niter = int(utils.round_half_up(new_niter_f, -int(np.log10(new_niter_f)))) |
1838 + | # Prevent 32 bit unsigned int overflow |
1839 + | new_niter = min(new_niter, 2 ** 32 - 1) |
1838 1840 | |
1839 1841 | if new_niter != old_niter: |
1840 1842 | LOG.info('niter heuristic: Modified niter from %d to %d based on mask vs. beam size heuristic' |
1841 1843 | '' % (old_niter, new_niter)) |
1842 1844 | |
1843 1845 | return new_niter |
1844 1846 | |
1845 1847 | def niter(self): |
1846 1848 | return None |
1847 1849 | |