fit_distortion_reference#

esis.flights.f1.optics.fit_distortion_reference(instrument=None, time=15, num_scene=401, grids=None, sigma_psf=1.0, seed=0, tolerance=0.0003, path=None, directory=None)[source]#

Fit the per-channel reference distortion parameters from scratch.

Reproduces (and lets anyone verify) the fit stored in _data/distortion_reference.ecsv: all nine per-channel degrees of freedom of esis.optics.DistortionParameters are fit to one Level-1 frame with esis.optics.fit_distortion_scan(), reading every channel’s peak from a single pass of coherent scans.

Expect several thousand merit evaluations at a few seconds each: hours of runtime on a workstation. Requires the ESIS Level-1 data and the AIA synthetic scene (downloaded and cached on first use).

Parameters:
  • instrument (None | Instrument) – The starting instrument model. If None, the as-built model (esis.flights.f1.optics.as_built(), which carries the measured grating radii and ruling density) is used, idealized for raytracing speed.

  • time (int) – The frame index of the reference frame.

  • num_scene (int) – The number of samples along each axis of the resampled AIA scene.

  • grids (None | list[dict]) – The scan schedule. If None, the from-scratch schedule (wide joint capture rounds, shrinking refinement, repeated polish) is used.

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

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

  • tolerance (None | float) – The mean-correlation gain below which the repeated polish round stops.

  • path (None | str | Path) – If given, the fitted parameters are written to this path as an ECSV table, in the format of _data/distortion_reference.ecsv.

  • directory (None | str | Path) – A directory where the scan curves and convergence history are logged. If None, the fit is not logged.

Return type:

DistortionParameters

Examples

import esis

parameters = esis.flights.f1.optics.fit_distortion_reference(
    path="distortion_reference.ecsv",
    directory="distortion_reference_scan",
)