twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

Calibration fit statistic displays wrong coefficient #64

Closed twVolc closed 8 months ago

twVolc commented 1 year ago

The plot in DOAS FOV alignment that displays "1st order coefficient" and "R-squared" is displaying the wrong polynomial coefficient for "1st order coefficient". For the line y=mx+c this should be showing m but it's currently showing c and makes it looks like the calibration line is changing quite dramatically. c should generally be close to the origin, so has very little affect on the calibration.

twVolc commented 1 year ago

This relates to #16, but from what I can see in the plot there it looks like it probably has the correct coefficient. Perhaps it got changed at some point? #64 fig You can see from this figure the coefficient goes below 0 at some points - the slope didn't ever reverse direction, this is definitely plotting c not m.

twVolc commented 1 year ago

Somewhat (but not completely) related to this. The saved coefficients are currently ordered as coeff 0 = m and coeff 1 = c. This doesn't make compatibility with 2nd-order polynomials as straightforward - i think it makes more sense to have the number of the coeff relate to the order of that coefficient, so Coeff 0 is the constant c, Coeff 1 is the 1st-order m, Coeff 2 would be x^2 and so on. This might require some painful rearranging of PyplisWorker.fit_data and coef_headers in PyplisWorker.save_calibration(), but hopefully it's not too much hassle.

NOTE: If this is implemented I will need to revise PyplisWorker.calibrate_image(), which I'm currently editing to be able to work with preloaded calibration data.