{"action":"created","issue":{"url":"https://api.github.com/repos/xray/xray/issues/460","labels_url":"https://api.github.com/repos/xray/xray/issues/460/labels{/name}","comments_url":"https://api.github.com/repos/xray/xray/issues/460/comments","events_url":"https://api.github.com/repos/xray/xray/issues/460/events","html_url":"https://github.com/xray/xray/issues/460","id":94159276,"number":460,"title":"Create method to return a masked array","user":{"login":"hetland","id":2599958,"avatar_url":"https://avatars.githubusercontent.com/u/2599958?v=3","gravatar_id":"","url":"https://api.github.com/users/hetland","html_url":"https://github.com/hetland","followers_url":"https://api.github.com/users/hetland/followers","following_url":"https://api.github.com/users/hetland/following{/other_user}","gists_url":"https://api.github.com/users/hetland/gists{/gist_id}","starred_url":"https://api.github.com/users/hetland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hetland/subscriptions","organizations_url":"https://api.github.com/users/hetland/orgs","repos_url":"https://api.github.com/users/hetland/repos","events_url":"https://api.github.com/users/hetland/events{/privacy}","received_events_url":"https://api.github.com/users/hetland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"clarkfitzg","id":5356122,"avatar_url":"https://avatars.githubusercontent.com/u/5356122?v=3","gravatar_id":"","url":"https://api.github.com/users/clarkfitzg","html_url":"https://github.com/clarkfitzg","followers_url":"https://api.github.com/users/clarkfitzg/followers","following_url":"https://api.github.com/users/clarkfitzg/following{/other_user}","gists_url":"https://api.github.com/users/clarkfitzg/gists{/gist_id}","starred_url":"https://api.github.com/users/clarkfitzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clarkfitzg/subscriptions","organizations_url":"https://api.github.com/users/clarkfitzg/orgs","repos_url":"https://api.github.com/users/clarkfitzg/repos","events_url":"https://api.github.com/users/clarkfitzg/events{/privacy}","received_events_url":"https://api.github.com/users/clarkfitzg/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-07-09T21:48:22Z","updated_at":"2015-08-08T19:48:46Z","closed_at":null,"body":"This is mainly for plotting in MPL, which does not like NaNs."},"comment":{"url":"https://api.github.com/repos/xray/xray/issues/comments/129040941","html_url":"https://github.com/xray/xray/issues/460#issuecomment-129040941","issue_url":"https://api.github.com/repos/xray/xray/issues/460","id":129040941,"user":{"login":"jhamman","id":2443309,"avatar_url":"https://avatars.githubusercontent.com/u/2443309?v=3","gravatar_id":"","url":"https://api.github.com/users/jhamman","html_url":"https://github.com/jhamman","followers_url":"https://api.github.com/users/jhamman/followers","following_url":"https://api.github.com/users/jhamman/following{/other_user}","gists_url":"https://api.github.com/users/jhamman/gists{/gist_id}","starred_url":"https://api.github.com/users/jhamman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhamman/subscriptions","organizations_url":"https://api.github.com/users/jhamman/orgs","repos_url":"https://api.github.com/users/jhamman/repos","events_url":"https://api.github.com/users/jhamman/events{/privacy}","received_events_url":"https://api.github.com/users/jhamman/received_events","type":"User","site_admin":false},"created_at":"2015-08-08T19:48:46Z","updated_at":"2015-08-08T19:48:46Z","body":"Is this still something that would be useful?  If so, do we want a method on the `DataArray` object to get this sort of behavior:\r\n\r\n```python\r\nIn [1]: import xray\r\nIn [2]: import numpy as np\r\nIn [3]: da = xray.DataArray(np.random.random_sample(size=(5, 4)))\r\n\r\nIn [4]: da.where(da < 0.5)\r\nOut[4]: \r\n<xray.DataArray (dim_0: 5, dim_1: 4)>\r\narray([[ 0.127,    nan,  0.26 ,    nan],\r\n       [ 0.377,  0.336,  0.451,    nan],\r\n       [ 0.123,    nan,  0.373,  0.448],\r\n       [ 0.129,    nan,    nan,  0.352],\r\n       [ 0.229,    nan,    nan,  0.138]])\r\nCoordinates:\r\n  * dim_0    (dim_0) int64 0 1 2 3 4\r\n  * dim_1    (dim_1) int64 0 1 2 3\r\n\r\nIn [5]: da.where(da < 0.5).to_masked_array()\r\nOut[5]: \r\nmasked_array(data =\r\n [[0.12696983303810094 -- 0.26047600586578334 --]\r\n [0.37674971618967135 0.33622174433445307 0.45137647047539964 --]\r\n [0.12310214428849964 -- 0.37301222522143085 0.4479968246859435]\r\n [0.12944067971751294 -- -- 0.35205353914802473]\r\n [0.2288873043216132 -- -- 0.1375535565632705]],\r\n             mask =\r\n [[False  True False  True]\r\n [False False False  True]\r\n [False  True False False]\r\n [False  True  True False]\r\n [False  True  True False]],\r\n       fill_value = 1e+20)\r\n```\r\n\r\nAlternatively, we could add a `@property` to the `DataArray` but I don't think that is necessary.  "}}