dimage.utils package

General utilities for dimage.

dimage.utils.memory(since=0.0)[source]

Return memory usage in bytes.

dimage.utils.resident(since=0.0)[source]

Return resident memory usage in bytes.

dimage.utils.shift(image, dx, dy, kernel='dampsinc', dampsinc=2.47, lanczos=2.0)[source]

Shifts image by non-integer amount. Interpolates using one of a set of specified kernels.

Parameters:

image : numpy.float32 array

2-D image to be shifted; is altered on return

dx, dy : numpy.float32

amount to shift images (pixels)

kernel : str

kernel to use in resampling (default ‘dampsinc’)

dampsinc : float

Gaussian scale used for ‘dampsinc’ (default 2.47)

lanczos : float

Lanczos scale parameter “a” for ‘lanczos’ (default 2)

Notes

Available kernels: ‘dampsinc’, ‘puresinc’, ‘bicubic’, ‘linear’, ‘lanczos’. Calls dshift.c in libdimage.so

dimage.utils.stacksize(since=0.0)[source]

Return stack size in bytes.

dimage.utils.wcssimple(ra, dec, size, pixscale)[source]

Create simple astropy WCS object, with TAN projection.

Parameters:

ra, dec : float

center of image (J2000 deg)

size : float

size of square image (deg)

pixscale : float

pixel scale (arcsec)

Returns:

(wcs, nx, ny) : (WCS, int, int)

WCS object and dimensions of image

Notes

Return North (+y), East (+x) image; no rotation.