phoptic.fitting.routines

Functions

fit_rms_vs_flux(data)

Iteratively fit a straight line (in log space) to the RMS vs flux plots for each catalog. This can be used to

fit_psf(image, x_init, y_init, semimajor_axis, ...)

Find the location of a source by fitting a Gaussian PSF to an image.

Module Contents

phoptic.fitting.routines.fit_rms_vs_flux(data)

Iteratively fit a straight line (in log space) to the RMS vs flux plots for each catalog. This can be used to identify variable sources and good comparison sources.

Parameters

dataDict

The RMS vs flux data.

Returns

Dict[str, Dict[str, NDArray]]

The power law fits for each filter {filter: {‘flux’: NDArray, ‘rms’: NDArray}}.

Parameters:

data (Dict)

Return type:

Dict[str, Dict[str, numpy.typing.NDArray]]

phoptic.fitting.routines.fit_psf(image, x_init, y_init, semimajor_axis, semiminor_axis)

Find the location of a source by fitting a Gaussian PSF to an image.

Parameters

imageNDArray

The image. Should be a small region of a larger image to ensure the correct source is found.

x_initfloat | int

The initial guess for the x location of the PSF.

y_initfloat | int

The initial guess for the y location of the PSF.

semimajor_axisfloat

The semi-major axis of the PSF.

semiminor_axisfloat

The semi-minor axis of the PSF.

Returns

tuple[float, float, float]

The best-fitting x position, y position, and orientation of the PSF.

Parameters:
  • image (numpy.typing.NDArray)

  • x_init (float | int)

  • y_init (float | int)

  • semimajor_axis (float)

  • semiminor_axis (float)

Return type:

tuple[float, float, float]