NbodyGradient.jl
NbodyGradient.jl copied to clipboard
Order of indices in transit time computation
The g! function takes the dot product between the sky velocity and position of
two bodies relative to one another, and this is monitored to see when the sign
changes to flag that a transit may have occurred. The indices in the following
line, i and j, are the indices of these two bodies, with the body being transited
first (tt.ti) and the transiting body second (i):
https://github.com/ericagol/NbodyGradient.jl/blob/85631d64cd22125820474fc9acd8f6da2f29c78f/src/transits/timing.jl#L22
but, in this earlier line, the opposite order is used: https://github.com/ericagol/NbodyGradient.jl/blob/85631d64cd22125820474fc9acd8f6da2f29c78f/src/transits/timing.jl#L13
I think that if the indices are swapped, then the sign of both the velocity and the position will change, and so this shouldn't affect the computation of the time of transit. But, we should check that this is the case.
Hmmm.... if I reverse the order of these indices, then I get an error...