Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
combining images with different CTYPEs
09-03-2008, 22:49
Post: #1
combining images with different CTYPEs
Hello,

Today I've been trying to combine several sets of images, and found a confusing behaviour in SWarp (version 2.17.1, compiled under Mac OS 10.3.9 on a Powerbook G4). The first set worked very well, but the second set ended up with all pixels = 0 in many of the resampled images.

I finally noticed that some of the second set of images (the ones that came out badly) had opposite definitions for CTYPE1 and CTYPE2 (CTYPE1 = RA---TAN for some images, while CTYPE1 = DEC--TAN for others), with correspondingly different definitions for the CD matrix (because RA and DEC were always aligned with the same axes in pixel coordinates).

If I make external headers for all the image files with conflicting CTYPE conventions, and swap the WCS axes, then the resampling works fine. From this I guess that there is an assumption somewhere in SWarp that CTYPE does not change from image to image. I would have agreed with this assumption until today, but perhaps it would be useful to relax it for people with confusing data! (The data i am working with comes from repeat observations in the SDSS archive, so i think there is a reasonable chance that i am not the only person to try to work with it.)

In general though, SWarp has been great - thanks very much for making it available!

Cheers,

Dave
Find all posts by this user
Quote this message in a reply
10-23-2008, 15:49
Post: #2
RE: combining images with different CTYPEs
Dear Dave,

(sorry for taking so much time to react). Well I am surprised, because this bug should have been fixed last year. I do a lot of SWarping on SDSS R6 archive images, and I don't have this problem anymore. Could you point me to a couple of SDSS images that don't swarp properly?
- Emmanuel.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-04-2008, 18:43
Post: #3
RE: combining images with different CTYPEs
Hi Emmanuel,

One of the images giving me problems (apparently because its CTYPE1 = DEC) is this one:

http://das.sdss.org/DR6/data/imaging/332...457.fit.gz

when I try combining with the supplemental images in the same patch of sky, e.g.:

http://das.sdss.org/DRsup/data/imaging/4...754.fit.gz

If i create an external header for the first image, with the astrometry keywords swapped as follows:
CTYPE1 <-> CTYPE2
CRVAL1 <-> CRVAL2
CD2_2 <-> CD1_2
CD2_1 <-> CD1_1

then SWarp produces a nice-looking coadded image, which displays fine in ds9, gaia etc. (with reasonable looking world coordinates), but seems to confuse SExtractor - the ALPHA_J2000 and DELTA_J2000 values bear no resemblance to the real position. I have stared at this for a while and can't see what the problem might be, but after a little while i just gave up using this patch of sky and used a different part.

If it's obvious to you what might be causing the SExtractor problem I'd be very grateful to find out. I don't know if this will affect things but I am using an external header for the final reduced image to force the WCS of the image to match the DR6 one, but this has been swapped to put CTYPE1=RA to match the rest of the data, and the header of the reduced image has the same astrometry keywords as the image so i can't see why that would affect SExtractor. But i might have made some other mistake...

Thanks for your help!

Dave
Find all posts by this user
Quote this message in a reply
11-04-2008, 19:59
Post: #4
RE: combining images with different CTYPEs
Dear Dave,

the second image generates a 404 Error, i guess it should be:

http://das.sdss.org/DRsup/data/imaging/4...754.fit.gz

If that is true, I just downloaded the two images and tested. Smile As far as I can see, everything works well here without modifying the data. The images are coadded just fine, and sextractor produces a catalog containing reasonable values for Ra and Dec of the detected objects.

FYI, I'm using SWarp-2.17.1 and SExtractor-2.5.0 here.

HTH, best regards Jan
Find all posts by this user
Quote this message in a reply
11-04-2008, 20:29
Post: #5
RE: combining images with different CTYPEs
sorry for the bad link - that is the correct one. Thanks for taking a look at this so quickly.

i have just tried this again myself with the same two images. in my case the coadd *appears* to work ok, but the second image is severely downweighted for no particular reason, and doesn't add to the depth of the image.

you can see this from the terminal output of SWarp:

----- SWarp 2.17.1 started on 2008-11-04 at 14:13:23 with 1 thread

------- Output File coadd.fits:
"no ident" WEIGHTED no ext. header 2178x1693 32 bits (floats)
Center: 03:29:07.41 +00:06:08.1 11.2'x14.4' Scale: 0.396 ''/pixel
Gain: 0 e-/ADU Flux scaling (astrom/photom): 1 X / 1 X
-------------- File fpC-003325-g4-0457.fit:
"82 S" unweighted no ext. header 2048x1489 16 bits (integers)
Center: 03:29:09.04 +00:06:02.9 9.83'x13.5' Scale: 0.396 ''/pixel
Gain: 0 e-/ADU Flux scaling (astrom/photom): 0.9999 X / 1 X
Background: 1064.258 RMS: 4.230414
-------------- File fpC-004203-g4-0754.fit:
"82 S" unweighted no ext. header 2048x1489 16 bits (integers)
Center: 03:29:05.79 +00:06:13.3 13.5'x9.83' Scale: 0.396 ''/pixel
Gain: 0 e-/ADU Flux scaling (astrom/photom): 0.05343 X / 1 X <----------- NOTE THIS FLUX SCALING VALUE
Background: 57.97517 RMS: 0.2574821
-------------- Co-adding frames
Maximum overlap density: 2 frames
> All done (in 15 s)

Do you get the same result, or do you get more reasonable scaling values (i.e. closer to 1)?

Cheers,

Dave
Find all posts by this user
Quote this message in a reply
11-06-2008, 16:07
Post: #6
RE: combining images with different CTYPEs
Dear Dave,

I just retested, as I did not have a closer look to the flux-scaling values before and I get the same result as you. Something must be broken...

Cheers, Jan
Find all posts by this user
Quote this message in a reply
12-01-2008, 18:11
Post: #7
RE: combining images with different CTYPEs
OK thanks for the tests (and sorry for the delay, I was very busy lately). I understand why I did not experience this problem with SDSS earlier myself, because I was using FSCALASTRO_TYPE NONE. I will try to fix this in the coming days.
- Emmanuel.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-01-2008, 18:23
Post: #8
RE: combining images with different CTYPEs
Ah, I see. That would be a good temporary fix - wish I had thought of that.

By the way, I realised what was causing the SExtractor problem I mentioned above - it was that the headers for the images with swapped RA and DEC (which I was copying into the coadd directory to force identical astrometry) also have their EQUINOX keyword in string format, and this seems to confuse SExtractor (or whatever WCS library it uses).

I posted a comment to this effect in the SExtractor forum - it's not clear to me whether this should really be considered a bug in SExtractor or a fault in the SDSS header, but in any case it is not the fault of SWarp.

Thanks for looking at this!

Dave
Find all posts by this user
Quote this message in a reply
12-02-2008, 12:22
Post: #9
RE: combining images with different CTYPEs
Quote:That would be a good temporary fix - wish I had thought of that.
Well it did not work either in that case Toungue . The resulting .resamp.fits frame was blank!
So I went through the code, and added axis-swapping wherever it was still needed (4 places). I commited the change on the SVN repository.
It should work fine now. I will do a new release in a few weeks.
Thanks a lot for reporting this bug and providing the perfect examples. I appreciate that!
- Emmanuel.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-02-2008, 20:33
Post: #10
RE: combining images with different CTYPEs
Excellent - thanks again!

Dave
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)