Skip to content
Snippets Groups Projects
Commit c84d1d5d authored by Joris van Zwieten's avatar Joris van Zwieten
Browse files

BugID: 825

- special case where the entire output domain lies 'to the left' of the first
sample in the input domain, or 'to the right' of the last sample of the input
domain now handled properly.
parent a3f64c6b
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <BBS/MNS/MeqMatrixTmp.h> #include <BBS/MNS/MeqMatrixTmp.h>
#include <Common/LofarLogger.h> #include <Common/LofarLogger.h>
#define MIN(__a, __b) __a <= __b ? __a : __b;
using namespace std; using namespace std;
using namespace casa; using namespace casa;
...@@ -132,7 +134,7 @@ namespace LOFAR ...@@ -132,7 +134,7 @@ namespace LOFAR
// first input cell. // first input cell.
if(outCenter < inCenter) if(outCenter < inCenter)
{ {
leftBoundaryCells = (int) ceil((inCenter - outCenter) / outScale.first); leftBoundaryCells = MIN((int) ceil((inCenter - outCenter) / outScale.first), outCount.first);
} }
// Compute the number of boundary cells on the right. This is the number of // Compute the number of boundary cells on the right. This is the number of
...@@ -140,7 +142,7 @@ namespace LOFAR ...@@ -140,7 +142,7 @@ namespace LOFAR
// last input cell. // last input cell.
if((outDomain.endX() - 0.5 * outScale.first) > (inDomain.endX() - 0.5 * inScale.first)) if((outDomain.endX() - 0.5 * outScale.first) > (inDomain.endX() - 0.5 * inScale.first))
{ {
rightBoundaryCells = (int) ceil(((outDomain.endX() - 0.5 * outScale.first) - (inDomain.endX() - 0.5 * inScale.first)) / outScale.first); rightBoundaryCells = MIN((int) ceil(((outDomain.endX() - 0.5 * outScale.first) - (inDomain.endX() - 0.5 * inScale.first)) / outScale.first), outCount.first);
} }
// Compute the values of the left boundary cells. A choice has to be made // Compute the values of the left boundary cells. A choice has to be made
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <BBS/MNS/MeqMatrixTmp.h> #include <BBS/MNS/MeqMatrixTmp.h>
#include <Common/LofarLogger.h> #include <Common/LofarLogger.h>
#define MIN(__a, __b) __a <= __b ? __a : __b;
using namespace std; using namespace std;
using namespace casa; using namespace casa;
...@@ -132,7 +134,7 @@ namespace LOFAR ...@@ -132,7 +134,7 @@ namespace LOFAR
// first input cell. // first input cell.
if(outCenter < inCenter) if(outCenter < inCenter)
{ {
leftBoundaryCells = (int) ceil((inCenter - outCenter) / outScale.first); leftBoundaryCells = MIN((int) ceil((inCenter - outCenter) / outScale.first), outCount.first);
} }
// Compute the number of boundary cells on the right. This is the number of // Compute the number of boundary cells on the right. This is the number of
...@@ -140,7 +142,7 @@ namespace LOFAR ...@@ -140,7 +142,7 @@ namespace LOFAR
// last input cell. // last input cell.
if((outDomain.endX() - 0.5 * outScale.first) > (inDomain.endX() - 0.5 * inScale.first)) if((outDomain.endX() - 0.5 * outScale.first) > (inDomain.endX() - 0.5 * inScale.first))
{ {
rightBoundaryCells = (int) ceil(((outDomain.endX() - 0.5 * outScale.first) - (inDomain.endX() - 0.5 * inScale.first)) / outScale.first); rightBoundaryCells = MIN((int) ceil(((outDomain.endX() - 0.5 * outScale.first) - (inDomain.endX() - 0.5 * inScale.first)) / outScale.first), outCount.first);
} }
// Compute the values of the left boundary cells. A choice has to be made // Compute the values of the left boundary cells. A choice has to be made
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment