Commits

Dirk Petry authored 43d3ff0fa79
CAS-14218: fixed an old bug in the time interpolation of the dtdl coefficients.

The interpolation formula was multiplying the previous and the next (in time) coefficent with swapped factors.

casatools/src/code/air_casawvr/src/apps/dtdlcoeffs.cc

Modified
252 252 return;
253 253 }
254 254
255 255 prev=next;
256 256 prev--;
257 257
258 258
259 259 //Finally if not before beginning or after end, interpolate
260 260 //linearly
261 261
262 - double c_f=(time-prev->time)/(next->time-prev->time);
263 - double c_s=(next->time-time)/(next->time-prev->time);
262 + double c_f=(time - prev->time)/(next->time - prev->time);
263 + double c_s=(next->time - time)/(next->time - prev->time);
264 264
265 265 for(size_t k=0; k<4; ++k)
266 266 {
267 - res[k]= c_f*(prev->coeffs[k]) + c_s*(next->coeffs[k]);
267 + res[k]= c_s*(prev->coeffs[k]) + c_f*(next->coeffs[k]);
268 268 res[k]*= chmask[k];
269 - c2[k]= c_f*(prev->c2[k]) + c_s*(next->c2[k]);
269 + c2[k]= c_s*(prev->c2[k]) + c_f*(next->c2[k]);
270 270 }
271 271 }
272 272
273 273 void dTdLCoeffsSingleInterpolated::print(std::ostream &os)
274 274 {
275 275 for(std::set<ret_t>::const_iterator i=retrievals.begin();
276 276 i!=retrievals.end();
277 277 ++i)
278 278 {
279 279 char tstr[120];

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut