Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Julian Day
#3
(Oct-06-2016, 06:15 PM)j.crater Wrote: Nicely done sparkz_alot! Have you tested the functions against some already calculated transforms to make checks?

darn you, j.crater :naughty: , thought I covered it all. Then after reading your post, thought maybe I'd better check some more. Sure enough ran into a problem with negative years. It appears Pythons calendar.monthrange only covers the positive years 1-9999, causing:
Error:
Please enter the 4 digit year (-4712 to 2100): -1000 Please enter the digit month (1 - 12): 7 Traceback (most recent call last):   File "C:/Python/Astronomy/meeus/scratch.py", line 60, in <module>     days_in_month = monthrange(my_year, my_month)   File "C:\Python 3.5\lib\calendar.py", line 121, in monthrange     day1 = weekday(year, month, 1)   File "C:\Python 3.5\lib\calendar.py", line 113, in weekday     return datetime.date(year, month, day).weekday() ValueError: year is out of range Process finished with exit code 1
Looks like I'll have to replace the calendar library with some other way to test the "day". Thanks for the catch  :D
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition


Messages In This Thread
Julian Day - by sparkz_alot - Oct-06-2016, 03:39 PM
RE: Julian Day - by j.crater - Oct-06-2016, 06:15 PM
RE: Julian Day - by sparkz_alot - Oct-06-2016, 08:34 PM
RE: Julian Day - by j.crater - Oct-06-2016, 08:38 PM
RE: Julian Day - by Skaperen - Oct-07-2016, 04:17 AM
RE: Julian Day - by sparkz_alot - Oct-07-2016, 02:25 PM
RE: Julian Day - by Skaperen - Oct-08-2016, 01:05 AM
RE: Julian Day - by sparkz_alot - Oct-08-2016, 01:41 AM
RE: Julian Day - by Skaperen - Oct-08-2016, 04:11 AM
RE: Julian Day - by sparkz_alot - Oct-08-2016, 02:09 PM
RE: Julian Day - by Skaperen - Oct-09-2016, 02:27 AM
RE: Julian Day - by sparkz_alot - Oct-09-2016, 02:37 PM
RE: Julian Day - by Skaperen - Oct-10-2016, 02:27 AM
RE: Julian Day - by sparkz_alot - Oct-12-2016, 04:42 PM
RE: Julian Day - by Skaperen - Oct-13-2016, 03:32 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020