Add temperatureToSoundSpeed function.
This commit is contained in:
@@ -125,6 +125,29 @@ TransFormInfo Recon::getTransformationMatrix(Parser* aParser, const Matrix& aMot
|
|||||||
return result;
|
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)
|
TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
||||||
{
|
{
|
||||||
@@ -200,13 +223,13 @@ TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
|||||||
// temp.TASTemperature(1, :, :) = correctTASTemperatures(temp2, temp.jumoTemp);
|
// temp.TASTemperature(1, :, :) = correctTASTemperatures(temp2, temp.jumoTemp);
|
||||||
|
|
||||||
// catch ME
|
// catch ME
|
||||||
|
|
||||||
// % if tas temperatures not there
|
// % if tas temperatures not there
|
||||||
// % take temperatures from calibrated sensors
|
// % take temperatures from calibrated sensors
|
||||||
// % and use them for all TAS the same
|
// % and use them for all TAS the same
|
||||||
|
|
||||||
// writeReconstructionLog(sprintf('%s: %s TAS temperatures approximated from calibrated reference sensors.', ME.identifier, ME.message), 3)
|
// writeReconstructionLog(sprintf('%s: %s TAS temperatures approximated from calibrated reference sensors.', ME.identifier, ME.message), 3)
|
||||||
|
|
||||||
// if(~jumoAllNaN)
|
// if(~jumoAllNaN)
|
||||||
// temp.TASTemperature = zeros(2, numTAS, size(temp.jumoTemp, 2));
|
// temp.TASTemperature = zeros(2, numTAS, size(temp.jumoTemp, 2));
|
||||||
// temp.TASTemperature(1, :, :) = repmat(mean(temp.jumoTemp), size(temp.TASTemperature, 2), 1);
|
// temp.TASTemperature(1, :, :) = repmat(mean(temp.jumoTemp), size(temp.TASTemperature, 2), 1);
|
||||||
@@ -214,7 +237,7 @@ TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
|||||||
// else % worst case: no temperature data at all! cannot continue!
|
// else % worst case: no temperature data at all! cannot continue!
|
||||||
// error([mfilename ':noTemperatureAvailable'],'No TAS and no Jumo temperature available! Cannot reconstruct!');
|
// error([mfilename ':noTemperatureAvailable'],'No TAS and no Jumo temperature available! Cannot reconstruct!');
|
||||||
// end
|
// end
|
||||||
|
|
||||||
// end
|
// end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,25 +251,7 @@ TempInfo Recon::getTemperatureInfo(Parser* aParser, double aNumTas)
|
|||||||
{
|
{
|
||||||
result.expectedTemp = mean(result.jumoTemp,FunctionDirection::All,false);
|
result.expectedTemp = mean(result.jumoTemp,FunctionDirection::All,false);
|
||||||
}
|
}
|
||||||
|
result.expectedSOSWater = temperatureToSoundSpeed(result.expectedTemp , "marczak");
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,12 +56,24 @@ namespace Recon
|
|||||||
Aurora::Matrix motorPos;
|
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);
|
Aurora::Matrix getAvailableMotorPositions(Parser* aParser);
|
||||||
MeasurementInfo loadMeasurementInfos(Parser* aParser);
|
MeasurementInfo loadMeasurementInfos(Parser* aParser);
|
||||||
TransFormInfo getTransformationMatrix(Parser* aParser, const Aurora::Matrix& aMotorPosList);
|
TransFormInfo getTransformationMatrix(Parser* aParser, const Aurora::Matrix& aMotorPosList);
|
||||||
TempInfo getTemperatureInfo(Parser* aParser, double aNumTas);
|
TempInfo getTemperatureInfo(Parser* aParser, double aNumTas);
|
||||||
CEInfo getCEInfo(Parser* aParser, const MeasurementInfo aInfo);
|
CEInfo getCEInfo(Parser* aParser, const MeasurementInfo aInfo);
|
||||||
|
Aurora::Matrix temperatureToSoundSpeed(const Aurora::Matrix& aTemperature, const std::string& aMethod);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // !GET_MEASUREMENT_METADATA_H
|
#endif // !GET_MEASUREMENT_METADATA_H
|
||||||
Reference in New Issue
Block a user