Status: offline
Registered: 03/07/2006
Posts: 19
|
I have a set of images all of which are dithered and come from a 2-CCD instrument (FORS2), so each exposure has two FITS images. To align and combine all of them I tuned the WCS in all these images to be correct, to good accuracy which I checked visually using USNO stars in skycat/gaia. Now I want to use that WCS to align them correctly.First I tried the MSCRED way, put the two images into FITS extensions and then ran mscimage. That worked and aligned the 2 images of each exposure correctly but destroyed the WCS again, so I cannot use them any more to align the different dithered exposures.Then I thought wregister could be the task to do it but it fails, too. The only image that seems to be correctly aligned afterwards is the 2nd image of the same exposure that I used as reference image, and even in that one the WCS is completely messed up afterwards. All other images got shifted, rotated and stretched (I also tried a subset of these operations with fitgeom=general, rotate, or rscale) but _not_ by the correct amount, so combination gives rubbish.Perhaps I should say that to make wregister work at all and not move the data out of the frame I copied all images into large enough frames and adapted the CRPIX1/CRPIX2 headers so that the WCS remained correct (which I checked again for some). The command I used (I actually did all the work in a Python script but the same command fails from plain IRAF, too) iswregister('@wreg.in', refout, '@wreg.out', fitgeometry="rscale", boundary='constant', constant=0, fluxconserve=False, interactive=True, nxblock=sizelx, nyblock=sizely)where sizelx/ly are just the size of the frames, and the same command also gives the same result with fluxcon+ and interact-, all this with IRAF 2.12.2a-EXPORT on Linux.Any ideas?
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
I created an MEF with the two headers your show. I put in some artificial stars and used the WCS to assign them coordinates. When I use MSCDISPLAY and MSCTVMARK (or you can use MSCZERO and the 'm' key) the stars are circled at the right coordinates. I then ran MSCIMAGE and thn used MSCDISPLAY and MSCTVMARK again (these work on single images as well as MEFs) and the stars are again circled. So you will have to explain why you think the WCS is no longer valid.For your info the script I used to test this is:[code:1:096ecda699]
# Create two images with different WCS as given in the hdr1 and
# hdr2 files. Note I had to edit the hdr files to put the equal
# sign at column 9 to be seen as valid FITS keywords.
# The stars.dat file contains:
#
# 1024 512 -2
mkobjects ("test1", output="", title="", ncols=2048, nlines=1034,
header="hdr1", background=100., objects="stars.dat", xoffset=0.,
yoffset=0., star="moffat", radius=1., beta=2.5, ar=1., pa=0.,
distance=1., exptime=1., magzero=7., gain=1., rdnoise=1., poisson=no,
seed=1, comments=yes)
mkobjects ("test2", output="", title="", ncols=2048, nlines=1034,
header="hdr2", background=100., objects="stars.dat", xoffset=0.,
yoffset=0., star="moffat", radius=1., beta=2.5, ar=1., pa=0.,
distance=1., exptime=1., magzero=7., gain=1., rdnoise=1., poisson=no,
seed=2, comments=yes)
imcopy test1 test[im1]
imcopy test2 test[im2,append]
# Convert the input pixel coordinates for the stars to RA and Dec based
# on the WCS in each extension.
# The result is:
#
# 2:46:14.34 13:02:28.5 -2
# 2:46:14.34 13:06:51.4 -2
wcsctran ("stars.dat", "STDOUT", "test[1]", "logical", "world",
columns="1 2 3 4 5 6 7", units="", formats="%.2H %.1h", min_sigdigit=9,
verbose=no, > "stars.coord")
wcsctran ("stars.dat", "STDOUT", "test[2]", "logical", "world",
columns="1 2 3 4 5 6 7", units="", formats="%.2H %.1h", min_sigdigit=9,
verbose=no, >> "stars.coord")
# Now display and mark the stars.
mscdisp test 1
msctvmark ("stars.coord", 1, output="", fields="1,2,3", wcs="world",
mark="circle", radii="10", lengths="0", font="raster", color=204,
label=no, nxoffset=0, nyoffset=0, pointsize=3, txsize=1)
# Now resample.
mscimage test resampled
# Now display and mark the stars again.
mscdisp resampled 2
msctvmark ("stars.coord", 2, output="", fields="1,2,3", wcs="world",
mark="circle", radii="10", lengths="0", font="raster", color=204,
label=no, nxoffset=0, nyoffset=0, pointsize=3, txsize=1)
[/code:1:096ecda699]
|