Comments (4)
Just for your information. I don't think it is a bug of astroalign.
[IN]:
imdata1 = fits.getdata('tSUPA00215715.fits')
imdata1.dtype
[OUT]:
dtype('>f4')
The dtype is already 32-bit float before executing np.array(imdata1, dtype="<f4"), but it needs to be "converted" to '<f4' to run aa.register.
It is strange and interesting.
Possibly a bug of astropy.io.fits?
from astroalign.
I honestly don't know much about endian issues and the FITS standard to know exactly what's going on, but this trick fixed the issue:
from astropy.io import fits
imdata1 = fits.getdata('tSUPA00215715.fits')
imdata2 = fits.getdata('tSUPA00215725.fits')
imdata1_fixed = np.array(imdata1, dtype="<f4")
imdata2_fixed = np.array(imdata2, dtype="<f4")
reg_im, footprint = aa.register(imdata1_fixed, imdata2_fixed)
I'll look more into this issue, but for now that should be a quick fix.
from astroalign.
Thank you for your response.
By the way, this is a new issue and your reply is for the previous issue.
Best Regards
from astroalign.
Thanks for pointing that out. I've been thinking last weekend and this might be related to the FITS standard.
This is what they say in the PDF file:
The individual data values shall be stored in big-endian byte order such that the byte containing the most significant bits of the value appears first in the FITS file, followed by the remaining bytes, if any, in decreasing order of significance.
But most computers are actually in little endian.
The Intel x86 and AMD64 / x86-64 series of processors use the little-endian format.
I don't really know if the creators of FITS files take this into consideration when dumping binary data to the file (or if they should care). I'm not sure if astropy should flip the endianness of arrays to match the cpu either.
from astroalign.
Related Issues (20)
- Aligning two xy arrays, running into Max iterations exceeded for even the simplest cases HOT 9
- repeated find_transform on same sets of (x,y) tuples give different results HOT 5
- TypeError when using Pillow Image object HOT 5
- Initial Update
- Implement "downsampling" HOT 1
- ValueError: Big-endian buffer not supported on little-endian compiler HOT 11
- propagate_mask HOT 2
- Add Airspeed velocity benchmarking
- skimage ransac
- Unhelpful error when alignging (large) nan-padded arrays HOT 4
- Add "inverse" on affine transform in Astroalign HOT 2
- [2.4.1] TestFewSources.test_register_threesources fails now (passed before) HOT 1
- Use numpy.random.Generator.shuffle instead of np.random.shuffle HOT 2
- Different results for parallel and sequential implementations of find_transform HOT 1
- Query regarding a section of the source code in `find_transform` HOT 4
- Utilise masking provided by sep HOT 1
- astroalign.MaxIterError: List of matching triangles exhausted before an acceptable transformation was found HOT 5
- Best guide to use for a mosaic?? HOT 4
- Test against numpy 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astroalign.