%% Polynomial coeffs: rk18cj RA_C_COH.TXT, first five 60sec entries of 09h15m00s % note: coeff[0] is decreasing over time pasc = [ ... -5.29984887176669e-001, -1.96454687067593e-006, 1.85328710728925e-011 , -3.01817847159214e-016, 5.74377650996993e-018 , -6.07937839609482e-020, ; ... -5.30102693306349e-001, -1.96232496373719e-006, 1.85555173465275e-011 , -2.19503121723363e-015, 4.07475058417095e-017 , -2.78708449114734e-019, ; ... -5.30220366164240e-001, -1.96010421780254e-006, 1.84762339949316e-011 , 7.46556090724937e-016 , -1.48916538822430e-017, 9.21925568655654e-020 , ; ... -5.30337905860571e-001, -1.95788627521064e-006, 1.85030974265885e-011 , -9.44292764870625e-016, 1.19986440505482e-017 , -5.64518658598481e-020, ; ... -5.30455312517212e-001, -1.95566956575103e-006, 1.84658921197638e-011 , 2.38752724257552e-017 , -6.19718321104301e-018, 6.16837324491151e-020 ... ]; dly_asc = pasc(:,1); Omax = size(pasc,2); Npoly = size(pasc,1); %% Polynomial coeffs: CALC9 open loop % note: coeff[0] is increasing over time, different handedness of orbit def!? pimcalc = 1e-6 * [ -4.5196742092676104e+04 1.9639874141880278e+00 -1.8389322086157454e-05 -6.1578438808965313e-09 1.1576330383545911e-10 -7.5728528767132050e-13 ; ... -4.5078969468051233e+04 1.9617663603403446e+00 -1.8562676327999518e-05 2.5473471123962666e-09 -4.7158677511727829e-11 3.1019795785507644e-13 ; ... -4.4961330131805145e+04 1.9595453712583548e+00 -1.8503161881097996e-05 1.0225369631959721e-09 -2.2634382708311673e-11 1.5866692200320440e-13 ; ... -4.4843823970006633e+04 1.9573264558150185e+00 -1.8407443530190058e-05 -3.5572436080447913e-09 7.0389375169911812e-11 -4.6755368971389112e-13 ; ... -4.4726450869142507e+04 1.9551101523382386e+00 -1.8465719066356280e-05 5.9795416903990478e-11 -8.3890827544173032e-14 5.0210711980439231e-15 ... ]; %% Polynomial coeffs: raPatchClosedloop.py based merge of DiFX CALC9 and ASC RA_C_COH.TXT, scan 2 % ./raPatchClosedloop.py -r 2.4886e-06 RA_C_COH.TXT RA_C_COH_uvw.txt rk18cj_2.im, method 2 pimclosed = 1e-6 * [ ... % newcoeffs[0] = baseOffsets[sourcenr][0] + baseOffsets[sourcenr][1] -45196.742092676104, 1.96454438207593, -1.85328710728925e-05, 3.01817847159214e-10, -5.74377650996993e-12, 6.079378396094819e-14 ; ... -45314.54807529144, 1.96232247513719, -1.85555173465275e-05, 2.1950312172336298e-09, -4.07475058417095e-11, 2.7870844911473403e-13 ; ... -45432.2207866999, 1.96010172920254, -1.84762339949316e-05, -7.46556090724937e-10, 1.4891653882243002e-11, -9.21925568655654e-14 ; ... -45549.76033606065, 1.9578837866106398, -1.85030974265885e-05, 9.442927648706249e-10, -1.1998644050548199e-11, 5.6451865859848094e-14 ; ... -45667.16684446821, 1.95566707715103, -1.8465892119763798e-05, -2.38752724257552e-11, 6.19718321104301e-12, -6.168373244911509e-14 ... ]; pimclosed = 1e-6 * [ ... % newcoeffs[0] = baseOffsets[sourcenr][0] + sign*baseOffsets[sourcenr][1] -45196.742092676104, 1.96454438207593, -1.85328710728925e-05, 3.01817847159214e-10, -5.74377650996993e-12, 6.079378396094819e-14 ; ... -45078.93611006077, 1.96232247513719, -1.85555173465275e-05, 2.1950312172336298e-09, -4.07475058417095e-11, 2.7870844911473403e-13 ; ... -44961.26339865231, 1.96010172920254, -1.84762339949316e-05, -7.46556090724937e-10, 1.4891653882243002e-11, -9.21925568655654e-14 ; ... -44843.72384929156, 1.9578837866106398, -1.85030974265885e-05, 9.442927648706249e-10, -1.1998644050548199e-11, 5.6451865859848094e-14 ; ... -44726.317340884 , 1.95566707715103, -1.8465892119763798e-05, -2.38752724257552e-11, 6.19718321104301e-12, -6.168373244911509e-14 ... ]; % Eval points per poly N = 8000; t = linspace(0,60,N); %% Plotting of a few poly entries to check continuity figure(3), clf; subplot (3,3,1), for pn=1:Npoly, y = polyval(fliplr(pasc(pn,:)), t); plot(t + (pn-1)*60, y), hold on; end title('ASC poly'); xlabel('Time (s)'), ylabel('Delay (usec)'); subplot (3,3,4), for pn=1:Npoly, ybaseline = polyval(fliplr(pasc(1,1:2)), t + (pn-1)*60); y = polyval(fliplr(pasc(pn,:)), t); ydiff = y - ybaseline; plot(t + (pn-1)*60, ydiff), hold on; end title('ASC quadratic and higher terms'); xlabel('Time (s)'), ylabel('Delay minus linear (usec)'); subplot (3,3,7), for pn=1:Npoly, ybaseline = polyval(fliplr(pasc(1,1:3)), t + (pn-1)*60); y = polyval(fliplr(pasc(pn,:)), t); ydiff = y - ybaseline; plot(t + (pn-1)*60, ydiff), hold on; end title('ASC cubic and higher terms'); xlabel('Time (s)'), ylabel('Delay minus quadratic (usec)'); subplot (3,3,2), for pn=1:Npoly, y = polyval(fliplr(pimcalc(pn,:)), t); plot(t + (pn-1)*60, y), hold on; end title('CALC9 initial poly'); xlabel('Time (s)'); subplot (3,3,5), for pn=1:Npoly, ybaseline = polyval(fliplr(pimcalc(1,1:2)), t + (pn-1)*60); y = polyval(fliplr(pimcalc(pn,:)), t); ydiff = y - ybaseline; plot(t + (pn-1)*60, ydiff), hold on; end title('CALC9 quadratic and higher terms'); xlabel('Time (s)'); subplot (3,3,8), for pn=1:Npoly, ybaseline = polyval(fliplr(pimcalc(1,1:3)), t + (pn-1)*60); y = polyval(fliplr(pimcalc(pn,:)), t); ydiff = y - ybaseline; plot(t + (pn-1)*60, ydiff), hold on; end title('CALC9 cubic and higher terms'); xlabel('Time (s)'); subplot (3,3,3), for pn=1:Npoly, y = polyval(fliplr(pimclosed(pn,:)), t); plot(t + (pn-1)*60, y), hold on; end title('raPatchClosedloop poly'); xlabel('Time (s)'); subplot (3,3,6), for pn=1:Npoly, ybaseline = polyval(fliplr(pimclosed(1,1:2)), t + (pn-1)*60); y = polyval(fliplr(pimclosed(pn,:)), t); ydiff = y - ybaseline; plot(t + (pn-1)*60, ydiff), hold on; end title('quadratic and higher terms'); xlabel('Time (s)'); subplot (3,3,9), for pn=1:Npoly, ybaseline = polyval(fliplr(pimclosed(1,1:3)), t + (pn-1)*60); y = polyval(fliplr(pimclosed(pn,:)), t); ydiff = y - ybaseline; plot(t + (pn-1)*60, ydiff), hold on; end title('cubic and higher terms'); xlabel('Time (s)');