{"action":"created","issue":{"url":"https://api.github.com/repos/UV-CDAT/cdms/issues/32","repository_url":"https://api.github.com/repos/UV-CDAT/cdms","labels_url":"https://api.github.com/repos/UV-CDAT/cdms/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/UV-CDAT/cdms/issues/32/comments","events_url":"https://api.github.com/repos/UV-CDAT/cdms/issues/32/events","html_url":"https://github.com/UV-CDAT/cdms/issues/32","id":191079445,"number":32,"title":"File open fails when lon and lat are variables (not dimensions)","user":{"login":"durack1","id":3229632,"avatar_url":"https://avatars.githubusercontent.com/u/3229632?v=3","gravatar_id":"","url":"https://api.github.com/users/durack1","html_url":"https://github.com/durack1","followers_url":"https://api.github.com/users/durack1/followers","following_url":"https://api.github.com/users/durack1/following{/other_user}","gists_url":"https://api.github.com/users/durack1/gists{/gist_id}","starred_url":"https://api.github.com/users/durack1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/durack1/subscriptions","organizations_url":"https://api.github.com/users/durack1/orgs","repos_url":"https://api.github.com/users/durack1/repos","events_url":"https://api.github.com/users/durack1/events{/privacy}","received_events_url":"https://api.github.com/users/durack1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-22T17:54:43Z","updated_at":"2016-11-22T21:58:28Z","closed_at":null,"body":"The attached file is unreadable in the current version of cdms2 (v2.8). I believe the issue is that the variables (not dimensions) `lon` and `lat` included in the file are assumed to be standard dimensions (which they aren't), and these assumptions lead to a read failure.\r\n\r\n[cdmsReadFail.zip](https://github.com/UV-CDAT/cdms/files/607164/cdmsReadFail.zip)\r\n\r\nThe file looks like:\r\n```\r\nncdump -h 161122_RobertPincus_multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-20161122_none.nc \r\nnetcdf \\161122_RobertPincus_multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-20161122_none {\r\ndimensions:\r\n\texpt = 18 ;\r\n\tlevel = 61 ;\r\n\tlayer = 60 ;\r\n\tsite = 100 ;\r\nvariables:\r\n\tfloat lon(site) ;\r\n\t\tlon:long_name = \"ERA-Interim longitude\" ;\r\n\t\tlon:units = \"degree_north\" ;\r\n\t\tlon:standard_name = \"longitude\" ;\r\n\tfloat lat(site) ;\r\n\t\tlat:long_name = \"ERA-Interim latitude\" ;\r\n\t\tlat:units = \"degree_east\" ;\r\n\t\tlat:standard_name = \"latitude\" ;\r\n\tfloat time(site) ;\r\n\t\ttime:long_name = \"ERA-Interim fractional day of the year 2014\" ;\r\n\t\ttime:units = \"days since 2014-1-1 0:0:0\" ;\r\n\t\ttime:standard_name = \"time\" ;\r\n\t\ttime:calendar = \"gregorian\" ;\r\n\tfloat sst(site) ;\r\n\t\tsst:title = \"sea surface temperature\" ;\r\n\t\tsst:units = \"K\" ;\r\n\t\tsst:long_name = \"ERA-Interim sea surface temperature (= \\\"missing_value\\\" over land)\" ;\r\n\t\tsst:standard_name = \"sea_surface_temperature\" ;\r\n\t\tsst:missing_value = -9.99f ;\r\n\t\tsst:FillValue = -9.99f ;\r\n\t\tsst:coordinates = \"lon lat time\" ;\r\n...\r\n```\r\nAnd the read failure looks like:\r\n```python\r\nIn [1]: infile = '161122_RobertPincus_multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-20161122_none.nc'\r\nIn [2]: import cdms2 as cdm\r\nIn [3]: f = cdm.open(infile)\r\n---------------------------------------------------------------------------\r\nCDMSError                                 Traceback (most recent call last)\r\n<ipython-input-3-da3bd29babf2> in <module>()\r\n----> 1 f = cdm.open(infile)\r\n/uvcdat280/lib/python2.7/site-packages/cdms2/dataset.pyc in openDataset(uri, mode, template, dods, dpath, hostObj)\r\n    357 \r\n    358             # The file exists\r\n--> 359             file1 = CdmsFile(path, \"r\")\r\n    360             if libcf is not None:\r\n    361                 if hasattr(file1, libcf.CF_FILETYPE):\r\n/uvcdat280/lib/python2.7/site-packages/cdms2/dataset.pyc in __init__(self, path, mode, hostObj, mpiBarrier)\r\n   1137                 # Get grid information for the variable. gridkey has the form\r\n   1138                 # (latname,lonname,order,maskname, abstract_class).\r\n-> 1139                 gridkey, lat, lon = var.generateGridkey(self._convention_, self.variables)\r\n   1140 \r\n   1141                 # If the variable is gridded, lookup the grid. If no such grid exists,\r\n/uvcdat280/lib/python2.7/site-packages/cdms2/avariable.pyc in generateGridkey(self, convention, vardict)\r\n    239         lon, nlon = convention.getVarLonId(self, vardict)\r\n    240         if (lat is not None) and (lat is lon):\r\n--> 241             raise CDMSError, \"Axis %s is both a latitude and longitude axis! Check standard_name and/or axis attributes.\"%lat.id\r\n    242 \r\n    243         # Check for 2D grid\r\nCDMSError: Axis lon is both a latitude and longitude axis! Check standard_name and/or axis attributes.\r\n```"},"comment":{"url":"https://api.github.com/repos/UV-CDAT/cdms/issues/comments/262378213","html_url":"https://github.com/UV-CDAT/cdms/issues/32#issuecomment-262378213","issue_url":"https://api.github.com/repos/UV-CDAT/cdms/issues/32","id":262378213,"user":{"login":"dnadeau4","id":6933634,"avatar_url":"https://avatars.githubusercontent.com/u/6933634?v=3","gravatar_id":"","url":"https://api.github.com/users/dnadeau4","html_url":"https://github.com/dnadeau4","followers_url":"https://api.github.com/users/dnadeau4/followers","following_url":"https://api.github.com/users/dnadeau4/following{/other_user}","gists_url":"https://api.github.com/users/dnadeau4/gists{/gist_id}","starred_url":"https://api.github.com/users/dnadeau4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnadeau4/subscriptions","organizations_url":"https://api.github.com/users/dnadeau4/orgs","repos_url":"https://api.github.com/users/dnadeau4/repos","events_url":"https://api.github.com/users/dnadeau4/events{/privacy}","received_events_url":"https://api.github.com/users/dnadeau4/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T21:58:28Z","updated_at":"2016-11-22T21:58:28Z","body":"`degree_north` and `degree_east` are accepted and CDMS2 should work with this file. [cf-conventions](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.6/build/cf-conventions.html)\r\n\r\nI will enhanced CDMS2 to make sure your lat/lon are detected correctly"}}
{"actor":{"display_login":"dnadeau4"}}