First update.
This commit is contained in:
@@ -24,7 +24,7 @@ using namespace Aurora;
|
||||
|
||||
Matrix Recon::getAvailableMotorPositions(Parser* aParser)
|
||||
{
|
||||
std::vector<double> mpData;
|
||||
std::vector<float> mpData;
|
||||
if(aParser->hasCEMeasured())
|
||||
{
|
||||
mpData.push_back(0);
|
||||
@@ -72,11 +72,11 @@ TransFormInfo Recon::getTransformationMatrix(Parser* aParser, const Matrix& aMot
|
||||
int columns = 2;//一个角度一个高度
|
||||
unsigned long long length = listRealData.getLength();
|
||||
int rows = length / columns;
|
||||
double* data = new double[length];
|
||||
float* data = new float[length];
|
||||
std::copy(listRealData.get(), listRealData.get() + length, data);
|
||||
std::vector<int> info = {rows, columns, 1};
|
||||
Matrix movementsListReal(std::shared_ptr<double>(data, std::default_delete<double[]>()), info);
|
||||
double* motorPosListAvailableData = Aurora::malloc(rows);
|
||||
Matrix movementsListReal(std::shared_ptr<float>(data, std::default_delete<float[]>()), info);
|
||||
float* motorPosListAvailableData = Aurora::malloc(rows);
|
||||
for(int i=0; i<rows; ++i)
|
||||
{
|
||||
motorPosListAvailableData[i] = i + 1;
|
||||
@@ -93,13 +93,13 @@ TransFormInfo Recon::getTransformationMatrix(Parser* aParser, const Matrix& aMot
|
||||
if(movementRealAvailable)
|
||||
{
|
||||
int maxMotorPosNum = motorPosList.getDimSize(0);
|
||||
double* transformationMatrixListData = Aurora::malloc(16*maxMotorPosNum);
|
||||
double zero = 0.0;
|
||||
cblas_dcopy(16*maxMotorPosNum,&zero,0,transformationMatrixListData,1);
|
||||
float* transformationMatrixListData = Aurora::malloc(16*maxMotorPosNum);
|
||||
float zero = 0.0;
|
||||
cblas_scopy(16*maxMotorPosNum,&zero,0,transformationMatrixListData,1);
|
||||
for(int i=0; i<maxMotorPosNum; ++i)
|
||||
{
|
||||
double rotation = movementsListReal.getData()[i];
|
||||
double distance = movementsListReal.getData()[i + aParser->getMetaData().getAperturePositionNumber()];
|
||||
float rotation = movementsListReal.getData()[i];
|
||||
float distance = movementsListReal.getData()[i + aParser->getMetaData().getAperturePositionNumber()];
|
||||
transformationMatrixListData[16*i + 0] = cos(rotation*PI/180);
|
||||
transformationMatrixListData[16*i + 1] = sin(rotation*PI/180);
|
||||
transformationMatrixListData[16*i + 4] = -sin(rotation*PI/180);
|
||||
@@ -114,7 +114,7 @@ TransFormInfo Recon::getTransformationMatrix(Parser* aParser, const Matrix& aMot
|
||||
{
|
||||
auto rotationMatrix = aParser->getMovementData().getRotationMatrix();
|
||||
int maxMotorPosNum = motorPosList.getDimSize(0);
|
||||
double* transformationMatrixListData = new double[16*maxMotorPosNum];
|
||||
float* transformationMatrixListData = new float[16*maxMotorPosNum];
|
||||
for(size_t i=0; i<maxMotorPosNum; ++i)
|
||||
{
|
||||
std::copy(rotationMatrix.at(i).get(), rotationMatrix.at(i).get()+16, transformationMatrixListData + i*16);
|
||||
@@ -130,26 +130,26 @@ Matrix Recon::temperatureToSoundSpeed(const Matrix& aTemperature, const std::str
|
||||
Matrix result;
|
||||
if (aMethod == "marczak")
|
||||
{
|
||||
double* kData = new double[6] {2.78786e-9, -1.398845e-6, 3.287156e-4, -5.799136e-2, 5.038813, 1.402385e3};
|
||||
float* kData = new float[6] {2.78786e-9, -1.398845e-6, 3.287156e-4, -5.799136e-2, 5.038813, 1.402385e3};
|
||||
Matrix k = Matrix::fromRawData(kData, 6);
|
||||
result = polyval(k, aTemperature);
|
||||
}
|
||||
else if(aMethod == "mader")
|
||||
{
|
||||
double* kData = new double[6] {3.14643e-9, -1.478e-6, 0.000334199, -0.0580852, 5.03711, 1402.39};
|
||||
float* kData = new float[6] {3.14643e-9, -1.478e-6, 0.000334199, -0.0580852, 5.03711, 1402.39};
|
||||
Matrix k = Matrix::fromRawData(kData, 6);
|
||||
result = polyval(k, aTemperature);
|
||||
}
|
||||
else if(aMethod == "jan")
|
||||
{
|
||||
double speedData = 1557 - 0.0245 * pow((74 - aTemperature.getData()[0]), 2);
|
||||
result = Matrix::fromRawData(new double[1] {speedData}, 1);
|
||||
float speedData = 1557 - 0.0245 * pow((74 - aTemperature.getData()[0]), 2);
|
||||
result = Matrix::fromRawData(new float[1] {speedData}, 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//已验证,完全正确
|
||||
TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
||||
TempInfo Recon::getTemperatureInfo(Parser* aParser, float aNumTas)
|
||||
{
|
||||
TempInfo result;
|
||||
//jumoTemp
|
||||
@@ -173,7 +173,7 @@ TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
||||
jumoTempNum = jumoTemp4.getLength();
|
||||
}
|
||||
|
||||
double* jumoTempData = Aurora::malloc(jumoTempNum * 4);
|
||||
float* jumoTempData = Aurora::malloc(jumoTempNum * 4);
|
||||
for(int i=0; i<jumoTempNum; ++i)
|
||||
{
|
||||
jumoTempData[4*i] = jumoTemp1.get()[i];
|
||||
@@ -209,7 +209,7 @@ TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
||||
{
|
||||
size_t tasTempLength = aParser->getTemperatureData().getTasTemperature()[0].getLength();
|
||||
float* fromTasTempData = aParser->getTemperatureData().getTasTemperature()[0].get();
|
||||
double* tasTempData = new double[tasTempLength];
|
||||
float* tasTempData = new float[tasTempLength];
|
||||
std::copy(fromTasTempData, fromTasTempData+ tasTempLength, tasTempData);
|
||||
Matrix tasTemp = Matrix::fromRawData(tasTempData, 2, tasTempLength / 2);
|
||||
|
||||
@@ -279,7 +279,7 @@ CEInfo Recon::getCEInfo(Parser* aParser, const MeasurementInfo aInfo)
|
||||
}
|
||||
else
|
||||
{
|
||||
double* ceData = new double[ceMeasuredLength * ceMeasuredPointer.getSize()];
|
||||
float* ceData = new float[ceMeasuredLength * ceMeasuredPointer.getSize()];
|
||||
std::copy(ceMeasuredData, ceMeasuredData + ceMeasuredLength * ceMeasuredPointer.getSize(), ceData);
|
||||
ce = Matrix::fromRawData(ceData, ceMeasuredLength, ceMeasuredPointer.getSize());
|
||||
}
|
||||
@@ -306,13 +306,13 @@ CEInfo Recon::getCEInfo(Parser* aParser, const MeasurementInfo aInfo)
|
||||
{
|
||||
size_t size = aParser->getMetaData().getTasIndices().getLength();
|
||||
uint8_t* fromData = aParser->getMetaData().getTasIndices().get();
|
||||
double* tasIndicesData = new double[size];
|
||||
float* tasIndicesData = new float[size];
|
||||
std::copy(fromData, fromData + size, tasIndicesData);
|
||||
result.tasIndices = Matrix::fromRawData(tasIndicesData, size);
|
||||
|
||||
size = aParser->getMetaData().getReceiverIndices().getLength();
|
||||
fromData = aParser->getMetaData().getReceiverIndices().get();
|
||||
double* receiverIndicesData = new double[size];
|
||||
float* receiverIndicesData = new float[size];
|
||||
std::copy(fromData, fromData + size, receiverIndicesData);
|
||||
result.receiverIndices = Matrix::fromRawData(receiverIndicesData, size);
|
||||
}
|
||||
@@ -330,7 +330,7 @@ CEInfo Recon::getCEInfo(Parser* aParser, const MeasurementInfo aInfo)
|
||||
{
|
||||
result.ceAvailable = true;
|
||||
size_t ceRefSize = ceRefFromData.getLength();
|
||||
double* ceRefData = new double[ceRefSize];
|
||||
float* ceRefData = new float[ceRefSize];
|
||||
std::copy(ceRefFromData.get(), ceRefFromData.get() + ceRefSize, ceRefData);
|
||||
Matrix ceRefCE = Matrix::fromRawData(ceRefData, ceRefSize);
|
||||
result.ceRef = preprocessCE(ceRefCE, result.ceRef_sf, reflectParams::aScanReconstructionFrequency, aInfo.expectedAScanLength);
|
||||
|
||||
Reference in New Issue
Block a user