Skip to content

Commit

Permalink
Merge pull request #229 from bsipocz/aper_fix_new_nddata_compatibility
Browse files Browse the repository at this point in the history
Decorating aperture_photometry() with support_nddata
  • Loading branch information
cdeil committed Jan 5, 2015
2 parents 26ac2a9 + 62b564f commit 26ed0a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions photutils/aperture_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@
from astropy import __version__ as astropy_version
if version.LooseVersion(astropy_version) > version.LooseVersion('1.0'):
from astropy.wcs.utils import skycoord_to_pixel
from astropy.nddata import support_nddata
skycoord_to_pixel_mode = 'all'
else:
from .extern.wcs_utils import skycoord_to_pixel
skycoord_to_pixel_mode = 'wcs'

def support_nddata(_func):
return _func


__all__ = ['Aperture', 'SkyAperture', 'PixelAperture',
'SkyCircularAperture', 'CircularAperture',
Expand Down Expand Up @@ -1145,6 +1149,7 @@ def do_photometry(self, data, error=None, effective_gain=None,
return flux


@support_nddata
def aperture_photometry(data, apertures, unit=None, wcs=None, error=None,
effective_gain=None, mask=None, method='exact',
subpixels=5, pixelwise_error=True):
Expand Down Expand Up @@ -1229,7 +1234,14 @@ def aperture_photometry(data, apertures, unit=None, wcs=None, error=None,
The metadata of the table stores the version numbers of both astropy
and photutils, as well as the calling arguments.
Notes
-----
This function is decorated with `~astropy.nddata.support_nddata` and
thus supports `~astropy.nddata.NDData` objects as input for Astropy
version >=1.0.
"""

dataunit = None
datamask = None
wcs_transformation = wcs
Expand Down

0 comments on commit 26ed0a7

Please sign in to comment.