{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/photutils/issues/267","labels_url":"https://api.github.com/repos/astropy/photutils/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/astropy/photutils/issues/267/comments","events_url":"https://api.github.com/repos/astropy/photutils/issues/267/events","html_url":"https://github.com/astropy/photutils/issues/267","id":77460073,"number":267,"title":"Mask function causes crash in aperture_photometry","user":{"login":"StarryNate","id":6655325,"avatar_url":"https://avatars.githubusercontent.com/u/6655325?v=3","gravatar_id":"","url":"https://api.github.com/users/StarryNate","html_url":"https://github.com/StarryNate","followers_url":"https://api.github.com/users/StarryNate/followers","following_url":"https://api.github.com/users/StarryNate/following{/other_user}","gists_url":"https://api.github.com/users/StarryNate/gists{/gist_id}","starred_url":"https://api.github.com/users/StarryNate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StarryNate/subscriptions","organizations_url":"https://api.github.com/users/StarryNate/orgs","repos_url":"https://api.github.com/users/StarryNate/repos","events_url":"https://api.github.com/users/StarryNate/events{/privacy}","received_events_url":"https://api.github.com/users/StarryNate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-18T02:04:52Z","updated_at":"2015-05-18T03:46:28Z","closed_at":null,"body":"Hello,\r\n\r\nMy system is running Fedora 21 x86_64.\r\nI'm trying to use aperture photometry with a bad-pixel mask. When I call aperture_photometry and pass it a mask, I get the following error:\r\n\r\n/usr/lib64/python2.7/site-packages/photutils/aperture_core.pyc in aperture_photometry(data, apertures, unit, wcs, error, effective_gain, mask, method, subpixels, pixelwise_error)\r\n   1320         # to the aperture sums\r\n   1321         data = copy.deepcopy(data)    # do not modify input data\r\n-> 1322         data *= ~mask\r\n   1323 \r\n   1324     # Check whether we really need to calculate pixelwise errors, even if\r\n\r\n/usr/lib64/python2.7/site-packages/astropy/units/quantity.pyc in __imul__(self, other)\r\n    769             return self\r\n    770 \r\n--> 771         return np.multiply(self, other, self)\r\n    772 \r\n    773     def __rmul__(self, other):\r\n\r\n/usr/lib64/python2.7/site-packages/astropy/units/quantity.pyc in __array_prepare__(self, obj, context)\r\n    369             if not np.can_cast(result_dtype, obj.dtype):\r\n    370                 raise TypeError(\"Arguments cannot be cast safely to inplace \"\r\n--> 371                                 \"output with dtype={0}\".format(self.dtype))\r\n    372 \r\n    373             result = self  # no view needed since we return the object itself\r\n\r\nTypeError: Arguments cannot be cast safely to inplace output with dtype=>f4\r\n"},"comment":{"url":"https://api.github.com/repos/astropy/photutils/issues/comments/102914205","html_url":"https://github.com/astropy/photutils/issues/267#issuecomment-102914205","issue_url":"https://api.github.com/repos/astropy/photutils/issues/267","id":102914205,"user":{"login":"StarryNate","id":6655325,"avatar_url":"https://avatars.githubusercontent.com/u/6655325?v=3","gravatar_id":"","url":"https://api.github.com/users/StarryNate","html_url":"https://github.com/StarryNate","followers_url":"https://api.github.com/users/StarryNate/followers","following_url":"https://api.github.com/users/StarryNate/following{/other_user}","gists_url":"https://api.github.com/users/StarryNate/gists{/gist_id}","starred_url":"https://api.github.com/users/StarryNate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StarryNate/subscriptions","organizations_url":"https://api.github.com/users/StarryNate/orgs","repos_url":"https://api.github.com/users/StarryNate/repos","events_url":"https://api.github.com/users/StarryNate/events{/privacy}","received_events_url":"https://api.github.com/users/StarryNate/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T03:46:28Z","updated_at":"2015-05-18T03:46:28Z","body":"OK, I think I diagnosed this one: If I convert the data and error arrays to float64, it no longer crashes. However, some of the resulting aperture_sum_err values are still 'nan', which I think is weird because I specifically masked pixels for which the error array had a value of nan..."}}