iris: Error loading NSDIC-0116-nh data. CRS AXIS UNKNOWN (polar-grid)

🐛 Bug Report

I am trying to load the NSIDC-0116-nh raw data into a cube. Iris fails with the following error: This is a CRS error from pyproj (v3.5.0).

CRSError: Invalid projection: PROJCS["NSIDC EASE-Grid North",GEOGCS["Unspecified datum based upon the International 1924 Authalic Sphere",DATUM["Not_specified_based_on_International_1924_Authalic_Sphere",SPHEROID["International 1924 Authalic Sphere",6371228,0,AUTHORITY["EPSG","7057"]],AUTHORITY["EPSG","6053"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4053"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["latitude_of_center",90],PARAMETER["longitude_of_center",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["EPSG","3408"],AXIS["X",UNKNOWN],AXIS["Y",UNKNOWN]]: (Internal Proj Error: proj_create: unhandled axis direction: UNKNOWN)

Full Traceback: traceback.txt

How To Reproduce

Steps to reproduce the behaviour:

  1. Download data from https://nsidc.org/data/nsidc-0116/versions/4
import iris 
cubes = iris.load("icemotion_daily_nh_25km_19790101_19791231_v4.1.nc")

Expected behaviour

Should load data.

Screenshots

Environment

  • Iris Version: 3.6.0

Additional context

This is used by the NSDIC cmoriser in ESMValTool

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 24 (9 by maintainers)

Commits related to this issue

Most upvoted comments

pyproj4/pyproj#1328

Thanks for sending the file over. This enabled us to step through and experiment; the problem is because Proj does not accept leading spaces in WKT strings, so the crs_wkt attribute on the crs variable:

 PROJCS["NSIDC EASE-Grid South",GEOGCS["Unspecified datum based upon the International 1924 Authalic Sphere",DATUM["Not_specified_based_on_International_1924_Authalic_Sphere",SPHEROID["International 1924 Authalic Sphere",6371228,0,AUTHORITY["EPSG","7057"]],AUTHORITY["EPSG","6053"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4053"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["latitude_of_center",-90],PARAMETER["longitude_of_center",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["EPSG","3409"],AXIS["X",UNKNOWN],AXIS["Y",UNKNOWN]] 

… is invalid. If the leading space is removed, the file loads fine.

Iris has been handling WKT for over a year (#4704) but this is the first time the problem has been reported, which suggests that either:

  • Most crs_wkt attributes are correctly formatted for Proj to handle.
  • Users don’t often use Iris to load files with crs_wkt attributes.

I’d like to draw on ESMValTool’s rich experience with file formats here: would you expect this problem to crop up more often in future, or is there a specific problem with NSIDC-0116-nh files?

@rbeucher just to let you know we have some scheduled time to investigate this later in the month.

I could also reproduce this with iris 3.4.1 and 3.6.0, used in recent ESMValTool installations. The dataset could be loaded successfully with iris 3.2.1 that we were using for ESMValTool v2.7