opticam.background.local_background

Classes

BaseLocalBackground

Base class for local background estimators.

DefaultLocalBackground

Default local background estimator using an elliptical annulus.

Module Contents

class opticam.background.local_background.BaseLocalBackground(r_in_scale=5, r_out_scale=7.5, sigma_clip=SigmaClip(sigma=3, maxiters=10))

Bases: abc.ABC

Base class for local background estimators.

Parameters:
  • r_in_scale (float)

  • r_out_scale (float)

  • sigma_clip (None | astropy.stats.SigmaClip)

r_in_scale = 5
r_out_scale = 7.5
sigma_clip
abstractmethod __call__(data, error, position, semimajor_axis, semiminor_axis, theta)

Compute the local background and its error at a given position (per pixel).

Parameters

dataNDArray

The image data.

errorNDArray

The error in the image data.

semimajor_axisfloat

The (unscaled) semi-major axis of the aperture.

semiminor_axisfloat

The (unscaled) semi-minor axis of the aperture.

thetafloat

The rotation angle of the PSF.

positionTuple[float, float]

The x, y position at which to compute the local background.

Returns

Tuple[float, float]

The local background and its error per pixel.

Parameters:
  • data (numpy.typing.NDArray)

  • error (numpy.typing.NDArray)

  • position (numpy.typing.NDArray)

  • semimajor_axis (float)

  • semiminor_axis (float)

  • theta (float)

Return type:

Tuple[float, float]

class opticam.background.local_background.DefaultLocalBackground(r_in_scale=5, r_out_scale=7.5, sigma_clip=SigmaClip(sigma=3, maxiters=10))

Bases: BaseLocalBackground

Default local background estimator using an elliptical annulus.

Parameters:
  • r_in_scale (float)

  • r_out_scale (float)

  • sigma_clip (None | astropy.stats.SigmaClip)

__call__(data, error, position, semimajor_axis, semiminor_axis=None, theta=0.0)

Compute the local background and its error at a given position (per pixel).

Parameters

dataNDArray

The image data.

errorNDArray

The error in the image data.

positionArrayLike[float, float]

The x, y position at which to compute the local background.

semimajor_axisfloat

The (unscaled) semimajor axis of the aperture.

semiminor_axisfloat | None, optional

The (unscaled) semiminor axis of the aperture, by default None. If None, it is assumed to be equal to the semimajor axis (i.e., the aperture is circular).

thetafloat, optional

The rotation angle of the PSF, by default 0.0 (i.e., no rotation).

Returns

Tuple[float, float]

The local background and its error per pixel.

Parameters:
  • data (numpy.typing.NDArray)

  • error (numpy.typing.NDArray)

  • position (numpy.typing.NDArray)

  • semimajor_axis (float)

  • semiminor_axis (float | None)

  • theta (float)

Return type:

Tuple[float, float]