Skip to content

Handle missing latlon projection #1039

Closed

Description

@dopplershift

Some data from TDS doesn’t include the LatLon_Projection variable listed for grid_mapping. While this isn’t CF compliant, it’d be simple enough to handle this one-off. In the case where this particular variable can’t be found, we could synthesize something appropriate.

Activity

  1. added
    Area: ProjectionsPertains to projecting coordinates between coordinate systems
    Type: EnhancementEnhancement to existing functionality
    on May 14, 2019
  2. added this to the 0.11 milestone on May 14, 2019
  3. dopplershift commented on May 14, 2019

    @dopplershift
    MemberAuthor

    Another option is to treat this like the case where no grid_mapping itself.

  4. zbruick commented on Jun 18, 2019

    @zbruick
    Contributor

    Just looked at the GFS data on the Thredds server used in the Q-vector example and it shows the LatLon_Projection value for grid_mapping. @kgoebber, was this the file that was giving you issues, or can you point me to a problematic one?

  5. kgoebber commented on Jun 18, 2019

    @kgoebber
    Collaborator

    That was the file and the problem I was having was that I added a variable to the dataset without adding the pertinent coordinates and attribute information to make it work. With seeing the warning of 'Could not find variable corresponding to the value of grid_mapping: LatLon_Projection' I thought it was intrinsically linked to problems "reading" the projection. Instead the problem was I didn't properly name the coords. So I don't think there is an issue, but it might be good to add to the warning statement when it does move forward and is assuming lat/lon coordinates to help with reading warning/error messages.

    Adding something to xarray.py around line 370:

    log.warning('Found lat/lon values, assuming latitude_longitude '
                'for projection grid_mapping variable. ')
    

    This will let the user know that it didn't completely fail and is proceeding under the assumed settings.

  6. zbruick commented on Jun 18, 2019

    @zbruick
    Contributor

    Thanks - made perfect sense. PR is in with this simple addition

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

    Area: ProjectionsPertains to projecting coordinates between coordinate systemsType: EnhancementEnhancement to existing functionality

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions