{"action":"created","issue":{"url":"https://api.github.com/repos/Unidata/MetPy/issues/883","repository_url":"https://api.github.com/repos/Unidata/MetPy","labels_url":"https://api.github.com/repos/Unidata/MetPy/issues/883/labels{/name}","comments_url":"https://api.github.com/repos/Unidata/MetPy/issues/883/comments","events_url":"https://api.github.com/repos/Unidata/MetPy/issues/883/events","html_url":"https://github.com/Unidata/MetPy/issues/883","id":338406105,"node_id":"MDU6SXNzdWUzMzg0MDYxMDU=","number":883,"title":"Fix/improvement to advanced_sounding example","user":{"login":"eliteuser26","id":31997745,"node_id":"MDQ6VXNlcjMxOTk3NzQ1","avatar_url":"https://avatars0.githubusercontent.com/u/31997745?v=4","gravatar_id":"","url":"https://api.github.com/users/eliteuser26","html_url":"https://github.com/eliteuser26","followers_url":"https://api.github.com/users/eliteuser26/followers","following_url":"https://api.github.com/users/eliteuser26/following{/other_user}","gists_url":"https://api.github.com/users/eliteuser26/gists{/gist_id}","starred_url":"https://api.github.com/users/eliteuser26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliteuser26/subscriptions","organizations_url":"https://api.github.com/users/eliteuser26/orgs","repos_url":"https://api.github.com/users/eliteuser26/repos","events_url":"https://api.github.com/users/eliteuser26/events{/privacy}","received_events_url":"https://api.github.com/users/eliteuser26/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-05T02:15:55Z","updated_at":"2018-07-05T16:36:50Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In its current state, when running the Advanced_sounding.py example in the Metpy Github or on the example web site, it is generating an error in the code. These are the versions of the code used:\r\n\r\n```\r\nmetpy v0.8\r\npint v0.8.1\r\nmatplotlib v2.2.2\r\npython v2.7.15\r\nnumpy v1.12.1\r\n```\r\n\r\nHere is a copy of the error:\r\n```\r\nRuntimeWarning: invalid value encountered in absolute\r\n  if np.greater(np.nanmax(np.abs(value)), max_radians):\r\nTraceback (most recent call last):\r\n  File \"<ipython-input-1-a0b3740076d3>\", line 1, in <module>\r\n    runfile('Z:/Python_Scripts/soundings/test_sounding.py', wdir='Z:/Python_Scripts/soundings')\r\n  File \"C:\\Users\\Claude\\Miniconda2\\envs\\wxapp\\lib\\site-packages\\spyder\\utils\\site\\sitecustomize.py\", line 705, in runfile\r\n    execfile(filename, namespace)\r\n  File \"C:\\Users\\Claude\\Miniconda2\\envs\\wxapp\\lib\\site-packages\\spyder\\utils\\site\\sitecustomize.py\", line 87, in execfile\r\n    exec(compile(scripttext, filename, 'exec'), glob, loc)\r\n  File \"Z:/Python_Scripts/soundings/test_sounding.py\", line 19, in <module>\r\n    np.deg2rad(df['direction']))\r\n  File \"C:\\Users\\Claude\\Miniconda2\\envs\\wxapp\\lib\\site-packages\\metpy\\xarray.py\", line 138, in wrapper\r\n    return func(*args, **kwargs)\r\n  File \"C:\\Users\\Claude\\Miniconda2\\envs\\wxapp\\lib\\site-packages\\metpy\\calc\\basic.py\", line 115, in get_wind_components\r\n    wdir = _check_radians(wdir, max_radians=4 * np.pi)\r\n  File \"C:\\Users\\Claude\\Miniconda2\\envs\\wxapp\\lib\\site-packages\\metpy\\calc\\basic.py\", line 584, in _check_radians\r\n    if np.greater(np.nanmax(np.abs(value)), max_radians):\r\n  File \"C:\\Users\\Claude\\Miniconda2\\envs\\wxapp\\lib\\site-packages\\pandas\\core\\generic.py\", line 1573, in __nonzero__\r\n    .format(self.__class__.__name__))\r\nValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().\r\n```\r\nBy looking at the Advanced_sounding example it was discovered that the data passed to the first mpcalc.getwindcomponents were incorrect. According to the Metpy documentation, dataframe values and metpy units should have been passed to the function. However the first mpcalc.getwindcomponents function is not necessary to remove any line which contains Nan values as it will show up in the direction and speed dataframe values when executing the df.dropna function. \r\n\r\nAs well, the example does masked out any temperature and dew point values which exceeds 100 mb as set in the ylim. However it doesn't remove completely wind barbs above 100 mb as they are not indicated in the mask. During the summer, some of the use cases where soundings would exceed the 100 mb limit.  \r\n\r\nAs for the first error, it can be corrected by removing the first mpcalc.getwindcomponents which would  run properly. It will need to be modified in the Metpy Github example directory and on the web site. As for the second issue, not sure where to modify the masking of values above the 100 mb limit for the wind barbs.  \r\n"},"comment":{"url":"https://api.github.com/repos/Unidata/MetPy/issues/comments/402781894","html_url":"https://github.com/Unidata/MetPy/issues/883#issuecomment-402781894","issue_url":"https://api.github.com/repos/Unidata/MetPy/issues/883","id":402781894,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjc4MTg5NA==","user":{"login":"jrleeman","id":325269,"node_id":"MDQ6VXNlcjMyNTI2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/325269?v=4","gravatar_id":"","url":"https://api.github.com/users/jrleeman","html_url":"https://github.com/jrleeman","followers_url":"https://api.github.com/users/jrleeman/followers","following_url":"https://api.github.com/users/jrleeman/following{/other_user}","gists_url":"https://api.github.com/users/jrleeman/gists{/gist_id}","starred_url":"https://api.github.com/users/jrleeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrleeman/subscriptions","organizations_url":"https://api.github.com/users/jrleeman/orgs","repos_url":"https://api.github.com/users/jrleeman/repos","events_url":"https://api.github.com/users/jrleeman/events{/privacy}","received_events_url":"https://api.github.com/users/jrleeman/received_events","type":"User","site_admin":false},"created_at":"2018-07-05T16:36:50Z","updated_at":"2018-07-05T16:36:50Z","author_association":"MEMBER","body":"@eliteuser26 - you are referring to this example, correct? https://unidata.github.io/MetPy/latest/examples/Advanced_Sounding.html#sphx-glr-examples-advanced-sounding-py\r\n\r\nThat example doesn't have an data limiting to 100 hPa. I was able to run it successfully as is. Did you modify the example in any way before running it?"}}
{"actor":{"display_login":"jrleeman"}}