sky_subtract

phrosty.imagesubtraction.sky_subtract(img, temp_dir=None)[source]

Subtracts background, found with Source Extractor.

Parameters:
  • img (snappl.image.Image) – Original image.

  • temp_dir (Path, default None) – Already-existing directory where we can write a temporary file. Defaults to photometry.snappl.temp_dir from the config.

Returns:

skysubim – skysubim is the sky-subtracted image. Its location on disk will be underneath temp_dir. It’s the caller’s responsibility to clean this up. The file will have been written, so you can pass skysubim.path to any thing that needs the path of a single-HDU FITS image.

detmask is the detection mask. Its location on disk will be underneath temp_dir. It’s the caller’s responsibility to clean this up. The file will have been written, so you can pass detmask.path to any thing that needs the path of a single-HDU FITS image.

skyrms is the median of the skyrms image calculated by source-extractor

Return type:

snappl.image.FITSImageOnDisk, detmask: snappl.image.FITSImageOnDisk, skyrms: float