Calculate day of the week from Julian Day
There’s an easy way to calculate the day of the week given a Julian Day. If you simply add 1.5 to the Julian Day and do a mod 7 division, the remainder indicates the day of the week with 0 for Sunday … 6 for Saturday.
Example, January 29th 2023, Forth and Python.
2023 1 29 jdn f.s <1> 2.4599735000E6 ok f:1
1.5E f+ f>d 7 mod . 0 ok 1
The remainder is 0, hence this day is a Sunday.
Now in Python, with astropy special sauce:
In [55]: Time("2023-01-29 00:00:00").jd
Out[55]: 2459973.5
In [56]: (Time("2023-01-29 00:00:00").jd + 1.5) % 7
Out[56]: 0.0