Skip to content

Commit

Permalink
Merge fc8f932 into 695af6d
Browse files Browse the repository at this point in the history
  • Loading branch information
crawfordsm committed Jul 28, 2019
2 parents 695af6d + fc8f932 commit 5d2bcbb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -28,6 +28,8 @@ Other Changes and Additions

- Added support for .bz2, .Z and .zip file formats in ``ImageFileCollection``.

- Added warning that ``transform_image`` does not apply the transformation to the WCS [#684]

- Removed support for initializing ``ImageFileCollection`` from a table instead
of files. [#680]

Expand Down
13 changes: 10 additions & 3 deletions ccdproc/core.py
Expand Up @@ -2,10 +2,13 @@

"""This module implements the base CCDPROC functions"""

import math
import numbers
import logging

import numpy as np
import math
from scipy import ndimage

from astropy.units.quantity import Quantity
from astropy import units as u
from astropy.modeling import fitting
Expand All @@ -16,12 +19,12 @@
from astropy.utils import deprecated
import astropy # To get the version.

from scipy import ndimage

from .utils.slices import slice_from_string
from .log_meta import log_to_metadata
from .extern.bitfield import bitfield_to_boolean_mask as _bitfield_to_boolean_mask

logger = logging.getLogger(__name__)

__all__ = ['background_deviation_box', 'background_deviation_filter',
'ccd_process', 'cosmicray_median', 'cosmicray_lacosmic',
'create_deviation', 'flat_correct', 'gain_correct', 'rebin',
Expand Down Expand Up @@ -853,6 +856,10 @@ def transform_image(ccd, transform_func, **kwargs):
mask = transform_func(nccd.mask, **kwargs)
nccd.mask = mask > 0

if nccd.wcs is not None:
warn = 'WCS information may be incorrect as no transformation was applied to it'
logging.warning(warn)

return nccd


Expand Down
9 changes: 9 additions & 0 deletions ccdproc/tests/test_ccdproc.py
Expand Up @@ -573,6 +573,15 @@ def test_transform_isfunc(ccd_data):
with pytest.raises(TypeError):
transform_image(ccd_data, 1)

#test warning is issue if WCS information is available
def test_catch_transform_wcs_warning(ccd_data):

def tran(arr):
return 10 * arr

with catch_warnings() as w:
tran = transform_image(ccd_data, tran)


@pytest.mark.parametrize('mask_data, uncertainty', [
(False, False),
Expand Down

0 comments on commit 5d2bcbb

Please sign in to comment.