astropy:docs

transform_image

ccdproc.transform_image(ccd, transform_func, add_keyword=None, **kwargs)[source]

Transform the image

Using the function specified by transform_func, the transform will be applied to data, uncertainty, and mask in ccd.

Parameters:

ccd : CCDData

Data to be flatfield corrected

transform_func : function

Function to be used to transform the data

kwargs: dict

Dictionary of arguments to be used by the transform_func.

add_keyword : str, Keyword or dict-like, optional

Item(s) to add to metadata of result. Set to None to completely disable logging. Default is to add a dictionary with a single item: the key is the name of this function and the value is a string containing the arguments the function was called with, except the value of this argument.

Returns:

ccd : CCDData

A transformed CCDData object

Notes

At this time, transform will be applied to the uncertainy data but it will only transform the data. This will not properly handle uncertainties that arise due to correlation between the pixels.

These should only be geometric transformations of the images. Other methods should be used if the units of ccd need to be changed.

Examples

Given an array that is 100x100,

>>> import numpy as np
>>> from astropy import units as u
>>> arr1 = CCDData(np.ones([100, 100]), unit=u.adu)

the syntax for transforming the array using scipy.ndimage.interpolation.shift

>>> from scipy.ndimage.interpolation import shift
>>> transformed = transform(arr1, shift, shift=(5.5, 8.1))

Page Contents