{"action":"closed","issue":{"url":"https://api.github.com/repos/spacetelescope/drizzle/issues/1","labels_url":"https://api.github.com/repos/spacetelescope/drizzle/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/spacetelescope/drizzle/issues/1/comments","events_url":"https://api.github.com/repos/spacetelescope/drizzle/issues/1/events","html_url":"https://github.com/spacetelescope/drizzle/issues/1","id":91895680,"number":1,"title":"cdrizzle.tdriz crashes with segmentation fault and when it \"works\" the drizzled images have 'fillval' only","user":{"login":"mcara","id":5985250,"avatar_url":"https://avatars.githubusercontent.com/u/5985250?v=3","gravatar_id":"","url":"https://api.github.com/users/mcara","html_url":"https://github.com/mcara","followers_url":"https://api.github.com/users/mcara/followers","following_url":"https://api.github.com/users/mcara/following{/other_user}","gists_url":"https://api.github.com/users/mcara/gists{/gist_id}","starred_url":"https://api.github.com/users/mcara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcara/subscriptions","organizations_url":"https://api.github.com/users/mcara/orgs","repos_url":"https://api.github.com/users/mcara/repos","events_url":"https://api.github.com/users/mcara/events{/privacy}","received_events_url":"https://api.github.com/users/mcara/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-29T20:03:26Z","updated_at":"2015-07-02T12:04:49Z","closed_at":"2015-07-02T12:04:49Z","body":"I created a simple test of drizzling a very simple image onto a larger image. The coordinate transformation is an identity transformation so the input image should be in a quadrant of the output image. The code that crashes `tdriz`:\r\n\r\n```python\r\n>>> import numpy as np\r\n>>> from drizzle import cdrizzle\r\n>>> inmask=np.zeros((100,100),dtype=np.float32)\r\n>>> inmask[22:25,33:49]=1\r\n>>> inwht=np.ones_like(inmask,dtype=np.float32)\r\n>>> outsci=np.zeros((256,256),dtype=np.float32)\r\n>>> outwht=np.zeros((256,256),dtype=np.float32)\r\n>>> outctx=np.zeros((256,256),dtype=np.int32)\r\n>>> in_y, in_x = np.indices((100,100), dtype=np.float)\r\n>>> pixmap = np.dstack((in_y,in_x))\r\n>>> cdrizzle.tdriz(inmask,inwht,pixmap,outsci,outwht,outctx,\r\n... 1,0,0,0,0,1,1,'square','cps',1,1,'-1')\r\n('Callable C-based DRIZZLE Version 0.9 (10th May 2014)', 65536, 156)\r\n\r\n>>> # second try with identical parameters:\r\n>>> import numpy as np\r\n>>> from drizzle import cdrizzle\r\n>>> inmask=np.zeros((100,100),dtype=np.float32)\r\n>>> inmask[22:25,33:49]=1\r\n>>> inwht=np.ones_like(inmask,dtype=np.float32)\r\n>>> outsci=np.zeros((256,256),dtype=np.float32)\r\n>>> outwht=np.zeros((256,256),dtype=np.float32)\r\n>>> outctx=np.zeros((256,256),dtype=np.int32)\r\n>>> in_y, in_x = np.indices((100,100), dtype=np.float64)\r\n>>> pixmap = np.dstack((in_y,in_x))\r\n>>> cdrizzle.tdriz(inmask,inwht,pixmap,outsci,outwht,outctx,\r\n... 1,0,0,0,0,1,1,'square','cps',1,1,'-1')\r\nSegmentation fault\r\n```\r\nIn the first run, even though `tdriz` did not crash, it did \"miss\" all of the data points (which should not happen for an identity coordinate transformation):\r\n```python\r\n>>> np.any(outsci>0)\r\nFalse\r\n>>> np.sum(outsci>0)\r\n0\r\n```\r\nThe old code from DrizzlePac works as expected:\r\n```python\r\n>>> from drizzlepac import cdriz\r\n>>> import numpy as np\r\n>>> inmask=np.zeros((100,100),dtype=np.float32)\r\n>>> inmask[22:25,33:49]=1\r\n>>> inwht=np.ones_like(inmask,dtype=np.float32)\r\n>>> outsci=np.zeros((256,256),dtype=np.float32)\r\n>>> outwht=np.zeros((256,256),dtype=np.float32)\r\n>>> outctx=np.zeros((256,256),dtype=np.int32)\r\n>>> cdriz.tdriz(inmask,inwht,outsci,outwht,outctx,0,0,1,1,inmask.shape[0],\r\n... 1.0,1.0,1.0,'center',1.0,'square','cps',1,1,'-1',0,0,1,lambda x,y:[np.asarray(x),np.asarray(y)])\r\n('Callable C-based DRIZZLE Version 0.8 (20th May 2009)', 0, 0) # <-- nothing missed!\r\n>>> np.any(outsci>0)\r\nTrue\r\n>>> np.sum(outsci>0)\r\n48\r\n```\r\n\r\n"}}