IAP GITLAB

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

added distance from the point of emission to an observer to signal path. Needed in CoREAS.

parent 5d3fd53c
No related branches found
No related tags found
1 merge request!329Radio interface
...@@ -22,23 +22,26 @@ namespace corsika { ...@@ -22,23 +22,26 @@ namespace corsika {
using path = std::deque<Point>; using path = std::deque<Point>;
//TODO: discuss if we need average refractivity or average refractive index
TimeType const total_time_; ///< The total propagation time. 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 emit_; ///< The (unit-length) emission vector.
Vector<dimensionless_d> const receive_; ///< The (unit-length) receive vector. Vector<dimensionless_d> const receive_; ///< The (unit-length) receive vector.
path const points_; ///< A collection of points that make up the geometrical path. 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. * 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, Vector<dimensionless_d> const emit, Vector<dimensionless_d> const receive,
path const& points) LengthType const R_distance, path const& points)
: Path(points) : Path(points)
, total_time_(total_time) , total_time_(total_time)
, average_refractivity_(average_refractivity) , average_refractive_index_(average_refractive_index)
, emit_(emit) , emit_(emit)
, receive_(receive) {} , receive_(receive)
, R_distance_(R_distance) {}
}; // class SignalPath }; // class SignalPath
......
...@@ -57,6 +57,9 @@ namespace corsika { ...@@ -57,6 +57,9 @@ namespace corsika {
*/ */
auto direction{(destination - source).normalized()}; 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` // the step is the direction vector with length `stepsize`
auto step{direction * stepsize}; auto step{direction * stepsize};
...@@ -73,6 +76,7 @@ namespace corsika { ...@@ -73,6 +76,7 @@ namespace corsika {
std::vector<double> rindex; std::vector<double> rindex;
rindex.reserve(n_points); 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. // loop from `source` to `destination` to store values before Simpson's rule.
// this loop skips the last point 'destination' // this loop skips the last point 'destination'
for (auto point = source; (point - destination).getNorm() > 0.6 * stepsize; for (auto point = source; (point - destination).getNorm() > 0.6 * stepsize;
...@@ -117,10 +121,13 @@ namespace corsika { ...@@ -117,10 +121,13 @@ namespace corsika {
TimeType time = sum * (h / (3 * constants::c)); TimeType time = sum * (h / (3 * constants::c));
// compute the average refractivity. // 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. // 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() } // END: propagate()
......
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