Add temperatureToSoundSpeed function.
This commit is contained in:
@@ -125,6 +125,29 @@ TransFormInfo Recon::getTransformationMatrix(Parser* aParser, const Matrix& aMot
|
||||
return result;
|
||||
}
|
||||
|
||||
Matrix Recon::temperatureToSoundSpeed(const Matrix& aTemperature, const std::string& aMethod)
|
||||
{
|
||||
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};
|
||||
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};
|
||||
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);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//已验证,完全正确
|
||||
TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
||||
{
|
||||
@@ -228,25 +251,7 @@ TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
||||
{
|
||||
result.expectedTemp = mean(result.jumoTemp,FunctionDirection::All,false);
|
||||
}
|
||||
|
||||
std::string speedMethod = "marczak";
|
||||
if (speedMethod == "marczak")
|
||||
{
|
||||
double* kData = new double[6] {2.78786e-9, -1.398845e-6, 3.287156e-4, -5.799136e-2, 5.038813, 1.402385e3};
|
||||
Matrix k = Matrix::fromRawData(kData, 6);
|
||||
result.expectedSOSWater = polyval(k, result.expectedTemp);
|
||||
}
|
||||
else if(speedMethod == "mader")
|
||||
{
|
||||
double* kData = new double[6] {3.14643e-9, -1.478e-6, 0.000334199, -0.0580852, 5.03711, 1402.39};
|
||||
Matrix k = Matrix::fromRawData(kData, 6);
|
||||
result.expectedSOSWater = polyval(k, result.expectedTemp);
|
||||
}
|
||||
else if(speedMethod == "jan")
|
||||
{
|
||||
double speedData = 1557 - 0.0245 * pow((74 - result.expectedTemp.getData()[0]), 2);
|
||||
result.expectedSOSWater = Matrix::fromRawData(new double[1] {speedData}, 1);
|
||||
}
|
||||
result.expectedSOSWater = temperatureToSoundSpeed(result.expectedTemp , "marczak");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -56,12 +56,24 @@ namespace Recon
|
||||
Aurora::Matrix motorPos;
|
||||
};
|
||||
|
||||
struct PreComputes
|
||||
{
|
||||
Aurora::Matrix matchedFilter;
|
||||
Aurora::Matrix matchedFilterRef;
|
||||
double timeInterval;
|
||||
bool measuredCEUsed;
|
||||
Aurora::Matrix measuredCE_TASIndices;
|
||||
Aurora::Matrix measuredCE_receiverIndices;
|
||||
double offset;
|
||||
};
|
||||
|
||||
//无用函数
|
||||
Aurora::Matrix getAvailableMotorPositions(Parser* aParser);
|
||||
MeasurementInfo loadMeasurementInfos(Parser* aParser);
|
||||
TransFormInfo getTransformationMatrix(Parser* aParser, const Aurora::Matrix& aMotorPosList);
|
||||
TempInfo getTemperatureInfo(Parser* aParser, double aNumTas);
|
||||
CEInfo getCEInfo(Parser* aParser, const MeasurementInfo aInfo);
|
||||
Aurora::Matrix temperatureToSoundSpeed(const Aurora::Matrix& aTemperature, const std::string& aMethod);
|
||||
|
||||
}
|
||||
#endif // !GET_MEASUREMENT_METADATA_H
|
||||
Reference in New Issue
Block a user