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

TypeError calculating sunlight coverage when no pytroll-schedule installed #132

Open
gerritholl opened this issue Dec 29, 2021 · 0 comments

Comments

@gerritholl
Copy link
Collaborator

gerritholl commented Dec 29, 2021

Describe the bug

When I try to calculate sunlight coverage while pytroll-schedule is not installed, I get a TypeError.

To Reproduce

from pyresample import create_area_def
from pyproj import CRS
from trollflow2.plugins import _get_sunlight_coverage
from datetime import datetime
euro4326 = create_area_def(
        "epsg4326europa",
        CRS.from_epsg(4326),
        resolution=1/128,
        area_extent=(-10, 40, 20, 60),
        proj_id="EQC_PLAT")
print(_get_sunlight_coverage(euro4326, datetime(2021, 12, 29, 12)))

Expected behavior

Some number between 0 and 1.

Actual results

Traceback (most recent call last):
  File "/data/gholl/checkouts/protocode/mwe/trollflow2-sunlight-typerror.py", line 11, in <module>
    print(_get_sunlight_coverage(euro4326, datetime(2021, 12, 29, 12)))
  File "/data/gholl/checkouts/trollflow2/trollflow2/plugins/__init__.py", line 666, in _get_sunlight_coverage
    poly = get_twilight_poly(start_time)
TypeError: 'NoneType' object is not callable

Environment Info:

  • OS: openSUSE Leap 15.3
  • Trollflow2 Version: 0.12.0
  • Pyresample Version: 1.22.3

Additional context

Found this when calling _get_sunlight_coverage directly to find out why it gives 0 for me in the middle of the day. Perhaps there will be a new issue soon...

@gerritholl gerritholl changed the title TypeError calculating sunlight coverage TypeError calculating sunlight coverage when no pytroll-schedule installed Dec 29, 2021
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