{"action":"opened","issue":{"url":"https://api.github.com/repos/kapadia/geoblend/issues/4","labels_url":"https://api.github.com/repos/kapadia/geoblend/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/kapadia/geoblend/issues/4/comments","events_url":"https://api.github.com/repos/kapadia/geoblend/issues/4/events","html_url":"https://github.com/kapadia/geoblend/issues/4","id":100836488,"number":4,"title":"`matrix_from_mask` should support rectangular images","user":{"login":"kapadia","id":581337,"avatar_url":"https://avatars.githubusercontent.com/u/581337?v=3","gravatar_id":"","url":"https://api.github.com/users/kapadia","html_url":"https://github.com/kapadia","followers_url":"https://api.github.com/users/kapadia/followers","following_url":"https://api.github.com/users/kapadia/following{/other_user}","gists_url":"https://api.github.com/users/kapadia/gists{/gist_id}","starred_url":"https://api.github.com/users/kapadia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kapadia/subscriptions","organizations_url":"https://api.github.com/users/kapadia/orgs","repos_url":"https://api.github.com/users/kapadia/repos","events_url":"https://api.github.com/users/kapadia/events{/privacy}","received_events_url":"https://api.github.com/users/kapadia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-13T18:28:28Z","updated_at":"2015-08-13T18:28:28Z","closed_at":null,"body":"`matrix_from_mask` creates a coefficient matrix based on a non-rectangular image with bounds designated by a mask.\r\n\r\nDue to array length differences, this fails in the case of an mask representing the entire image. Attention to indexing should provide a fix.\r\n\r\n```\r\nIn [1]: import numpy as np\r\n\r\nIn [2]: from geoblend.coefficient_matrix import *\r\n\r\nIn [3]: mask = np.ones((5, 5))\r\n\r\nIn [4]: m1 = create_coefficient_matrix(mask.shape)\r\n\r\nIn [5]: m2 = matrix_from_mask(mask)\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n<ipython-input-5-0201c5d24767> in <module>()\r\n----> 1 m2 = matrix_from_mask(mask)\r\n\r\ngeoblend/geoblend/coefficient_matrix.py in matrix_from_mask(mask)\r\n     73     #\r\n     74     u = np.zeros(n - 1)\r\n---> 75     u[indices] = -1\r\n     76     u[indices[0] - 1] = -1\r\n     77\r\n\r\nIndexError: index 24 is out of bounds for axis 1 with size 24\r\n```"}}