Repository navigation
Description
One other question I had was with regard to the generation of the actual latitude/longitude values- in particular with respect to the definition of the spheroid/ellipsoid used. I traced this back to here:
MetPy/src/metpy/plots/mapping.py
Line 45 in 852e2ce
| def cartopy_globe(self): |
If I do not supply an 'earth_radius' kwarg, it looks like cartopy_globe() will set the ellipse to a sphere but not set any of the semimajor_axis, etc... kwargs if I do not provide them. I am unsure what it uses then, as the radius of the Earth. Cartopy documentation notes semimajor_axis is set to None by default, but perhaps it uses the semimajor_axis from WGS84 in this case?
Either way, my question is why I do not see changes in the actual latitude/longitude values when I change the kwargs provided to cartopy_globe(). I ran three tests:
- Provide "earth_radius" in the cf proj params
- Provide "semimajor_axis" in the cf proj params
- Provide neither of the above in the cf proj params
I chose a value of 6371229.0m for tests 1 and 2 (which is different than what WGS84 uses), and received the same latitude/longitude values for all three tests. What this tells me is that tests 1 and 2 are having no effect on the definition of the globe and/or the coordinate transformation occurring, because the values are identical to test 3. The caveat here is that I was only able to understand everything up until this line:
Line 896 in 852e2ce
| lonlats = ccrs.Geodetic(globe=da.metpy.cartopy_globe).transform_points( |
I added some code to prove to myself that the semimajor_axis attribute of the Globe object was equal to 6371229.0m each time cartopy_globe() was called for tests 1 and 2. For test 3 it looks like it is set to "None" if I do not provide anything explicit. Again, I am unsure what is used when "None" is returned but I have to imagine something is assumed.
Given I proved the globe has the correct semimajor_axis when I provide it via either "semimajor_axis" or "earth_radius", I am leaning towards something weird happening in the coordinate transformation rather than the globe generation.
Originally posted by @DanielAdriaansen in #1090 (comment)
Activity
DanielAdriaansen commentedon Jan 23, 2020
I think this was user error and not a problem with Xarray globe handling. See details here in #1090 (comment).
This issue can be closed I believe.