Images (pyobs.images)

Some info about pyobs.images.Image.

Image

class Image(data: Optional[numpy.ndarray[Any, numpy.dtype[Any]]] = None, header: Optional[astropy.io.fits.header.Header] = None, mask: Optional[numpy.ndarray[Any, numpy.dtype[Any]]] = None, uncertainty: Optional[numpy.ndarray[Any, numpy.dtype[Any]]] = None, catalog: Optional[astropy.table.table.Table] = None, meta: Optional[Dict[Any, Any]] = None, *args: Any, **kwargs: Any)

Image class.

Init a new image.

Parameters:
  • data – Numpy array containing data for image.

  • header – Header for the new image.

  • mask – Mask for the image.

  • uncertainty – Uncertainty image.

  • catalog – Catalog table.

  • meta – Dictionary with meta information (note: not preserved in I/O operations!).

Image Processors (pyobs.images.processors)

Astrometry

class Astrometry(**kwargs: Any)

Base class for astrometry processors

Init new image processor.

class AstrometryDotNet(url: str, source_count: int = 50, radius: float = 3.0, timeout: int = 10, **kwargs: Any)

Perform astrometry using astrometry.net

Init new astronomy.net processor.

Parameters:
  • url – URL to service.

  • source_count – Number of sources to send.

  • radius – Radius to search in.

  • timeout – Timeout in seconds for call to astrometry web service.

Source Detection

class DaophotSourceDetection(fwhm: float = 3.0, threshold: float = 4.0, bkg_sigma: float = 3.0, bkg_box_size: Tuple[int, int] = (50, 50), bkg_filter_size: Tuple[int, int] = (3, 3), **kwargs: Any)

Detect source using Daophot.

Initializes a wrapper for photutils. See its documentation for details.

Parameters:
  • fwhm – Full-width at half maximum for Gaussian kernel.

  • threshold – Threshold pixel value for detection.

  • bkg_sigma – Sigma for background kappa-sigma clipping.

  • bkg_box_size – Box size for background estimation.

  • bkg_filter_size – Filter size for background estimation.

class SepSourceDetection(threshold: float = 1.5, minarea: int = 5, deblend_nthresh: int = 32, deblend_cont: float = 0.005, clean: bool = True, clean_param: float = 1.0, **kwargs: Any)

Detect sources using SEP.

Initializes a wrapper for SEP. See its documentation for details.

Highly inspired by LCO’s wrapper for SEP, see: https://github.com/LCOGT/banzai/blob/master/banzai/photometry.py

Parameters:
  • threshold – Threshold pixel value for detection.

  • minarea – Minimum number of pixels required for detection.

  • deblend_nthresh – Number of thresholds used for object deblending.

  • deblend_cont – Minimum contrast ratio used for object deblending.

  • clean – Perform cleaning?

  • clean_param – Cleaning parameter (see SExtractor manual).

class SourceDetection(**kwargs: Any)

Base class for source detection.

Init new image processor.

Exposure Time estimators

class ExpTimeEstimator(min_exp_time: float = 0.0, max_exp_time: Optional[float] = None, **kwargs: Any)

Estimate exposure time.

Init new exposure time estimator.

class StarExpTimeEstimator(source_detection: Union[Dict[str, Any], pyobs.images.processors.detection.SourceDetection], edge: float = 0.1, bias: float = 0.0, saturated: float = 0.7, **kwargs: Any)

Estimate exposure time from a star.

Create new exp time estimator from single star.

Parameters:
  • source_detection – Source detection to use.

  • edge – Fraction of image to ignore at each border.

  • bias – Bias level of image.

  • saturated – Fraction of saturation that is used as brightness limit.

Misc

class AddMask(masks: Dict[str, Dict[str, Union[numpy.ndarray[Any, numpy.dtype[Any]], str]]], **kwargs: Any)

Add mask to image.

Init an image processor that adds a mask to an image.

Parameters:

masks – Dictionary containing instrument->binning->mask, with binning as string, e.g. ‘1x1’.

class Broadcast(filename: str = '/cache/processed_{ORIGNAME}', **kwargs: Any)

Broadcast image.

Init an image processor that broadcasts an image

Parameters:

filename – Filename to broadcast image.

class Calibration(archive: Union[Dict[str, Any], pyobs.utils.archive.Archive], max_cache_size: int = 20, max_days_bias: Optional[float] = None, max_days_dark: Optional[float] = None, max_days_flat: Optional[float] = None, **kwargs: Any)

Calibrate an image.

Init a new image calibration pipeline step.

Parameters:

archive – Archive to fetch calibration frames from.

class CreateFilename(pattern: str, **kwargs: Any)

Formats the filename for an image and stores it in FNAME.

Init an image processor that adds a filename to an image.

Parameters:

pattern – Filename pattern.

class RemoveBackground(sigma: float = 3.0, box_size: Tuple[int, int] = (50, 50), filter_size: Tuple[int, int] = (3, 3), **kwargs: Any)

Remove background from image.

Init an image processor that removes background from image.

Parameters:
  • sigma – Sigma for clipping

  • box_size – Box size for bkg estimation.

  • filter_size – Size of filter.

class SoftBin(binning: int = 2, **kwargs: Any)

Bin an image.

Init a new software binning pipeline step.

Parameters:

binning – Binning to apply to image.

Offsets

class Offsets(**kwargs: Any)

Base class for determining offsets.

Init new image processor.

class ProjectedOffsets(**kwargs: Any)

An auto-guiding system based on comparing collapsed images along the x&y axes with a reference image.

Initializes a new auto guiding system.

Source extraction

class PhotUtilsPhotometry(threshold: float = 1.5, minarea: int = 5, deblend_nthresh: int = 32, deblend_cont: float = 0.005, clean: bool = True, clean_param: float = 1.0, **kwargs: Any)

Perform photometry using PhotUtils.

Initializes an aperture photometry based on PhotUtils.

Parameters:
  • threshold – Threshold pixel value for detection.

  • minarea – Minimum number of pixels required for detection.

  • deblend_nthresh – Number of thresholds used for object deblending.

  • deblend_cont – Minimum contrast ratio used for object deblending.

  • clean – Perform cleaning?

  • clean_param – Cleaning parameter (see SExtractor manual).

  • *args

  • **kwargs

class Photometry(**kwargs: Any)

Base class for photometry processors.

Init new image processor.

class SepPhotometry(threshold: float = 1.5, minarea: int = 5, deblend_nthresh: int = 32, deblend_cont: float = 0.005, clean: bool = True, clean_param: float = 1.0, **kwargs: Any)

Perform photometry using SEP.

Initializes a wrapper for SEP. See its documentation for details.

Highly inspired by LCO’s wrapper for SEP, see: https://github.com/LCOGT/banzai/blob/master/banzai/photometry.py

Parameters:
  • threshold – Threshold pixel value for detection.

  • minarea – Minimum number of pixels required for detection.

  • deblend_nthresh – Number of thresholds used for object deblending.

  • deblend_cont – Minimum contrast ratio used for object deblending.

  • clean – Perform cleaning?

  • clean_param – Cleaning parameter (see SExtractor manual).

  • *args

  • **kwargs