IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 558894f6 authored by Nikos Karastathis's avatar Nikos Karastathis :ocean: Committed by Ralf Ulrich
Browse files

Exponential refractive index does not use the getZ() method anymore.

parent fcb0ff45
No related branches found
No related tags found
1 merge request!402Resolve "ExponentialRefractiveIndex assumes a flat environment"
......@@ -15,14 +15,16 @@ namespace corsika {
template <typename T>
template <typename... Args>
ExponentialRefractiveIndex<T>::ExponentialRefractiveIndex(
double const n0, InverseLengthType const lambda, Args&&... args)
double const n0, InverseLengthType const lambda_, Point const center_, LengthType const planetRadius_, Args&&... args)
: T(std::forward<Args>(args)...)
, n_0(n0)
, lambda_(lambda) {}
, lambda(lambda_)
, center(center_)
, planetRadius(planetRadius_) {}
template <typename T>
double ExponentialRefractiveIndex<T>::getRefractiveIndex(Point const& point) const {
return n_0 * exp((-lambda_) * point.getCoordinates().getZ());
return n_0 * exp((-lambda) * (distance(point, center) - planetRadius));
}
} // namespace corsika
......@@ -23,7 +23,9 @@ namespace corsika {
class ExponentialRefractiveIndex : public T {
double n_0; ///< n0 constant.
InverseLengthType lambda_; ///< lambda parameter.
InverseLengthType lambda; ///< lambda parameter.
LengthType planetRadius; ///< the planet radius.
Point center; ///< center of the planet.
public:
/**
......@@ -36,7 +38,7 @@ namespace corsika {
* @param field The refractive index to return to a given point.
*/
template <typename... Args>
ExponentialRefractiveIndex(double const n0, InverseLengthType const lambda,
ExponentialRefractiveIndex(double const n0, InverseLengthType const lambda_, Point const center_, LengthType const planetRadius_,
Args&&... args);
/**
......
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