diff --git a/corsika/modules/radio/propagators/SignalPath.hpp b/corsika/modules/radio/propagators/SignalPath.hpp index 20c1fd69abf1ce09e620572bd0c5e14f720c5364..741a90af4e78477f7f8f9a0ae1b80f1789202c4a 100644 --- a/corsika/modules/radio/propagators/SignalPath.hpp +++ b/corsika/modules/radio/propagators/SignalPath.hpp @@ -22,23 +22,26 @@ namespace corsika { using path = std::deque<Point>; + //TODO: discuss if we need average refractivity or average refractive index TimeType const total_time_; ///< The total propagation time. - double const average_refractivity_; ///< The average refractivity. + double const average_refractive_index_; ///< The average refractive index. Vector<dimensionless_d> const emit_; ///< The (unit-length) emission vector. Vector<dimensionless_d> const receive_; ///< The (unit-length) receive vector. path const points_; ///< A collection of points that make up the geometrical path. + LengthType const R_distance_; ///< The distance from the point of emission to an observer. TODO: optical path, not geometrical! (probably) /** * Create a new SignalPath instance. */ - SignalPath(TimeType const total_time, double const average_refractivity, + SignalPath(TimeType const total_time, double const average_refractive_index, Vector<dimensionless_d> const emit, Vector<dimensionless_d> const receive, - path const& points) + LengthType const R_distance, path const& points) : Path(points) , total_time_(total_time) - , average_refractivity_(average_refractivity) + , average_refractive_index_(average_refractive_index) , emit_(emit) - , receive_(receive) {} + , receive_(receive) + , R_distance_(R_distance) {} }; // class SignalPath diff --git a/corsika/modules/radio/propagators/StraightPropagator.hpp b/corsika/modules/radio/propagators/StraightPropagator.hpp index 3ee2f3bf075c795766b30afacc82908de0293860..6d3aceeaa1d0f2ce0683808a883274bfe743b64e 100644 --- a/corsika/modules/radio/propagators/StraightPropagator.hpp +++ b/corsika/modules/radio/propagators/StraightPropagator.hpp @@ -57,6 +57,9 @@ namespace corsika { */ auto direction{(destination - source).normalized()}; + // the distance from the point of emission to an observer + auto distance_ {(destination - source).getNorm()}; + // the step is the direction vector with length `stepsize` auto step{direction * stepsize}; @@ -73,6 +76,7 @@ namespace corsika { std::vector<double> rindex; rindex.reserve(n_points); + // TODO: Re-think the efficiency of this for loop // loop from `source` to `destination` to store values before Simpson's rule. // this loop skips the last point 'destination' for (auto point = source; (point - destination).getNorm() > 0.6 * stepsize; @@ -117,10 +121,13 @@ namespace corsika { TimeType time = sum * (h / (3 * constants::c)); // compute the average refractivity. - auto average_refractivity = refra_ / N; + auto averageRefractiveIndex_ = refra_ / N; + + // refractivity definition: (n - 1) // realize that emission and receive vector are 'direction' in this case. - return { SignalPath(time, average_refractivity, direction , direction, points) }; + //TODO: receive and emission vector should have opposite signs! + return { SignalPath(time, averageRefractiveIndex_, direction , direction, distance_,points) }; } // END: propagate()