stacked_seds.stacking
This module provides functions for creating and stacking galaxy image cutouts.
Functions
|
Reads a FITS image header and a region file to get galaxy pixel coordinates. |
|
Creates cutout stamps for each coordinate in the pixel coordinate array. |
|
Stacks a set of image stamps using a trimmed mean and calculates the error. |
|
Saves the stacked data and error map to a new FITS file. |
Detailed API
- stacked_seds.stacking.get_galaxy_pixel_coords(image_path, region_path)[source]
Reads a FITS image header and a region file to get galaxy pixel coordinates.
- stacked_seds.stacking.create_stamps(image_data, wcs_obj, pixel_coords, stamp_size=51)[source]
Creates cutout stamps for each coordinate in the pixel coordinate array.
- Parameters:
image_data (np.ndarray) – The 2D FITS image data.
wcs_obj (wcs.WCS) – The World Coordinate System object from the FITS header.
pixel_coords (np.ndarray) – Array of (x, y) pixel coordinates.
stamp_size (int) – The edge length of the square stamp in pixels.
- Returns:
A 3D array of all valid (correctly sized) stamps.
- Return type:
np.ndarray
- stacked_seds.stacking.stack_images(stamps, trim_fraction=0.1)[source]
Stacks a set of image stamps using a trimmed mean and calculates the error.