{"action":"created","issue":{"url":"https://api.github.com/repos/SciTools/iris/issues/1553","labels_url":"https://api.github.com/repos/SciTools/iris/issues/1553/labels{/name}","comments_url":"https://api.github.com/repos/SciTools/iris/issues/1553/comments","events_url":"https://api.github.com/repos/SciTools/iris/issues/1553/events","html_url":"https://github.com/SciTools/iris/pull/1553","id":56560824,"number":1553,"title":"BUG: Intersection points are no longer contiguous","user":{"login":"cpelley","id":2071643,"avatar_url":"https://avatars.githubusercontent.com/u/2071643?v=3","gravatar_id":"","url":"https://api.github.com/users/cpelley","html_url":"https://github.com/cpelley","followers_url":"https://api.github.com/users/cpelley/followers","following_url":"https://api.github.com/users/cpelley/following{/other_user}","gists_url":"https://api.github.com/users/cpelley/gists{/gist_id}","starred_url":"https://api.github.com/users/cpelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpelley/subscriptions","organizations_url":"https://api.github.com/users/cpelley/orgs","repos_url":"https://api.github.com/users/cpelley/repos","events_url":"https://api.github.com/users/cpelley/events{/privacy}","received_events_url":"https://api.github.com/users/cpelley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-04T17:39:22Z","updated_at":"2015-02-05T10:41:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SciTools/iris/pulls/1553","html_url":"https://github.com/SciTools/iris/pull/1553","diff_url":"https://github.com/SciTools/iris/pull/1553.diff","patch_url":"https://github.com/SciTools/iris/pull/1553.patch"},"body":"BUG: Intersection for points at period + base\r\n\r\nCurrently while intersecting points/bounds which coincide at (period + base)\r\nthese are wrapped around which results in a once contiguous coordinate\r\nbeing not contiguous anymore.\r\n\r\nI have yet to add unittests as it would be good to get confirmation as to whether I am correct in modifying `cube.intersection` and not `iris.analysis.cartography.wrap_lons`.\r\nMy feeling is that `wrap_lons` is neither correct or incorrect.  Also, modifying wrap_lons would have a greater impact reliant on its current behaviour.\r\nHowever, when utilising `wrap_lons` within `cube.intersection`, this clearly identifies itself as a bug within this specific context (i.e. its an issue with how `cube.intersection` uses these points).\r\n\r\n**DO NOT MERGE: once I get confirmation of the above, I'll be happy to write some unittests.**\r\n\r\n```Python\r\n>>> import numpy as np\r\n>>> from iris.analysis.cartography import wrap_lons\r\n>>> lons = np.array([-180., -90., 0., 90., 180.])\r\n>>> res = wrap_lons(lons, -180., 360.)\r\n>>> res == lons\r\narray([ True,  True,  True,  True, False], dtype=bool)\r\n>>> print res\r\n[-180.  -90.    0.   90. -180.]\r\n>>> assert np.all(lons == res)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\nAssertionError\r\n```\r\nI should point out that I have mistakingly pointed this to master, I will change to 1.7.x after confirmation."},"comment":{"url":"https://api.github.com/repos/SciTools/iris/issues/comments/73026669","html_url":"https://github.com/SciTools/iris/pull/1553#issuecomment-73026669","issue_url":"https://api.github.com/repos/SciTools/iris/issues/1553","id":73026669,"user":{"login":"rhattersley","id":917914,"avatar_url":"https://avatars.githubusercontent.com/u/917914?v=3","gravatar_id":"","url":"https://api.github.com/users/rhattersley","html_url":"https://github.com/rhattersley","followers_url":"https://api.github.com/users/rhattersley/followers","following_url":"https://api.github.com/users/rhattersley/following{/other_user}","gists_url":"https://api.github.com/users/rhattersley/gists{/gist_id}","starred_url":"https://api.github.com/users/rhattersley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhattersley/subscriptions","organizations_url":"https://api.github.com/users/rhattersley/orgs","repos_url":"https://api.github.com/users/rhattersley/repos","events_url":"https://api.github.com/users/rhattersley/events{/privacy}","received_events_url":"https://api.github.com/users/rhattersley/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T10:41:22Z","updated_at":"2015-02-05T10:41:22Z","body":"From your example, `wrap_lons` looks to be doing exactly what I'd expect."}}