Commit 6c2c5a27 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

ART - AdaptiveRayGrid

- bugfix
parent ce99275c
......@@ -16,8 +16,8 @@
*
*/
#ifndef IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_RAYRESOLUTIONADAPTER
#define IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_RAYRESOLUTIONADAPTER
#ifndef IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_ADAPTIVERAYGRID
#define IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_ADAPTIVERAYGRID
#include <ITAPropagationPathSim/AtmosphericRayTracing/RayGrid.h>
......@@ -32,7 +32,7 @@ namespace ITAPropagationPathSim
{
namespace EigenraySearch
{
class CAdaptiveRayGrid : private CRayGrid
class ITA_PROPAGATION_PATH_SIM_API CAdaptiveRayGrid : private CRayGrid
{
private:
std::set< std::shared_ptr<CRay> > vpNewRaysOfLastAdaptation;
......@@ -70,10 +70,10 @@ namespace ITAPropagationPathSim
//! By comparing the vector from three rays to the receiver, this decides between which two rays the eigenray is located and returns their indices
std::vector<int> FindAdvancedRayGridLimits1D(const std::vector< std::shared_ptr<CRay> >& pRays, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold) const;
void DoubleRayResolution();
std::vector<double> DoubleAngularResolution(const std::vector<double>& angleVector) const;
void DoubleAngularResolution(std::vector<double>& angleVector) const;
};
}
}
}
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_RAYRESOLUTIONADAPTER
\ No newline at end of file
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_ADAPTIVERAYGRID
\ No newline at end of file
......@@ -72,8 +72,8 @@ void CAdaptiveRayGrid::DoubleRayResolution()
if (NRays() <= 1)
return;
vdThetaDeg = DoubleAngularResolution(vdThetaDeg);
vdPhiDeg = DoubleAngularResolution(vdPhiDeg);
DoubleAngularResolution(vdThetaDeg);
DoubleAngularResolution(vdPhiDeg);
RayMatrix newRayMatrix( NTheta(), RayVector( NPhi() ) );
vpNewRaysOfLastAdaptation.clear();
......@@ -101,18 +101,20 @@ void CAdaptiveRayGrid::DoubleRayResolution()
SetRayMatrix(newRayMatrix);
}
std::vector<double> CAdaptiveRayGrid::DoubleAngularResolution(const std::vector<double>& angleVector) const
void CAdaptiveRayGrid::DoubleAngularResolution(std::vector<double>& angleVector) const
{
if (angleVector.size() < 2)
return angleVector;
return;
std::vector<double> returnVector;
returnVector.push_back( angleVector.front() );
std::vector<double> newAngleVector;
newAngleVector.reserve( 2 * angleVector.size() - 1 );
newAngleVector.push_back( angleVector.front() );
for (int idxAngle = 1; idxAngle < angleVector.size(); idxAngle++)
{
const double angle1 = angleVector[idxAngle - 1];
const double angle2 = angleVector[idxAngle];
returnVector.push_back( (angle1+angle2)/2 );
returnVector.push_back( angle2 );
const double& angle1 = angleVector[idxAngle - 1];
const double& angle2 = angleVector[idxAngle];
newAngleVector.push_back( (angle1+angle2)/2 );
newAngleVector.push_back( angle2 );
}
angleVector = newAngleVector;
}
......@@ -73,6 +73,24 @@ void Test()
idx++;
}
//TODO: Create one test for each situation:
/*
2D-Grid:
- Ray in the middle
- Ray on the left/right phi-"border" of circular grid
- Ray on the theta/phi border of non-circular grid
- Ray at south / north pole
1D-Grid - Theta:
- Ray in the middle
- Ray at border of grid
- Ray at south / north pole
1D-Grid - Phi:
- Ray in the middle
- Ray at border of grid
*/
cout << endl << ray->InitialDirection() << endl;
adaptiveRayGrid.ZoomIntoRay(ray);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment