-
Notifications
You must be signed in to change notification settings - Fork 96
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
AreaDefinition.__contains__ raises ValueError #268
Comments
Are the input coordinates (the ones passed to contains) meant to be X/Y or lon/lat? Side note: I didn't know this existed. |
It's supposed to be
It's missing from the API documentation though, perhaps due to special methods such as |
Although that doc applies to |
Is this full disk ABI data? I have a feeling a check needs to be added to see if the corners are valid lon/lats: pyresample/pyresample/geometry.py Lines 318 to 339 in 3d6d38d
The |
Yes, it's full disk ABI, but I also encountered the problem with less-than-full-disk areas, probably whenever not all corners are valid lat/lons. |
Exactly |
Code Sample, a minimal, complete, and verifiable piece of code
Problem description
The code fails with a
ValueError: Illegal (lon, lat) coordinates: (inf, inf)
, thrown by pyresample'sspherical_geometry
module. This happens both when the coordinates are inside or outside the area.Expected Output
I would expect the output to be either
True
orFalse
depending on to whether the coordinates(0, 40)
are within the area, in other words, visible by ABI. I can still achieve this by attemptingarea.get_xy_from_lonlat(...)
and catching the possibly resultingValueError
, as follows:I would expect an OverflowError or ValueError if lat/lon passed are out of valid range, a ValueError if they are nan, and a TypeError if they are not numbers.
Actual Result, Traceback if applicable
Versions of Python, package at hand and relevant dependencies
Python 3.8.2, pyresample 1.15.0.
The text was updated successfully, but these errors were encountered: