Data objects
Cutout containers (CutoutData, MultiBandCutout) and the HDF5 (de)serialisation helpers used by the pipeline.
- exception sphot.data.DegenerateCutoutError[source]
Bases:
ValueErrorRaised when a CutoutData step cannot proceed because the cutout is too degenerate (e.g. mostly-NaN data, insufficient finite isophote samples, or a required intermediate attribute hasn’t been produced yet). Subclass of ValueError so existing except ValueError: handlers keep working; SLURM array tasks can catch this specifically to skip + record the cutout instead of aborting.
- class sphot.data.CutoutData(data=None, psf=None, psf_oversample=None, filtername=None, **kwargs)[source]
Bases:
object- determine_psf_blurring()[source]
determine the best PSF blurring value based on the number of stars detected
- init_size_guess(sigma_guess=10, center_slack=0.2, plot=False, sigma_kernel=5, clip_lower_counts_percentile=10, **kwargs)[source]
roughly estimate the effective radius using Gaussian profile.
- Parameters:
sigma_guess (float) – initial guess for the standard deviation of the Gaussian profile (in pixels)
center_slack (float) – the fraction of the image size (from center) within which the center of the galaxy is expected. Default is 5%
- Returns:
float – rough estimate of the effective radius (in pixels)
- class sphot.data.MultiBandCutout(name=None, **kwargs)[source]
Bases:
objecta container for CutoutData. Includes some useful methods for handling multiple bands of the same object.
- property images
- property image_list
- crop_in(x0, y0, size)[source]
crop-in and re-generate the MultiBandCutout object.
- Parameters:
multiband_obj (MultiBandCutout) – the object to crop in
x0,y0 (float) – the center of the new image
size (int) – the size of the new image (in pixels)
- Returns:
galaxy_crop (MultiBandCutout) – the cropped object
- sphot.data.read(filepath, **kwargs)[source]
a convenient wrapper for loading h5 files. It can load both sphot h5 files and raw data h5 files.
- sphot.data.load_h5data(filepath, name='', filters=[], psffile=None, psf_oversample=4)[source]
load raw data h5 file and turn it into a MultiBandCutout object.
- sphot.data.get_data_annulus(data, aper_r, plot=True, flatten=True)[source]
extract flattened data outside the annulus