Commits

Kumar Golap authored f84550f9e01
redo the weighting scheme for interpolation

code/synthesis/ImagerObjects/SynthesisImagerVi2.cc

Modified
480 480 void SynthesisImagerVi2::tuneChunk(const Int gmap){
481 481
482 482
483 483 CoordinateSystem cs=itsMappers.imageStore(gmap)->getCSys();
484 484 IPosition imshape=itsMappers.imageStore(gmap)->getShape();
485 485 /////For some reason imagestore returns 0 channel image sometimes
486 486 ////
487 487 if(imshape(3) < 1) {
488 488 return;
489 489 }
490 +
490 491 Double minFreq=SpectralImageUtil::worldFreq(cs, 0.0);
491 492 Double maxFreq=SpectralImageUtil::worldFreq(cs,imshape(3)-1);
492 493
493 494 if(maxFreq < minFreq){
494 495 Double tmp=minFreq;
495 496 minFreq=maxFreq;
496 497 maxFreq=tmp;
497 498 }
498 499
499 500 Int spectralIndex=cs.findCoordinate(Coordinate::SPECTRAL);
500 501 SpectralCoordinate spectralCoord=cs.spectralCoordinate(spectralIndex);
501 502 maxFreq+=fabs(spectralCoord.increment()(0))/2.0;
502 503 minFreq-=fabs(spectralCoord.increment()(0))/2.0;
503 504 if(minFreq < 0.0) minFreq=0.0;
504 505 MFrequency::Types intype=spectralCoord.frequencySystem(True);
505 506
506 507 if(!VisBufferUtil::getFreqRangeFromRange(minFreq, maxFreq, intype, minFreq, maxFreq, *vi_p, selFreqFrame_p)){
507 508 //Do not retune if conversion did not happen
508 509 return;
509 510 }
510 511
511 - maxFreq+=fabs(spectralCoord.increment()(0))/2.0;
512 - minFreq-=fabs(spectralCoord.increment()(0))/2.0;
512 + maxFreq+=3.0*fabs(spectralCoord.increment()(0))/2.0;
513 + minFreq-=3.0*fabs(spectralCoord.increment()(0))/2.0;
513 514 if(minFreq < 0.0) minFreq=0.0;
514 515
515 516 auto copyFreqBegs=freqBegs_p;
516 517 auto copyFreqEnds=freqEnds_p;
517 518 auto copyFreqSpws= freqSpws_p;
518 519 ///////////////TESTOO
519 520 //cerr << std::setprecision(12) << "AFTER maxFreq " << maxFreq << " minFreq " << minFreq << endl;
520 521 //for (Int k =0 ; k < (fselections_p->size()) ; ++k){
521 522 // cerr << k << (fselections_p->get(k)).toString() << endl;
522 523 // }
1273 1274
1274 1275 itsMappers.checkOverlappingModels("restore");
1275 1276 unlockMSs();
1276 1277
1277 1278 }// end of predictModel
1278 1279
1279 1280 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1280 1281 void SynthesisImagerVi2::makeSdImage(Bool dopsf)
1281 1282 {
1282 1283 LogIO os( LogOrigin("SynthesisImagerVi2","makeSdImage",WHERE) );
1284 +
1283 1285 // Bool dopsf=false;
1284 1286 if(datacol_p==FTMachine::PSF) dopsf=true;
1285 1287
1286 1288 {
1287 1289 vi::VisBuffer2* vb = vi_p->getVisBuffer();;
1288 1290 vi_p->originChunks();
1289 1291 vi_p->origin();
1290 1292
1291 1293 Double numberCoh=0;
1292 1294 for (uInt k=0; k< mss_p.nelements(); ++k)

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

Add shortcut