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
Support byteswap #5689
Comments
@Cadair it looks like this is an embarassingly parallel operation, in which case, your current workaround might be faster as ... out = x.map_blocks(np.ndarray.byteswap, True).map_blocks(np.ndarray.newbyteorder, "S") Or, if you wanted to keep things numpy agnostic, maybe swap out from dask.utils import M
out = x.map_blocks(M.byteswap, True).map_blocks(M.newbyteorder, "S") See https://docs.dask.org/en/latest/best-practices.html#learn-techniques-for-customization If it is this simple then this would probably make a fine contribution to the dask array module. You might search for similarly simple methoods, like |
Thanks @mrocklin I swapped out my implementation with what you suggested, and it didn't work right away. I haven't looked into it any more though, will try and debug later. |
How are things going here @Cadair? Anything we can help with? |
I am trying to add Dask support to
astropy.io.fits
and because it's such a lovely file format FITS is big endian on disk, so before I can.store()
the data to the file I need to byteswap the array.What I have currently done which seems to work is:
which appears to work but is somewhat weird.
I was wondering what would be involved in adding
.byteswap
toArray
this seems to suggest it wouldn't be that hard, but I wouldn't know where to start.The text was updated successfully, but these errors were encountered: