{"action":"opened","issue":{"url":"https://api.github.com/repos/UV-CDAT/uvcdat/issues/1155","labels_url":"https://api.github.com/repos/UV-CDAT/uvcdat/issues/1155/labels{/name}","comments_url":"https://api.github.com/repos/UV-CDAT/uvcdat/issues/1155/comments","events_url":"https://api.github.com/repos/UV-CDAT/uvcdat/issues/1155/events","html_url":"https://github.com/UV-CDAT/uvcdat/issues/1155","id":63055514,"number":1155,"title":"A seemingly OK variable will completely break DV3D","user":{"login":"jypeter","id":2785573,"avatar_url":"https://avatars.githubusercontent.com/u/2785573?v=3","gravatar_id":"","url":"https://api.github.com/users/jypeter","html_url":"https://github.com/jypeter","followers_url":"https://api.github.com/users/jypeter/followers","following_url":"https://api.github.com/users/jypeter/following{/other_user}","gists_url":"https://api.github.com/users/jypeter/gists{/gist_id}","starred_url":"https://api.github.com/users/jypeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jypeter/subscriptions","organizations_url":"https://api.github.com/users/jypeter/orgs","repos_url":"https://api.github.com/users/jypeter/repos","events_url":"https://api.github.com/users/jypeter/events{/privacy}","received_events_url":"https://api.github.com/users/jypeter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-19T18:13:33Z","updated_at":"2015-03-19T18:13:33Z","closed_at":null,"body":"We have found a variable that will completely break DV3D: we get the following message and core dump\r\n```\r\nWarning, can't open data file 'None'\r\nterminate called after throwing an instance of 'std::bad_alloc'\r\n  what():  std::bad_alloc\r\nAbort (core dumped)\r\n```\r\nThe variable can be downloaded with\r\n\r\n    wget http://dods.ipsl.jussieu.fr/brocksce/tmp/temp.nc\r\n\r\nThe variable seems OK and vcs will not complain when plotting 2D slices of the variable. DV3D will work again if we create the axes of the variable from scratch, to create a new variable, so there must be some metadata in the original variable that DV3D is not happy with\r\n\r\nYou can use the following script to reproduce the crash, or try to plot the corrected variable\r\n```\r\n#!/usr/bin/env python\r\n\r\nimport numpy as np\r\nimport cdms2, vcs, sys\r\n\r\n# A variable that dv3d is happy with\r\nf = cdms2.open( sys.prefix+\"/sample_data/geos5-sample.nc\" )\r\nv_ok = f('uwnd')\r\nf.close()\r\n\r\nprint '=== Some information about a variable that works in dv3d:'\r\nv_ok.info()\r\n\r\n# A variable that will break dv3d\r\n# wget http://dods.ipsl.jussieu.fr/brocksce/tmp/temp.nc\r\nf = cdms2.open(\"./temp.nc\" )\r\nv_pb = f('TEMP', longitude=(0, 360, 'co'))\r\nf.close()\r\n\r\nprint '\\n=== Some information about the variable that breaks dv3d:\\n'\r\nv_pb.info()\r\n\r\n# Replacing the axes of the 'buggy' variable will make dv3d happy again\r\nnew_lon = cdms2.createUniformLongitudeAxis(0.5, 360, 1.)\r\nnew_lat = cdms2.createUniformLatitudeAxis(-89.5, 180, 1.)\r\nnew_lev = cdms2.createAxis(v_pb.getLevel()[:], id='level')\r\nnew_lev.designateLevel()\r\nnew_lev.units = 'meters'\r\nv_corrected = cdms2.createVariable(v_pb, axes=(new_lev, new_lat, new_lon), id='TEMP')\r\n\r\nprint '\\n=== Some information about the corrected variable:'\r\nv_corrected.info()\r\n\r\ndv3d = vcs.get3d_scalar()\r\n\r\nx = vcs.init()\r\n\r\nraw_input('\\n\\nPress return to try to plot the buggy variable, or CTRL-C')\r\nx.plot(v_pb, dv3d)\r\nx.interact()\r\n\r\n# The end\r\n```\r\nRunning the script will produce the following output (including the variables **v.info()** output):\r\n```\r\n>python -i pb_dv3d_crash.py\r\n=== Some information about a variable that works in dv3d:\r\n*** Description of Slab uwnd ***\r\nid: uwnd\r\nshape: (1, 14, 181, 360)\r\nfilename: \r\nmissing_value: 1e+15\r\ncomments: \r\ngrid_name: <None>\r\ngrid_type: generic\r\ntime_statistic: \r\nlong_name: Zonal Wind\r\nunits: m/s\r\n_FillValue: [  9.99999987e+14]\r\nautoApiInfo: <AutoAPI.AutoAPI.Info instance at 0x7fb2fd263998>\r\nvmin: [  9.99999987e+14]\r\ntileIndex: None\r\nvmax: [  9.99999987e+14]\r\nfmissing_value: [  9.99999987e+14]\r\nGrid has Python id 0x7fb2fde84e10.\r\nGridtype: generic\r\nGrid shape: (181, 360)\r\nOrder: yx\r\n** Dimension 1 **\r\n   id: time\r\n   Designated a time axis.\r\n   units:  minutes since 2011-05-01 00:00:00\r\n   Length: 1\r\n   First:  0\r\n   Last:   0\r\n   Other axis attributes:\r\n      begin_date: [20110501]\r\n      begin_time: [0]\r\n      long_name: time\r\n      time_increment: [60000]\r\n      calendar: gregorian\r\n      axis: T\r\n   Python id:  0x7fb2da908490\r\n** Dimension 2 **\r\n   id: lev\r\n   Designated a level axis.\r\n   units:  mb\r\n   Length: 14\r\n   First:  10.0\r\n   Last:   1000.0\r\n   Other axis attributes:\r\n      positive: down\r\n      axis: Z\r\n      long_name: vertical level\r\n   Python id:  0x7fb2da908e90\r\n** Dimension 3 **\r\n   id: lat\r\n   Designated a latitude axis.\r\n   units:  degrees_north\r\n   Length: 181\r\n   First:  -90.0\r\n   Last:   90.0\r\n   Other axis attributes:\r\n      long_name: latitude\r\n      axis: Y\r\n   Python id:  0x7fb2da908f50\r\n** Dimension 4 **\r\n   id: lon\r\n   Designated a longitude axis.\r\n   units:  degrees_east\r\n   Length: 360\r\n   First:  0.0\r\n   Last:   359.0\r\n   Other axis attributes:\r\n      long_name: longitude\r\n      axis: X\r\n      modulo: 360.0\r\n      topology: circular\r\n   Python id:  0x7fb2da908850\r\n*** End of description for uwnd ***\r\n\r\n=== Some information about the variable that breaks dv3d:\r\n\r\n*** Description of Slab TEMP ***\r\nid: TEMP\r\nshape: (20, 180, 360)\r\nfilename: \r\nmissing_value: [ -1.00000000e+10]\r\ncomments: \r\ngrid_name: <None>\r\ngrid_type: generic\r\ntime_statistic: \r\nlong_name: TEMPERATURE\r\nunits: DEG C\r\n_FillValue: [ -1.00000000e+10]\r\nautoApiInfo: <AutoAPI.AutoAPI.Info instance at 0x7fb2da979248>\r\ntileIndex: None\r\nhistory: From /usr/local/install/ferret-6.9/data/levitus_climatology.cdf\r\nGrid has Python id 0x7fb2da916c90.\r\nGridtype: generic\r\nGrid shape: (180, 360)\r\nOrder: yx\r\n** Dimension 1 **\r\n   id: ZAXLEVITR\r\n   Designated a level axis.\r\n   units:  meters\r\n   Length: 20\r\n   First:  0.0\r\n   Last:   5000.0\r\n   Other axis attributes:\r\n      positive: down\r\n      point_spacing: uneven\r\n      standard_name: depth\r\n      axis: Z\r\n   Python id:  0x7fb2fde84dd0\r\n** Dimension 2 **\r\n   id: YAXLEVITR\r\n   Designated a latitude axis.\r\n   units:  degrees_north\r\n   Length: 180\r\n   First:  -89.5\r\n   Last:   89.5\r\n   Other axis attributes:\r\n      standard_name: latitude\r\n      point_spacing: even\r\n      axis: Y\r\n   Python id:  0x7fb2da908090\r\n** Dimension 3 **\r\n   id: XAXLEVITR\r\n   Designated a longitude axis.\r\n   units:  degrees_east\r\n   Length: 360\r\n   First:  0.5\r\n   Last:   359.5\r\n   Other axis attributes:\r\n      modulo: 360.0\r\n      point_spacing: even\r\n      standard_name: longitude\r\n      axis: X\r\n      topology: circular\r\n   Python id:  0x7fb2da908310\r\n*** End of description for TEMP ***\r\n\r\n=== Some information about the corrected variable:\r\n*** Description of Slab TEMP ***\r\nid: TEMP\r\nshape: (20, 180, 360)\r\nfilename: \r\nmissing_value: [ -1.00000000e+10]\r\ncomments: \r\ngrid_name: <None>\r\ngrid_type: generic\r\ntime_statistic: \r\nlong_name: TEMPERATURE\r\nunits: DEG C\r\nautoApiInfo: <AutoAPI.AutoAPI.Info instance at 0x7fb2da979638>\r\ntileIndex: None\r\nhistory: From /usr/local/install/ferret-6.9/data/levitus_climatology.cdf\r\nGrid has Python id 0x7fb2da916c90.\r\nGridtype: generic\r\nGrid shape: (180, 360)\r\nOrder: yx\r\n** Dimension 1 **\r\n   id: level\r\n   Designated a level axis.\r\n   units:  meters\r\n   Length: 20\r\n   First:  0.0\r\n   Last:   5000.0\r\n   Other axis attributes:\r\n      axis: Z\r\n   Python id:  0x7fb2da916090\r\n** Dimension 2 **\r\n   id: latitude\r\n   Designated a latitude axis.\r\n   units:  degrees_north\r\n   Length: 180\r\n   First:  -89.5\r\n   Last:   89.5\r\n   Other axis attributes:\r\n      axis: Y\r\n   Python id:  0x7fb2da916210\r\n** Dimension 3 **\r\n   id: longitude\r\n   Designated a longitude axis.\r\n   units:  degrees_east\r\n   Length: 360\r\n   First:  0.5\r\n   Last:   359.5\r\n   Other axis attributes:\r\n      axis: X\r\n      modulo: 360.0\r\n      topology: circular\r\n   Python id:  0x7fb2fde84d90\r\n*** End of description for TEMP ***\r\n\r\n```"}}