Astronomical Stacking Functions

stackypy.detect_object(img, blur_size=2)[source]

Extracts information of the object detected at the center of the image.

Objects are detected applying a threshold, the one at the center is picked, approximating it as a (possibily rotated) ellipse.

Args:
img : numpy.ndarray
Astronomical data cube.
blur_size: int
Size of the gaussian filter applied to the image to detect the objects.
Returns:
properties : tuple or None
Tuple with properties of the object found at the center of the image (centroid_x,*centroid_y*,*angle*,*major_ratio*,*minor_ratio*). None when no object was found at the center.
detection_mask:
Image labeled with the detected objects, may be used for debug.
stackypy.stack_to_template(images, interp_order=1, blur_size=2)[source]

Detects the central objects on a series of images, then scales and rotates these images so that all the central objects detected overlap on the same position as the one in images[0]. Images are then averaged together to create a final one.

Objects are detected with the detect_object function.

Args:
images : list of numpy.ndarray’s
List of astronomical data cubes
interp_order : int
Order of interpolation used when rotating and scaling the images.
blur_size: int
Magnitude of the gaussian blur passed to the detect_object function.
Returns:
properties : tuple or None
Tuple with properties of the object found at the center of the image (centroid_x,*centroid_y*,*angle*,*major_ratio*,*minor_ratio*). None when no object was found at the center.
detection_mask: numpy.ndarray
Image labeled with the detected objects, may be used for debug.