{"action":"created","issue":{"url":"https://api.github.com/repos/PyAbel/PyAbel/issues/51","labels_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/51/comments","events_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/51/events","html_url":"https://github.com/PyAbel/PyAbel/issues/51","id":121122797,"number":51,"title":"Compatibility with numpy 1.10.1","user":{"login":"DanHickstein","id":1107796,"avatar_url":"https://avatars.githubusercontent.com/u/1107796?v=3","gravatar_id":"","url":"https://api.github.com/users/DanHickstein","html_url":"https://github.com/DanHickstein","followers_url":"https://api.github.com/users/DanHickstein/followers","following_url":"https://api.github.com/users/DanHickstein/following{/other_user}","gists_url":"https://api.github.com/users/DanHickstein/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHickstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHickstein/subscriptions","organizations_url":"https://api.github.com/users/DanHickstein/orgs","repos_url":"https://api.github.com/users/DanHickstein/repos","events_url":"https://api.github.com/users/DanHickstein/events{/privacy}","received_events_url":"https://api.github.com/users/DanHickstein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/PyAbel/PyAbel/milestones/2","html_url":"https://github.com/PyAbel/PyAbel/milestones/Version%200.7","labels_url":"https://api.github.com/repos/PyAbel/PyAbel/milestones/2/labels","id":1423032,"number":2,"title":"Version 0.7","description":"Adding a few other inverse Abel implementations. Converge to a consistent user interface.","creator":{"login":"rth","id":630936,"avatar_url":"https://avatars.githubusercontent.com/u/630936?v=3","gravatar_id":"","url":"https://api.github.com/users/rth","html_url":"https://github.com/rth","followers_url":"https://api.github.com/users/rth/followers","following_url":"https://api.github.com/users/rth/following{/other_user}","gists_url":"https://api.github.com/users/rth/gists{/gist_id}","starred_url":"https://api.github.com/users/rth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rth/subscriptions","organizations_url":"https://api.github.com/users/rth/orgs","repos_url":"https://api.github.com/users/rth/repos","events_url":"https://api.github.com/users/rth/events{/privacy}","received_events_url":"https://api.github.com/users/rth/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":11,"state":"open","created_at":"2015-11-21T11:17:04Z","updated_at":"2015-12-08T23:50:18Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-12-08T23:15:36Z","updated_at":"2015-12-09T00:04:08Z","closed_at":null,"body":"Numpy 1.10 apparently has stricter rules for casting floats as integers:\r\nhttps://github.com/scikit-learn/scikit-learn/issues/5397\r\n\r\nThis causes an error with PyAbel as well, specifically for the ``example_hansenlaw.py``.\r\n\r\nI think that we just need to specifically cast the numbers to the correct types, but I think I recall there is something weird going on with a half-integer origin in the case of the hansen-law transform? @stggh \r\n\r\nHere is the output from trying to run the example:\r\n\r\n```\r\nDaniels-MacBook-Pro-3:examples danhickstein$ python example_hansenlaw.py\r\nLoading data/O2-ANU1024.txt.bz2\r\nimage size 1024x1024\r\nPerforming Hansen and Law inverse Abel transform:\r\nHL: Calculating inverse Abel transform:  image size 1024x1024\r\nHL: Individual quadrants\r\nHL: Calculating inverse Abel transform ...\r\n0.29 seconds\r\nGenerating speed distribution ...\r\nTraceback (most recent call last):\r\n  File \"example_hansenlaw.py\", line 52, in <module>\r\n    recon, speeds = iabel_hansenlaw (im,quad=(False,False,False,False),verbose=True)\r\n  File \"/Users/danhickstein/Documents/PyAbel-master/abel/hansenlaw.py\", line 210, in iabel_hansenlaw\r\n    speeds = calculate_speeds(recon,origin=image_centre)\r\n  File \"/Users/danhickstein/Documents/PyAbel-master/abel/tools.py\", line 24, in calculate_speeds\r\n    polarIM, ri, thetai = reproject_image_into_polar(IM,origin)\r\n  File \"/Users/danhickstein/Documents/PyAbel-master/abel/tools.py\", line 145, in reproject_image_into_polar\r\n    x, y = index_coords(data, origin=origin)\r\n  File \"/Users/danhickstein/Documents/PyAbel-master/abel/tools.py\", line 179, in index_coords\r\n    x -= origin_x\r\nTypeError: Cannot cast ufunc subtract output from dtype('float64') to dtype('int64') with casting rule 'same_kind'\r\n```\r\n\r\nThanks to @ellisje624 for pointing this out."},"comment":{"url":"https://api.github.com/repos/PyAbel/PyAbel/issues/comments/163062351","html_url":"https://github.com/PyAbel/PyAbel/issues/51#issuecomment-163062351","issue_url":"https://api.github.com/repos/PyAbel/PyAbel/issues/51","id":163062351,"user":{"login":"stggh","id":10932229,"avatar_url":"https://avatars.githubusercontent.com/u/10932229?v=3","gravatar_id":"","url":"https://api.github.com/users/stggh","html_url":"https://github.com/stggh","followers_url":"https://api.github.com/users/stggh/followers","following_url":"https://api.github.com/users/stggh/following{/other_user}","gists_url":"https://api.github.com/users/stggh/gists{/gist_id}","starred_url":"https://api.github.com/users/stggh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stggh/subscriptions","organizations_url":"https://api.github.com/users/stggh/orgs","repos_url":"https://api.github.com/users/stggh/repos","events_url":"https://api.github.com/users/stggh/events{/privacy}","received_events_url":"https://api.github.com/users/stggh/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T00:04:08Z","updated_at":"2015-12-09T00:04:08Z","body":"```np.meshgrid(np.arange(nx), np.arange(ny))``` returns integer numpy.arrays for nx, ny integer. \r\nA possible solution is to convert to float:\r\n```\r\n178,180c178\r\n<     x, y = np.meshgrid(np.arange(nx), np.arange(ny))  # int numpy.array\r\n<     x.astype(float)\r\n<     y.astype(float)\r\n---\r\n>     x, y = np.meshgrid(np.arange(nx), np.arange(ny))\r\n```"}}