0
$\begingroup$

so i found this code and even looked up the documentation on swe_suncross() most i've seen its - 88 degrees but can one determine this using any degrees


# set ephemeris files path
swe.set_ephe_path('~/Downaloads/swisseph-master/')

# birth time as Julian day number (UT), for example
birth_t = swe.julday(1988, 6, 12, 5.5)
# sun longitude at birth
sun_longitude = swe.calc_ut(birth_t, swe.SUN)[0][0]
# longitude searched
xlon = swe.degnorm(sun_longitude - 88)
# start search 90 deays prior to birth
tstart = birth_t - 90
# find exact crossing time
res = swe.solcross_ut(xlon, tstart)
# turn it into a date
date = swe.revjul(res)

print("Year:", date[0], "Month:", date[1], "Day:", date[2], "Hour:", date[3])

and i get sent in the future ???

Year: 1989 Month: 3 Day: 14 Hour: 1.8550639897584915

i have tried other numbers( less than 88 ) and was still in the future .. what am I doing wrong ?

$\endgroup$
7
  • $\begingroup$ This question is more about general debugging than astronomy. Inspect your intermediate values. I think you'll find xlon is 353.5. $\endgroup$
    – Mike G
    Commented Sep 24, 2023 at 3:36
  • $\begingroup$ Mike the xlong checks out, however the rest is way off Year: 1989 Month: 3 Day: 14 Time: 1 hours 51 minutes 18 seconds Sun Longitude at Birth: 81.46587046324426 xlon: 353.46587046324424 tstart: 2447234.7291666665 Result (Julian Day Number): 2447599.577294333 thank you for the help tho <3 $\endgroup$
    – dimitri33
    Commented Sep 24, 2023 at 5:43
  • $\begingroup$ What's the Sun's longitude at tstart? $\endgroup$
    – Mike G
    Commented Sep 24, 2023 at 12:06
  • $\begingroup$ Sun Longitude at tstart: 353.8554640836316 $\endgroup$
    – dimitri33
    Commented Sep 24, 2023 at 15:24
  • $\begingroup$ So at tstart the Sun is 0.39° past xlon and it takes another year to get there again. $\endgroup$
    – Mike G
    Commented Sep 24, 2023 at 15:45

0

You must log in to answer this question.

Browse other questions tagged .