Skip to content
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

Saving mosaic image as a fits file with appropriate header. #357

Open
TrystanScottLambert opened this issue Apr 25, 2023 · 2 comments
Open

Comments

@TrystanScottLambert
Copy link

Hi.

I wonder if there is a way to save the optimum wcs and the array as a fits image without copying the header of one of the fits file images?

We have data which contains 8 different ccds that we want to mosaic together. We can plot the outputted array in matplotlib which seems to work fine. However when trying to save this as a fits file then the documentation seems to want to do something along the lines of taking one of the headers and using that when writing the fits file. But in this case that would result in chip specific information being used for the entire mosaic image.

Does reproject have a method to write a combined header object in some way which includes the optimum wcs? If not, would it be a feasible addition? And would the current correct method be to create a new header object from scratch?

@astrofrog
Copy link
Member

You should be able to convert the optimum WCS to a header by using wcs.to_header() and pass that to the FITS writing code. If that doesn't work, could you show what your code looks like at the moment?

@TrystanScottLambert
Copy link
Author

Thanks for the response. From my understanding wcs.to_header() only writes the wcs information as a header and then we loose any telescope related header data. I was thinking of something similar to the header that SWARP might give. Like the NAXIS1/2, gain, saturation and a tag saying that the fits file was combined using reproject. Something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants