Using wmosaic with FITS files
lnxbil wrote on Jan 03, 2008
Hi everyone,
I'm new to this software and get it successfully installed on my Ubuntu machine and everything seems to work fine. I can login and use things like STSDAS. Furthermore, I'm not a astronomer I am a computer scientist and need to use raw images of hubble for some image processing things (can't mention it yet, still under investigation and development). Besides, I'm not a native speaker, so please apologize my english mistakes :D
I want to combine HST WFPC2 images with wmosaic to one single image and further combine - if possible - several wavelength images to a color image with some corrections like shift, etc. (all in 16 or 32-bit precision). Currently, I downloaded images (Boomerang nebula) for the HST archive
Using DS9 I can open the *c0f* files. If I try to open it with wmosaic, I get the following error:
(Same error with image u47b0301r_c0f.fits[0])
If I check the file with imheader I get:
After some internet search I found lots of examples using hhh files. Yet, if I convert the images to hhh it doesn't work either:
The file exists, but doesn't work with wmosaic, too:
Does anybody have any clue what it could be? Is it also possible to combine several different-wavelength images to a colored one?
Best regards
Andreas
I'm new to this software and get it successfully installed on my Ubuntu machine and everything seems to work fine. I can login and use things like STSDAS. Furthermore, I'm not a astronomer I am a computer scientist and need to use raw images of hubble for some image processing things (can't mention it yet, still under investigation and development). Besides, I'm not a native speaker, so please apologize my english mistakes :D
I want to combine HST WFPC2 images with wmosaic to one single image and further combine - if possible - several wavelength images to a color image with some corrections like shift, etc. (all in 16 or 32-bit precision). Currently, I downloaded images (Boomerang nebula) for the HST archive
u47b0301b_asn.fits
u47b0301r_c0f.fits
u47b0301r_c1f.fits
u47b0301r_c3t.fits
u47b0301r_shf.fits
u47b0301r_trl.fits
u47b0301r_x0f.fits
u47b0302r_c0f.fits
u47b0302r_c1f.fits
u47b0302r_c3t.fits
u47b0302r_shf.fits
u47b0302r_trl.fits
u47b0302r_x0f.fits
Using DS9 I can open the *c0f* files. If I try to open it with wmosaic, I get the following error:
wfpc> wmosaic u47b0301r_c0f.fits test.fits
ERROR: input image u47b0301r_c0f.fits is not 2-D
(Same error with image u47b0301r_c0f.fits[0])
If I check the file with imheader I get:
wfpc> imheader u47b0301r_c0f.fits[0]
u47b0301r_c0f.fits[0][800,800,4][real]:
After some internet search I found lots of examples using hhh files. Yet, if I convert the images to hhh it doesn't work either:
wfpc> rfits u47b0301r_c0f.fits 0 out.hhh
File: u47b0301r_c0f.fits -> out.hhh size=800x800x4
bitpix=-32 scaling=none pixtype=real
Warning: RFT_PUT_IMAGE_LINE: Error writing FITS data
Warning: FITS extensions may be present
The file exists, but doesn't work with wmosaic, too:
wfpc> wmosaic out.hhh other
ERROR: input image out.hhh is not 2-D
Does anybody have any clue what it could be? Is it also possible to combine several different-wavelength images to a colored one?
Best regards
Andreas
Mike Fitzpatrick wrote on Jan 03, 2008
I'm not familiar with WMOSAIC specifically, but in general terms you need to use the STRFITS task in TABLES or STSDAS to convert MEF files. The image you have is a 3-D image 800x800x4, so you'll need to use an image section to create a 2-D slice for each plane, e.g.
to access extension zero and the first plane of the image.
There's nothing in particular to create color images as in 'pretty pictures', however see the EXPORT task in the DATAIO package (help page examples) as one way to create e.g. a color GIF with RGB components made up of separate images.
Cheers,
-Mike
cl> imhead u47b0301r_c0f[0][*,*,1]to access extension zero and the first plane of the image.
There's nothing in particular to create color images as in 'pretty pictures', however see the EXPORT task in the DATAIO package (help page examples) as one way to create e.g. a color GIF with RGB components made up of separate images.
Cheers,
-Mike
lnxbil wrote on Jan 03, 2008
I found the problem and my first try was in the right direction, but I have to use the right format c0h not hhh.
After that, everything works as expected.
I use the following code, which may be helpful for other people:
Best regards and thank you for your answer.
Andreas
wfpc> strfits u5310101r_c0f.fits "" /tmp/test.c0h
wfpc> imheader /tmp/u5310101r.c0h
/tmp/u5310101r.c0h[1/4][800,800][real]: U5310101R[1/4]
After that, everything works as expected.
I use the following code, which may be helpful for other people:
# Converting Fits files
strfits u531010er_c0f.fits "" u531010er.c0h
strfits u531010fr_c0f.fits "" u531010fr.c0h
strfits u531010gr_c0f.fits "" u531010gr.c0h
# Creating Image List
files u531010er.c0h > list
files u531010fr.c0h >> list
files u531010gr.c0h >> list
# Removing cosmic rays
crrej @list combine.c0h "" "4,4,3,2"
# Creating Mosaic
wmosaic combine.c0h mosaic.c0h
# Converting to FITS file
stwfits mosaic.c0h u531010e_10f_10g.fits
Best regards and thank you for your answer.
Andreas
Last post on Jan 03, 2008