-
Notifications
You must be signed in to change notification settings - Fork 94
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
What units does SphPolygon.area return? #390
Comments
Skimming the paper referenced in the docstring I found:
|
I haven't specified any radius. Maybe pyresample uses some default? |
The default radius for SphPolygon's is 1. You can either specify a different spheroid radius to the return (sum(alpha) - (len(self.lon) - 2) * np.pi) * self.radius ** 2 |
I see, I can pass my own radius. Is that a supported feature? I tend to be hesitant to rely on undocumented API. |
Passing radius works:
results in
which is a match. |
I'll make a small PR improving the documentation. |
I also made a typo in my original MCVE, the surface area should have been 5.1e8 not 1.5e8... without that typo, I would have had a match in my initial post! That goes to show it's time for the weekend... |
The units returned by
SphPolygon.area
are not documented and not obvious.Code Sample, a minimal, complete, and verifiable piece of code
In this MCVE, I construct a quadrangle near
(0, 0)
with an edge of 0.001 degrees. At such a small area, we can approximate the Earth as flat, so I can compare the polygon area calculated with pyresample against a multiplication of the lengths of the edges of the quadrangle. However, the results are very different.Problem description
I don't know the units of the result. The units are not documented at https://pyresample.readthedocs.io/en/latest/api/pyresample.html?highlight=SphPolygon#pyresample.spherical.SphPolygon.area. It's clearly not km². I thought it might be steradian, but multiplying by the surface of the Earth then dividing by 4π (or 2τ) doesn't yield a consistent result either.
Expected Output
I expect an output that I can interpret with documented units. The surface area of the indicated polygon should be in the order of 0.012 km² (Euclidian approximation), but I can't find an explicable conversion factor between the two numbers.
Actual Result, Traceback if applicable
0.003636094926640598
0.01236430006718607
Versions of Python, package at hand and relevant dependencies
Pyresample 1.22 on Python 3.9.7.
The text was updated successfully, but these errors were encountered: