Open AlexaVillaume opened 6 years ago
Have a look at the tools in FITS_tools, particularly register_fits
. It gives WCS offsets rather than pixel offsets, which you should be able to use for this purpose.
Thanks for pointing me towards FITS_tools. Is there an analog to shiftnd that uses the WCS offsets?
No, for the WCS offsets, you just need to edit the header of the original file. shiftnd
only makes sense if you're trying to shift two images that are on the same pixel grid (i.e., same # of pixels in each dimension) such that their pixels line up. I think you're asking for something different, where you want to find the on-sky shift between two images and align them in their original pixel grids. Is that right?
You should be modifying the CRVAL
values in the FITS header. If they're already aligned rotationally, this is easy, if not, it's tricky.
I think you're asking for something different, where you want to find the on-sky shift between two images and align them in their original pixel grids. Is that right?
Yes, that's right. And, yes, luckily the images are aligned rotationally so editing the CRVAL values did the trick. Thank you for your help!
@AlexaVillaume , I have encountered such issue as you . Am trying to compare two images of different pixels to plot out the difference between the pics using opencv python it is throwing error that the numpy arrays are not same could you help me on this.
Hello,
First, thank you for writing and making public a python image registration tool. I'm trying to use it to align two images from two different instruments and telescopes. They are of two very different FoVs and pixel scales. To deal with that, before I did the registration, I tried resampling the wider FoV image to be on the smaller FoV image's WCS (using the reproject package). I then tried to use the reprojected image to get offsets between the wider and narrower image such that I can correct the original image. That doesn't seem to work. The offsets for the reprojected image are not valid for the original image. I also tried creating a cutout from the original wider FoV image, getting offsets from that, and then trying to correct the original image. But I have the same problem as the other method.
I'd appreciate any suggestions about how I might get the wider FoV image aligned with the smaller FoV image.
I'm copying my code to show what I've attempted to do:
Attempt 1:
Attempt 2: