Implement two-stage fitting method

Merged
#10 · Created  · Last updated

Merged pull request

Merged in global_CU_fit (pull request #10)

7e05e48·Author: ·Closed by: ·2022-06-13

Description

This is the change requested by the scientists. When we do a “polcal” fit the end goal is to get a demodulation matrix for every bin, but to do this we fit both the modulation matrix and the Calibration Unit (CU) parameters.

The Calibration Unit is constant across any instrument FOV (simplification, but OK) and this new fit method leverages that. The dkist-processing-pac API now requires two sets of input data:

  • A “global” set that is only a single bin

  • A “local” set that are all the bins we actually want demodulation matrices for

The idea is that the global set will be a larger average of the FOV and thus have better signal. This set is used to fit just the CU parameters. These best-fit values are then fixed in the next fit, which fits only modulation matrices to all the bins in the local data.

Hopefully I explained that OK, the online docs have been update to explain this, too.

Because we’re now doing two fits instead of one this PR introduces the FitObjects class, which is barely more than a dataclass. Each one holds all the objects needed for a single fit. Using these objects helps avoid copying the same block of code twice inside the fitter.

(Once this PR is merged I’ll update the target branch to main)

0 attachments

0 comments

Loading commits...