Added repeat option

Companion to https://github.com/astropy/astropy/pull/3019