diff options
Diffstat (limited to 'stwcs/wcsutil/headerlet.py')
-rw-r--r-- | stwcs/wcsutil/headerlet.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/stwcs/wcsutil/headerlet.py b/stwcs/wcsutil/headerlet.py index c26299c..5dacc30 100644 --- a/stwcs/wcsutil/headerlet.py +++ b/stwcs/wcsutil/headerlet.py @@ -20,6 +20,7 @@ import copy import time import numpy as np +import astropy from astropy.io import fits from astropy import wcs as pywcs from astropy.utils import lazyproperty @@ -34,12 +35,18 @@ from . import wcscorr from .hstwcs import HSTWCS from .mappings import basic_wcs +""" +``clobber`` parameter in `astropy.io.fits.writeto()`` was renamed to +``overwrite`` in astropy v1.3. +""" +from astropy.utils import minversion +ASTROPY_13_MIN = minversion(astropy, "1.3") + from astropy import log default_log_level = log.getEffectiveLevel() # Logging support functions - class FuncNameLoggingFormatter(logging.Formatter): def __init__(self, fmt=None, datefmt=None): if '%(funcName)s' not in fmt: @@ -2413,7 +2420,10 @@ class Headerlet(fits.HDUList): """ if not destim or not hdrname: self.hverify() - self.writeto(fname, clobber=clobber) + if ASTROPY_13_MIN: + self.writeto(fname, overwrite=clobber) + else: + self.writeto(fname, clobber=clobber) def _del_dest_WCS(self, dest, ext=None): """ |