fit_distortion_series#

esis.optics.fit_distortion_series(instrument, scenes, observations, grids, parameters=None, pupil=None, axis_wavelength=None, axis_field=None, axis_channel=None, coherent=False, smoothing=None, sigma_psf=1.0, seed=0, tolerance=None, num_repeat=8, directory=None, workers=1)[source]#

Fit a time series of frames with fit_distortion_scan().

Every frame is fit independently, starting from the same parameters (for example the best fit of a reference frame) rather than warm-starting from the previous frame: independent fits cannot accumulate drift from one bad frame, make the per-frame results directly comparable, and parallelize perfectly.

Parameters:
  • instrument (AbstractInstrument) – The instrument model to fit.

  • scenes (Sequence[FunctionArray]) – The per-frame scenes, one for each observation.

  • observations (Sequence[AbstractScalar]) – The per-frame observed images, in time order.

  • grids (Sequence[dict[str, Quantity]]) – The scan schedule applied to every frame. See fit_distortion_scan().

  • parameters (None | DistortionParameters) – The starting point shared by every frame. If None, the current parameters of instrument are used.

  • pupil (None | AbstractCartesian2dVectorArray) – The vertices of the pupil grid used to image the scenes.

  • axis_wavelength (None | str) – The logical axis of the scenes corresponding to changing wavelength.

  • axis_field (None | tuple[str, str]) – The logical axes of the scenes corresponding to changing field position.

  • axis_channel (None | str) – The logical axis of the observations corresponding to changing camera channel. See fit_distortion_scan().

  • coherent (bool) – If True, every channel receives the same offset (a rigid-payload model). See fit_distortion_scan().

  • smoothing (None | int) – The width, in detector pixels, of a box filter applied to both images before comparing.

  • sigma_psf (None | float) – The standard deviation, in detector pixels, of a Gaussian point-spread function convolved with the modeled image only. See DistortionResidual.sigma_psf.

  • seed (int) – The seed used to make each evaluation deterministic.

  • tolerance (None | float) – If given, the last round of grids is repeated for each frame until the mean correlation improves by less than this amount. See fit_distortion_scan().

  • num_repeat (int) – The maximum number of extra polish rounds appended when tolerance is given.

  • directory (None | Path) – A directory under which each frame’s fit is logged in a frame_NNN subdirectory. If None, the fits are not logged.

  • workers (int) – The number of processes used to fit frames concurrently. A value of 1 fits the frames serially in the current process.

Return type:

list[DistortionParameters]