New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target class mask datatype in targets.py #79
Comments
@sbailey should comment. I believe that an additional wrinkle in the problem is that the individual bits in desiutil.bitmask are subclasses of pure-Python |
Thanks for the bug report and examples; that makes this much easier to track down. It does seem to be a manifestation of numpy/numpy#2955 . A few others notes:
Do you rely upon being able to pass arrays into |
The fix is in PR desihub/desiutil#45 . I left the array behavior as default: it works with a length(1) array but not other dimensions or lengths of arrays. |
In processing the mws_galaxia mocks, the call to
mask.names()
here indesitarget.targets
raises the following exception:seemingly because the values that are being passed as
tc
are scalar np.(u)int64s. This only occurs for larger bitmask values, in this specific case whentc == 65536
(the 'very faint' selection in the mws_galaxia mocks): The relevant lines are:Can be fixed by
tc_name = '+'.join(mask.names(int(tc)))
instead but doesn't seem that intuitive and I didn't see this flagged elsewhere -- should it be fixed indesiutil
instead?Some tests:
Numpy 1.11.1.
Possibly related:
numpy/numpy#2955
http://thread.gmane.org/gmane.comp.python.numeric.general/49242/focus=49338
http://stackoverflow.com/questions/26755352/numpy-bitwise-operation-error
The text was updated successfully, but these errors were encountered: