Commits

Kumar Golap authored 428d63f7fc5
protect against a 1 channel chunk

code/synthesis/ImagerObjects/SynthesisImager.cc

Modified
1453 1453 CountedPtr<SIImageStore> imagestore,
1454 1454 Int chanchunks)
1455 1455 {
1456 1456 LogIO os(LogOrigin("SynthesisImager", "createChanChunkImageStoreList"));
1457 1457
1458 1458 Int extrachunks=0;
1459 1459 Int chunksize=imagestore->getShape()[3]/chanchunks;
1460 1460 Int rem=imagestore->getShape()[3] % chanchunks;
1461 1461 ///Avoid an extra chunk with 1 channel as it cause bumps in linear interpolation
1462 1462 ///See CAS-12625
1463 - while(rem==1){
1463 + while((rem==1) && (chunksize >1)){
1464 1464 chanchunks +=1;
1465 - chunksize=imagestore->getShape()[3]/chanchunks;
1466 - rem=imagestore->getShape()[3] % chanchunks;
1467 - }
1465 + chunksize=imagestore->getShape()[3]/chanchunks;
1466 + rem=imagestore->getShape()[3] % chanchunks;
1467 + }
1468 +
1468 1469
1469 1470
1470 1471 if( rem>0 )
1471 1472 {
1472 1473 // os << LogIO::WARN << "chanchunks ["+String::toString(chanchunks)+"] is not a divisor of nchan ["+String::toString(imagestore->getShape()[3])+"].";
1473 1474 // os << "Therefore, "+String::toString(imagestore->getShape()[3] % chanchunks)+" channel(s) at the end of the cube will be treated as an extra chunk." << LogIO::POST ;
1474 1475
1475 1476 if( rem < chunksize ) extrachunks=1;
1476 1477 else
1477 1478 {

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

Add shortcut