Open adokter opened 6 years ago
NB: radial functions that have a sum of the fundamental and overtone are nonlinear:
fundamental: y_0 = baseline + u_0 sin(phi) + v_0 cos(phi)
1st overtone: y_1 = baseline + u_1 sin(2 phi) + v_1 cos(2 phi)
with phi
the azimuth
In addition we have the boundary condition that the phases of the two components are equal, i.e. u_1/v_1=u_0/v_0
, which for the function y=y_0+y_1
introduces products between fit parameters.
Therefore, easiest to implement a separate fit of either y_0
or y_1
to the radial data
Prototype functionality added by commit a3db9ce8895b85a37f18efac026313b074e73b31
Still to complete:
Proposed approach:
libsvdfit.c
that essentially describes a sine curve, i.e. a simplification of the vvp functionsvdfit
accept a function as argument, as in legacy vol2bird versionsfloat svdfit(float x,int Ndx,float y[],float yfit[],int Npnt, int (funcs)(float x[],int Ndx,float afunc[],int Npar), float apar[],float avar[],int Npar) { //body goes here }