def equinox(jd, season, delta): """Return the precise moment of an equinox or solstice event on Earth. Parameters: - `jd` : Julian of an approximate time of the event in dynamical time - `season` : one of ("spring", "summer", "autumn", "winter") - `delta` : the required precision in days. Times accurate to a second are reasonable when using the VSOP model. Returns: - Julian Day : (int) dynamical time """ # # If we knew that the starting approximate time was close enough # to the actual time, we could pull nutation_in_longitude() and the # aberration out of the loop and save some calculating. # circ = _circle[season] sun = Sun() for i in range(20): jd0 = jd L, B, R = sun.dimension3(jd) L += nutation_in_longitude(jd) + aberration_low(R) L, B = vsop_to_fk5(jd, L, B) # Meeus uses jd + 58 * sin(diff(...)) jd += diff_angle(L, circ) * _k_sun_motion if abs(jd - jd0) < delta: return jd raise Error("bailout")
def _longitude(self, jd): """Return the geocentric ecliptic longitude in radians. """ from astronomia.nutation import nutation_in_longitude T = jd_to_jcent(jd) L1, D, M, M1, F, A1, A2, A3, E, E2 = _constants(T) lsum = 0.0 for tD, tM, tM1, tF, tl, tr in _tblLR: arg = tD * D + tM * M + tM1 * M1 + tF * F if abs(tM) == 1: tl *= E elif abs(tM) == 2: tl *= E2 lsum += tl * np.sin(arg) lsum += 3958*np.sin(A1) + 1962*np.sin(L1 - F) + 318*np.sin(A2) nutinlong = nutation_in_longitude(jd) longitude = L1 + d_to_r(lsum / 1000000) + nutinlong return longitude
def _longitude(self, jd): """Return the geocentric ecliptic longitude in radians. """ from astronomia.nutation import nutation_in_longitude T = jd_to_jcent(jd) L1, D, M, M1, F, A1, A2, A3, E, E2 = _constants(T) lsum = 0.0 for tD, tM, tM1, tF, tl, tr in _tblLR: arg = tD * D + tM * M + tM1 * M1 + tF * F if abs(tM) == 1: tl *= E elif abs(tM) == 2: tl *= E2 lsum += tl * np.sin(arg) lsum += 3958 * np.sin(A1) + 1962 * np.sin(L1 - F) + 318 * np.sin(A2) nutinlong = nutation_in_longitude(jd) longitude = L1 + d_to_r(lsum / 1000000) + nutinlong return longitude