IAP GITLAB

Skip to content
Snippets Groups Projects
Commit c43f951f authored by Nikos Karastathis's avatar Nikos Karastathis :ocean:
Browse files

Fix unit tests

parent 19be0728
No related branches found
No related tags found
1 merge request!502Gladstone-Dale law rerfactive index profile
...@@ -24,7 +24,7 @@ namespace corsika { ...@@ -24,7 +24,7 @@ namespace corsika {
, radius_(radius) {} , radius_(radius) {}
template <typename T> template <typename T>
double ExponentialRefractiveIndex<T>::getRefractiveIndex(Point const& point) const { inline double ExponentialRefractiveIndex<T>::getRefractiveIndex(Point const& point) const {
return n0_ * exp((-lambda_) * (distance(point, center_) - radius_)); return n0_ * exp((-lambda_) * (distance(point, center_) - radius_));
} }
......
...@@ -22,8 +22,8 @@ namespace corsika { ...@@ -22,8 +22,8 @@ namespace corsika {
class GladstoneDaleRefractiveIndex final : public T { class GladstoneDaleRefractiveIndex final : public T {
double const seaLevelRefractiveIndex_; ///< The constant refractive index at sea level. double const seaLevelRefractiveIndex_; ///< The constant refractive index at sea level.
MassDensityType const seaLevelDensity_; ///< The constant mass density at sea level.
Point const earthSurface_; ///< A point at earth's surface. Point const earthSurface_; ///< A point at earth's surface.
MassDensityType const seaLevelDensity_; ///< The constant mass density at sea level.
// MassDensityType ratio_; ///< (1 - seaLevelRefractiveIndex_) / seaLevelDensity_. // MassDensityType ratio_; ///< (1 - seaLevelRefractiveIndex_) / seaLevelDensity_.
public: public:
......
...@@ -287,7 +287,9 @@ TEST_CASE("GladstoneDaleRefractiveIndex w/ 5-layered atmosphere") { ...@@ -287,7 +287,9 @@ TEST_CASE("GladstoneDaleRefractiveIndex w/ 5-layered atmosphere") {
auto const* const universe{env.getUniverse().get()}; auto const* const universe{env.getUniverse().get()};
auto const* node{universe->getContainingNode(ref_)}; auto const* node{universe->getContainingNode(ref_)};
// get the refractive index // get the refractive index
auto const rIndex{node->getModelProperties().getRefractiveIndex(ref_)}; auto const rIndex1{node->getModelProperties().getRefractiveIndex(ref_)};
auto const rIndex2{node->getModelProperties().getRefractiveIndex(surface_)};
// CHECK(rIndex - n0 == Approx(0)); CHECK(rIndex1 - n0 == Approx(-0.0002591034));
CHECK(rIndex2 - n0 == Approx(0));
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment