Skip to content

Xarray globe handling problems #1308

Closed
Closed

Description

@dopplershift

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:

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:

  1. Provide "earth_radius" in the cf proj params
  2. Provide "semimajor_axis" in the cf proj params
  3. 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:

lonlats = ccrs.Geodetic(globe=da.metpy.cartopy_globe).transform_points(
at which point I was unable to follow what was going on under the hood any further.

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

  1. DanielAdriaansen commented on Jan 23, 2020

    @DanielAdriaansen
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Not A BugDescribes behavior that is working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions