...
 
Commits (2)
  • Philipp Schäfer's avatar
    ART - EigenraySearch · 32c030be
    Philipp Schäfer authored
    - Fixed a bug that occured if point of minimum distance was ray end point
    - Also gives a warning that maximum propagation time was chosen too low
    32c030be
  • Philipp Schäfer's avatar
    ART - Tests · 2e849e31
    Philipp Schäfer authored
    - added Eigenray Test with source at ground level
    2e849e31
......@@ -211,6 +211,15 @@ void EigenraySearch::CAdaptiveWorker::SetEigenrayEndPoint()
const int idxBeforeMin = receiverData->idxMinDist;
const VistaVector3D& rMin = receiverData->posMinDist;
if (m_pMinDistanceRay->NumPoints() < idxBeforeMin)
ITA_EXCEPT_INVALID_PARAMETER("Index for minimum distance out of bounds!");
if (m_pMinDistanceRay->NumPoints() == idxBeforeMin + 1) //Min dist point is endpoint
{
std::cout << "WARNING: EigenraySearch::Engine: Ray end point is closest point to receiver. This usually happens if maximum propagation time is too low." << std::endl;
return;
}
//Interpolate to new point of minimum
const VistaVector3D& r1 = m_pMinDistanceRay->at(idxBeforeMin).position;
const VistaVector3D& r2 = m_pMinDistanceRay->at(idxBeforeMin + 1).position;
......
......@@ -108,6 +108,37 @@ void TestReceiverNearGroundSourceAzimuth(const CStratifiedAtmosphere& atmosphere
runTestReceiverNearGround(atmosphere, theta, sourceAzimuth, atmosphereSuffix);
}
void TestSourceAtGround(const CStratifiedAtmosphere& atmosphere, const string& atmosphereSuffix)
{
VistaVector3D sourcePosition = VistaVector3D(0, 0, 0);
VistaVector3D receiverPosition = VistaVector3D(6500, 0, 1.8);
const string filename = "SourceAtGround" + atmosphereSuffix;
//runTest(atmosphere, sourcePosition, receiverPosition, filename);
EigenraySearch::CEngine engine;
engine.eigenraySettings.rayAdaptation.abort.maxNAdaptations = 30;
engine.eigenraySettings.rayAdaptation.abort.minAngleResolutionDeg = 0.0001;
engine.eigenraySettings.rayAdaptation.accuracy.maxReceiverRadius = 1;
engine.eigenraySettings.rayAdaptation.accuracy.maxSourceReceiverAngle = 1;
engine.eigenraySettings.rayAdaptation.accuracy.maxAngleForGeomSpreading = 0.01;
engine.eigenraySettings.rayAdaptation.advancedRayZooming.bActive = false;
//engine.eigenraySettings.rayAdaptation.advancedRayZooming.threshold = 1.0;
engine.eigenraySettings.rayTracing.bAbortOnReceiverDistIncrease = false;
engine.eigenraySettings.rayTracing.maxReflectionOrder = 1;
engine.eigenraySettings.rayTracing.maxTime = 30;
cout << filename << ":" << endl;
cout << "Starting Simulation-Engine..." << endl;
std::vector<std::shared_ptr<CRay>> eigenrays = engine.Run(atmosphere, sourcePosition, receiverPosition);
}
CStratifiedAtmosphere GetHomogeneousAtmosphere()
{
auto humidProfile = std::make_shared<HumidityProfiles::CConstant>(50);
......@@ -145,6 +176,8 @@ int main(int iNumInArgs, char* pcInArgs[])
const CStratifiedAtmosphere homAtmosphere = GetHomogeneousAtmosphere();
const CStratifiedAtmosphere inhomAtmosphere = GetInhomogeneousAtmosphere();
TestSourceAtGround(inhomAtmosphere, "Inhomogeneous");
TestReceiverNearGroundSourceElevation(homAtmosphere, "Homogeneous");
TestReceiverNearGroundSourceElevation(inhomAtmosphere, "Inhomogeneous");
TestReceiverNearGroundSourceAzimuth(inhomAtmosphere, "Inhomogeneous");
......