Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sun rise and set cal error #82

Open
Water-Ghost opened this issue Nov 16, 2022 · 0 comments
Open

Sun rise and set cal error #82

Water-Ghost opened this issue Nov 16, 2022 · 0 comments

Comments

@Water-Ghost
Copy link

Sunset and sunrise calculations occurred error

The code are below:

    day = datetime.date(2024, 3, 22)
    lat = 38.41129869
    lon =  90.137575
    city = LocationInfo('name', 'region', 'timezone/name', lat, lon)
    try:
        s = sun(city.observer, day, tzinfo=timezone(timedelta(hours=8)))
        r = {}
        r.update({'sunset': s['sunset'].replace(tzinfo=None),
                  'sunrise': s['sunrise'].replace(tzinfo=None), })
    except ValueError as e:
        logger.exception(e)

The error

ValueError: Unable to find a sunrise time on the date specified

Other parameters also have this error, like:

day,lat,lon
2028-04-07,44.6072919,82.894195
2013-03-05,36.38176111,96.44025556
2010-04-16,41.17189303,80.25687664
2011-04-29,39.714734,76.167327
2018-01-20,39.16666666,109.05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant