From d0c95811a73fd9b2bdf7c45650e5be9efc64d0dc Mon Sep 17 00:00:00 2001 From: sunwen Date: Fri, 19 May 2023 17:32:31 +0800 Subject: [PATCH] Start getTransmissionData. --- src/common/getGeometryInfo.h | 1 + .../extractTasTemperature.cpp | 66 +++++++++++++++++++ .../extractTasTemperature.h | 20 ++++++ src/config/config.h | 4 +- .../dataFilter/sensitivityCalculations.cpp | 2 +- .../dataFilter/sensitivityCalculations.h | 13 +--- .../detection/getTransmissionData.cpp | 33 ++++++++++ .../detection/getTransmissionData.h | 17 +++++ 8 files changed, 142 insertions(+), 14 deletions(-) create mode 100644 src/common/temperatureCalculation/extractTasTemperature.cpp create mode 100644 src/common/temperatureCalculation/extractTasTemperature.h create mode 100644 src/transmissionReconstruction/detection/getTransmissionData.cpp create mode 100644 src/transmissionReconstruction/detection/getTransmissionData.h diff --git a/src/common/getGeometryInfo.h b/src/common/getGeometryInfo.h index 9e96651..739ba94 100644 --- a/src/common/getGeometryInfo.h +++ b/src/common/getGeometryInfo.h @@ -24,6 +24,7 @@ namespace Recon std::vector receiverNormals; std::vector senderPositions; std::vector receiverPositions; + std::vector sensData; }; GeometryInfo getGeometryInfo(const Aurora::Matrix& aMotorPos, const Aurora::Matrix& aTransformationMatrices, diff --git a/src/common/temperatureCalculation/extractTasTemperature.cpp b/src/common/temperatureCalculation/extractTasTemperature.cpp new file mode 100644 index 0000000..95f4736 --- /dev/null +++ b/src/common/temperatureCalculation/extractTasTemperature.cpp @@ -0,0 +1,66 @@ +#include "extractTasTemperature.h" +#include "Function2D.h" +#include "Function.h" + +using namespace Aurora; + +namespace +{ + double getTemperatureForTas(const Matrix& aTasTemperature, double aTasNum, double aMotorPos, const Matrix& aReferenceTemps, + double aMinTemperature, double aMaxTemperature) + { + double result = NAN; + if(aMotorPos == 1) + { + for(int i=0; i= aMotorPos) + { + result = mean(aReferenceTemps($,aMotorPos).toMatrix(), FunctionDirection::All, false)[0]; + } + else + { + result = mean(aReferenceTemps, FunctionDirection::All, false)[0]; + } + } + + if (result < aMinTemperature) + { + return aMinTemperature; + } + + if (result > aMaxTemperature) + { + return aMaxTemperature; + } + + return result; + } +} + + +Matrix Recon::extractTasTemperature(const Matrix& aTasTemperature, const Matrix& aTasList, const Matrix& aMotorPosList, const Matrix& aDefaultTemps, + double aMinTemperature, double aMaxTemperature) +{ + size_t resultSize = aTasList.getDataSize() * aMotorPosList.getDataSize(); + double* resultData = Aurora::malloc(resultSize); + for(int i=0; i #include "Matrix.h" +#include "src/common/getGeometryInfo.h" namespace Recon { -struct geo { - //[471][4] - Aurora::Matrix headTable; - //[181][181] - Aurora::Matrix sensChar; - std::vector senderNormals; - std::vector receiverNormals; - std::vector senderPositions; - std::vector receiverPositions; -}; Aurora::Matrix getSensitivity(const Aurora::Matrix &aMSensmap, Aurora::Matrix aVSenderNormal, @@ -39,6 +30,6 @@ precalcSensitivity(const Aurora::Matrix &aVSenderTASRange, const Aurora::Matrix &aVReceiverTASRange, const Aurora::Matrix &aVReceiverElementRange, const Aurora::Matrix &aVMotorPos, - const geo &aTASElements); + const GeometryInfo &aTASElements); } // namespace Recon #endif // __SENSITIVITYCALCULATIONS_H__ \ No newline at end of file diff --git a/src/transmissionReconstruction/detection/getTransmissionData.cpp b/src/transmissionReconstruction/detection/getTransmissionData.cpp new file mode 100644 index 0000000..6b909ca --- /dev/null +++ b/src/transmissionReconstruction/detection/getTransmissionData.cpp @@ -0,0 +1,33 @@ +#include "getTransmissionData.h" +#include "../../config/config.h" +#include "src/common/temperatureCalculation/extractTasTemperature.h" +#include "src/transmissionReconstruction/dataFilter/sensitivityCalculations.h" + +#include "Matrix.h" +#include + +using namespace Recon; +using namespace Aurora; + +void Recon::getTransmissionData(const Aurora::Matrix& aMotorPos, const Aurora::Matrix& aMotoPosRef, const Aurora::Matrix& aSlList, + const Aurora::Matrix& aSnList, const Aurora::Matrix& aRlList, const Aurora::Matrix& aRnList, + const TempInfo& aTemp, const TempInfo& aTempRef, GeometryInfo& aGeom, + GeometryInfo& aGeomRef, const MeasurementInfo& aExpInfo, const MeasurementInfo& aExpInfoRef, + const PreComputes& aPreComputes) +{ + //推测是已经完成过透射重建并从完成的透射重建读取数据,但下方读取后数据又被覆盖 + //暂不考虑此逻辑运行 + // if transParams.detection.forceRedetect == 0 && exist(transParams.pathSaveDetection, 'dir') && size(dir(transParams.pathSaveDetection), 1) > 2 % i.e. detection folder exists and is not empty + // % Load transmission detection data + // writeReconstructionLog('Loading transmission detection data. All available data from given motor positions are taken.', 1); + // [tofDataTotal, attDataTotal, senderList, receiverList, waterTempList, dataInfo] = loadTransmissionDetectionData(transParams.pathSaveDetection, transParams.pathData, motorPos, expInfo.rootMeasUniqueID); + TasTemps tasTemps; + tasTemps.waterTempPreCalc_rl = extractTasTemperature(aTemp.tasTemperature, aRlList, aMotorPos, aTemp.jumoTemp, transParams::minTemperature, transParams::maxTemperature); + tasTemps.waterTempPreCalc_sl = extractTasTemperature(aTemp.tasTemperature, aSlList, aMotorPos, aTemp.jumoTemp, transParams::minTemperature, transParams::maxTemperature); + tasTemps.waterTempRefPreCalc_rl = extractTasTemperature(aTempRef.tasTemperature, aRlList, aMotoPosRef, aTempRef.jumoTemp, transParams::minTemperature, transParams::maxTemperature); + tasTemps.waterTempRefPreCalc_sl = extractTasTemperature(aTempRef.tasTemperature, aSlList, aMotoPosRef, aTempRef.jumoTemp, transParams::minTemperature, transParams::maxTemperature); + + aGeom.sensChar = precalcSensitivity(aSlList, aSnList, aRlList, aRnList, aMotorPos, const geo &aTASElements) + + +} \ No newline at end of file diff --git a/src/transmissionReconstruction/detection/getTransmissionData.h b/src/transmissionReconstruction/detection/getTransmissionData.h new file mode 100644 index 0000000..c463ed0 --- /dev/null +++ b/src/transmissionReconstruction/detection/getTransmissionData.h @@ -0,0 +1,17 @@ +#ifndef GET_TRANSMISSION_DATA_H +#define GET_TRANSMISSION_DATA_H + +#include "Matrix.h" +#include "../../common/getMeasurementMetaData.h" +#include "src/common/getGeometryInfo.h" + +namespace Recon +{ + void getTransmissionData(const Aurora::Matrix& aMotorPos, const Aurora::Matrix& aMotoPosRef, const Aurora::Matrix& aSlList, + const Aurora::Matrix& aSnList, const Aurora::Matrix& aRlList, const Aurora::Matrix& aRnList, + const TempInfo& aTemp, const TempInfo& aTempRef, GeometryInfo& aGeom, + GeometryInfo& aGeomRef, const MeasurementInfo& aExpInfo, const MeasurementInfo& aExpInfoRef, + const PreComputes& aPreComputes); +} + +#endif \ No newline at end of file