astromatic / swarp

resample and coadd FITS images to an arbitrary astrometric projection
https://astromatic.net/software/swarp
GNU General Public License v3.0
31 stars 5 forks source link

Weight Scale too low when SWARPing a mosaic #12

Open TrystanScottLambert opened 1 year ago

TrystanScottLambert commented 1 year ago

Hi.

I have a multiple extension fits file with a weights file. When I use SWARP to mosaic the multiple extension fits file into one single fits file, swarp gives the very last extension a weird weight scale, 0.0008 versus the 0.11 weight scales for the rest of the extensions. This results in an output.weight.fits file with an incredibly bright corner.

I can't think of why this particular extension was treated so harshly. Anyone have any ideas? The only thing that stands out is that it's the last extension. I've tried swarping another fits file and the same thing happens.

It's worth noting that that the fits files have 9 extensions.

Thanks.

-TL

TrystanScottLambert commented 1 year ago

The solution we've come up with is to not rescale the weight images by setting RESCALE_WEIGHTS to 'N'.

ebertin commented 1 year ago

Hi @TrystanScottLambert , sorry for not reaching out earlier. Another possibility would be a mismatch between extensions among both files, Do you get the same result for a single extension, e.g., swarp image.fits[9] -WEIGHT_IMAGE image.weight.fits[9], and if you copy with another tool the very same extensions from both files as basic FITS?

TrystanScottLambert commented 1 year ago

Hi @ebertin,

I tried running it only for the last extension and it gave the same results. I also tried running it on the image with every extension except the last one and it ran fine. Seems that one extension is being targeted for some reason.