{"action":"closed","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/7687","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/7687/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/7687/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/7687/events","html_url":"https://github.com/astropy/astropy/issues/7687","id":344613559,"node_id":"MDU6SXNzdWUzNDQ2MTM1NTk=","number":7687,"title":"masked arrays and astropy Box2DKernel convolution gives erroe","user":{"login":"christophernhill","id":3535328,"node_id":"MDQ6VXNlcjM1MzUzMjg=","avatar_url":"https://avatars0.githubusercontent.com/u/3535328?v=4","gravatar_id":"","url":"https://api.github.com/users/christophernhill","html_url":"https://github.com/christophernhill","followers_url":"https://api.github.com/users/christophernhill/followers","following_url":"https://api.github.com/users/christophernhill/following{/other_user}","gists_url":"https://api.github.com/users/christophernhill/gists{/gist_id}","starred_url":"https://api.github.com/users/christophernhill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophernhill/subscriptions","organizations_url":"https://api.github.com/users/christophernhill/orgs","repos_url":"https://api.github.com/users/christophernhill/repos","events_url":"https://api.github.com/users/christophernhill/events{/privacy}","received_events_url":"https://api.github.com/users/christophernhill/received_events","type":"User","site_admin":false},"labels":[{"id":57200118,"node_id":"MDU6TGFiZWw1NzIwMDExOA==","url":"https://api.github.com/repos/astropy/astropy/labels/convolution","name":"convolution","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-25T21:27:05Z","updated_at":"2018-07-25T23:13:57Z","closed_at":"2018-07-25T23:13:56Z","author_association":"NONE","body":"As described on [Stackoverflow](https://stackoverflow.com/questions/51413506/why-does-netcdf-masked-data-loaded-into-python-arrays-cause-problems-with-astrop) I get an error\r\n\r\n```\r\nTypeError: astype() got an unexpected keyword argument 'copy'\r\n```\r\n\r\nwhen applying Box2DKernel to a numpy masked array.\r\n\r\n [Iguananaut](https://stackoverflow.com/users/982257/iguananaut) on Stackoverflow suggested reporting this here. \r\n\r\nSmall code for reproducing is below\r\n\r\n```\r\nimport matplotlib.pyplot as plt\r\nimport astropy\r\nimport numpy as np\r\nfrom astropy.convolution import convolve as ap_convole\r\nfrom astropy.convolution import Box2DKernel\r\nprint(np.__version__)\r\nprint(astropy.__version__)\r\nimport platform\r\nprint(platform.python_version())\r\n```\r\n\r\n```\r\n> 1.14.2\r\n> 3.0.2\r\n> 3.6.5\r\n```\r\n\r\n```\r\nnx=30;ny=30;\r\na=np.random.normal(size=(nx,ny))\r\nplt.plot(a.flatten())\r\nb2dk=Box2DKernel(9)\r\nac=ap_convole(a,b2dk)\r\nplt.plot(ac.flatten())\r\namasked=np.ma.asarray(a)\r\namaskedc=ap_convole(amasked,b2dk)\r\n```\r\n\r\n```\r\n> ---------------------------------------------------------------------------\r\n> TypeError                                 Traceback (most recent call last)\r\n> <ipython-input-21-4a70044e0e61> in <module>()\r\n>       1 amasked=np.ma.asarray(a)\r\n> ----> 2 amaskedc=ap_convole(amasked,b2dk)\r\n>\r\n> python3.6/site-packages/astropy/utils/decorators.py in convolve(array, kernel, boundary, fill_value, nan_treatment, normalize_kernel, mask, preserve_nan, normalization_zero_tol)\r\n>     825             name = func.__name__\r\n>     826\r\n> --> 827         func = make_function_with_signature(func, name=name, **wrapped_args)\r\n>     828         func = functools.update_wrapper(func, wrapped, assigned=assigned,\r\n>     829                                         updated=updated)\r\n>\r\n> python3.6/site-packages/astropy/nddata/decorators.py in wrapper(data, *args, **kwargs)\r\n>     243                                   AstropyUserWarning)\r\n>     244\r\n> --> 245             result = func(data, *args, **kwargs)\r\n>     246\r\n>     247             if unpack and repack:\r\n>\r\n> python3.6/site-packages/astropy/convolution/convolve.py in convolve(array, kernel, boundary, fill_value, nan_treatment, normalize_kernel, mask, preserve_nan, normalization_zero_tol)\r\n>     167         # because none of what follows modifies array_internal.\r\n>     168         array_dtype = array.dtype\r\n> --> 169         array_internal = array.astype(float, copy=False)\r\n>     170     else:\r\n>     171         raise TypeError(\"array should be a list or a Numpy array\")\r\n>\r\n> TypeError: astype() got an unexpected keyword argument 'copy'\r\n```"}}
{"actor":{"display_login":"bsipocz"}}