moonrise: only show future events
Some checks failed
Build / build (push) Has been cancelled
Build / build-simulator (push) Has been cancelled

This commit is contained in:
hueso 2025-05-07 19:06:41 -03:00
parent 736c04c688
commit 48399312be

View File

@ -48,7 +48,7 @@ MoonRise MoonRise_calculate(double latitude, double longitude, time_t t) {
self.queryTime = t;
offsetDays = julianDate(t) - 2451545L; // Days since Jan 1, 2000, 1200UTC.
// Begin testing (MR_WINDOW / 2) hours before requested time.
offsetDays -= (double)MR_WINDOW / (2 * 24) ;
//offsetDays -= (double)MR_WINDOW / (2 * 24) ;
// Calculate coordinates at start, middle, and end of search period.
for (int i = 0; i < 3; i++) {
@ -124,9 +124,9 @@ MoonRise MoonRise_calculate(double latitude, double longitude, time_t t) {
time = k + e + 1 / 120; // Time since k=0 of event (in hours).
// The time we started searching + the time from the start of the search to the
// event is the time of the event. Add (time since k=0) - window/2 hours.
// event is the time of the event.
time_t eventTime;
eventTime = self.queryTime + (time - MR_WINDOW / 2) *60 *60;
eventTime = self.queryTime + (time) *60 *60;
double hz, nz, dz, az;
hz = ha[0] + e * (ha[2] - ha[0]); // Azimuth of the moon at the event.