Add removeDataFromArrays.

Fix dataFilter to use transparams.
This commit is contained in:
sunwen
2023-05-25 16:19:08 +08:00
parent 5bd7a15238
commit 9837c425d1
8 changed files with 84 additions and 21 deletions

View File

@@ -8,6 +8,7 @@
#include "common/getGeometryInfo.h"
#include "common/dataBlockCreation/getAscanBlock.h"
#include "common/dataBlockCreation/blockingGeometryInfo.h"
#include "common/dataBlockCreation/removeDataFromArrays.h"
#include "Parser.h"
#include "MatlabReader.h"
@@ -328,3 +329,14 @@ TEST_F(Common_Test, blockingGeometryInfos) {
EXPECT_DOUBLE_AE(senderPositionBlock[i], result.senderPositionBlock[i]);
}
}
TEST_F(Common_Test, removeDataFromArrays) {
Aurora::Matrix a = Aurora::Matrix::fromRawData(new double[8]{1,2,3,4,5,6,7,8}, 1,8);
Aurora::Matrix b = Aurora::Matrix::fromRawData(new double[8]{0,0,1,1,1,1,0,0}, 1,8);
auto result = Recon::removeDataFromArrays(a, b);
EXPECT_DOUBLE_EQ(result.getDataSize(), 4);
EXPECT_DOUBLE_EQ(result[0], 3);
EXPECT_DOUBLE_EQ(result[1], 4);
EXPECT_DOUBLE_EQ(result[2], 5);
EXPECT_DOUBLE_EQ(result[3], 6);
}

View File

@@ -122,9 +122,7 @@ TEST_F(DataFilter_Test, filterReflectionData) {
auto senderPositionBlock = Aurora::transpose(Aurora::Matrix::fromRawData(new double[9]{-0.12,-0.12,-0.12,-0.01,-0.01,-0.01,0.03,0.03,0.03}, 3, 3));
auto senderNormalBlock = Aurora::transpose(Aurora::Matrix::fromRawData(new double[9]{0.99,0.99,0.99,0.10,0.10,0.10,0,0,0}, 3, 3));
int constrictReflectionAngles = 1;
double lowerAngle = 45;
double upperAngle = 360;
auto result = Recon::filterReflectionData(receiverPositionBlock, senderPositionBlock, senderNormalBlock, constrictReflectionAngles, lowerAngle, upperAngle);
auto result = Recon::filterReflectionData(receiverPositionBlock, senderPositionBlock, senderNormalBlock, constrictReflectionAngles);
EXPECT_EQ(3, result.getDataSize());
EXPECT_DOUBLE_AE(result[0],1);
EXPECT_DOUBLE_AE(result[1],1);