aga |
08/18/2008 03:25PM (Read 7186 times)
|
|
|
Status: offline
Registered: 08/18/2008
Posts: 7
|
Why does ds9 show different header of the same file while run by command: cl> display file.fits 1 and other header while open the same file but with ds9 ?What is wrong with badpiximage? I used fits file that is the ratio between two flat fields with different exposure time, I got the mask.pl output file. I checked this file with imedit and it looks O.K. There are some bad pixels. Because it is not in fits format I can not display it with ds9 or fv. I used badpiximage to change mask.pl to mask.fits and by running this task I got a fits file with all pixels equal 1. Could you help me?
|
|
|
|
fitz |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
[quote:2c98133975]Why does ds9 show different header of the same file while run by command: cl> display file.fits 1 and other header while open the same file but with ds9 ?[/quote:2c98133975]When you load an image with ds9 directly it opens the file and so has access to the header and pixel values; when you display from IRAF only the filename is sent in the WCS package not the actual image, however ds9 doesn't then open the file to get the same information and uses a dummy header. Likewise, it displays the approximate pixel values based on the scaling and cannot display the world coordinates.[quote:2c98133975]What is wrong with badpiximage? I used fits file that is the ratio between two flat fields with different exposure time, I got the mask.pl output file. I checked this file with imedit and it looks O.K. There are some bad pixels. Because it is not in fits format I can not display it with ds9 or fv. I used badpiximage to change mask.pl to mask.fits and by running this task I got a fits file with all pixels equal 1. Could you help me?[/quote:2c98133975]You'd have to supply the parameters you used to the task for me to comment on BADPIXIMAGE, however if all you want to do is change a .pl file into a .fits file you can do it with IMCOPY by supplying the extension, e.g.[code:1:2c98133975]cl> imcopy mask.pl mask.fits[/code:1:2c98133975]
Cheers,
-Mike
|
|
|
|
aga |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 08/18/2008
Posts: 7
|
Thank you very much for your replay and help.About badpiximage.First I do the ratio between two flat filed files, first is 20 sec exposure and second is 30 sec exposure. imarith flat_h_002.fit / flat_h_004.fit ratio_h.fits
Then I run ccdmask
PACKAGE = ccdred
TASK = ccdmask
image = ratio_h.fits Input image
mask = mask_h Output pixel mask
(ncmed = 7) Column box size for median level calculation
(nlmed = 7) Line box size for median level calculation
(ncsig = 15) Column box size for sigma calculation
(nlsig = 15) Line box size for sigma calculation
(lsigma = 6.) Low clipping sigma
(hsigma = 6.) High clipping sigma
(ngood = 5) Minimum column length of good pixel seqments
(linterp= 2) Mask value for line interpolation
(cinterp= 3) Mask value for column interpolation
(eqinter= 2) Mask value for equal interpolation
(mode = ql)I got mask_h.pl file and with imcopy I do mask_h.fits. ccdred> imstat mask_h.fits
# IMAGE NPIX MEAN STDDEV MIN MAX
mask_h.fits 1048576 0.008295 0.2642 0. 108.
Good pixels have 0, and bad pixels have values > 0.
Then I run badpiximage:
PACKAGE = ccdred
TASK = badpiximagefixfile = mask_h.pl Bad pixel file
template= ratio_h.fits Template image
image = bpm_h.fits Bad pixel image to be created
(goodval= 1) Value assigned to the good pixels
(badvalu= 0) Value assigned to the bad pixels
(mode = ql)
and all pixels in bpm_h.fits file have values equal 1ccdred> imstat bpm_h.fits
# IMAGE NPIX MEAN STDDEV MIN MAX
bpm_h.fits 1048576 1. 0. 1. 1.
What is wrong?I would be grateful for help.
|
|
|
|
valdes |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
Hello,One thing is that badpiximage is not what you think. It is used to take a text file description of regions, for example[code:1:eb5445107f]
50 100
121 130 1 1000
[/code:1:eb5445107f]This example is a bad pixel at 50,100 and a bad set of columns [121:130,1:1000]. This was an old way of describing bad pixels in detectors which is now recommended to use pixel masks. Pixel masks came after the text format. This task creates a pixel mask from such a description. In some cases this text description may still be easiest to create. In some tasks you can actually use the text file in place of a mask but the badpiximage task allows turning it into a mask for tasks that don't understand anything but mask files. For some additional info I suggest you read the help for "fixpix". This is in the proto package which also contains text2mask which is similar to badpiximage.Another comment I would make is I don't understand why the imstat of the mask, converted to a full image, from ccdmask has values other than 0 and 1; i.e. I think you are showing the file has values up to 108.Yours,
Frank Valdes
|
|
|
|
aga |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 08/18/2008
Posts: 7
|
So, badpiximage is only for text files? I can not use *.pl file?About *.pl file.This is also my question why file mask_h.fits has values different than 0 and 1. What have I done wrong? Good pixels are 0, and bad are > 0.aga
|
|
|
|
valdes |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
Hi,You should run imstat directly on the file produced by ccdmask. Note that a .pl file, while in a compressed format, is seen as a regular image by all IRAF tasks. So [code:1:a4748181b5]
cl> imstat mask_h.pl
[/code:1:a4748181b5]will directly tell us the values in the mask. While converting to a regular FITS image should be the same it is necessary to look directly at the pl file to understand what is happening.So: 1) run ccdmask using your flat field ratio 2) immediately run imstat on the output mask. According to the ccdmask help page you should have mask values of 0, 2, or 3.Frank
|
|
|
|
aga |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 08/18/2008
Posts: 7
|
I think that there is a problem with IRAF. I run ccdmask on "flat_h_002.fit" and I got proper results, min: 0 , max: 3, but when I used some other flat I got again numbers > 3, moreover when I run ccdmask again on "flat_h_002.fit" I could not get proper mask.pl file. Please check below. It is working correctly only after closing and opening IRAF again.
ccdred> ccdmask
Input image (flat_h_002.fit): flat_h_002.fit
Output pixel mask (test2): mask_h_002
ccdred> imstat mask_h_002.pl
# IMAGE NPIX MEAN STDDEV MIN MAX
mask_h_002.pl 1048576 0.0227 0.2231 0. 3.O.K.ccdred> ccdmask
Input image (flat_h_002.fit):
Output pixel mask (mask_h_002): test
ccdred> imstat test.pl
# IMAGE NPIX MEAN STDDEV MIN MAX
test.pl 1048576 0.0227 0.2231 0. 3.O.K.ccdred> ccdmask
Input image (flat_h_002.fit): flat_h_004.fit
Output pixel mask (test): mask_h_004
ccdred> imstat mask_h_004.pl
# IMAGE NPIX MEAN STDDEV MIN MAX
mask_h_004.pl 1048576 0.09353 18.5 0. 8960.???ccdred> ccdmask
Input image (flat_h_004.fit): flat_h_002.fit
Output pixel mask (mask_h_004): test2
ccdred> imstat test2.pl
# IMAGE NPIX MEAN STDDEV MIN MAX
test2.pl 1048576 0.2064 54.71 0. 27904.???And after closing and opening IRAF again I could get propper mask.pl file based on flat_h_004.fit .ccdred> ccdmask
Input image (flat_h_002.fit): flat_h_004.fit
Output pixel mask (test2): test3
ccdred> imstat test3.pl
# IMAGE NPIX MEAN STDDEV MIN MAX
test3.pl 1048576 0.02225 0.221 0. 3.
Maybe I have some wrong settings somewhere?
Any idea why IRAF behaves like that?Regards and thank you for your help,
aga
|
|
|
|
valdes |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
Hi Aga,I would not be surprised that there is a bug with ccdmask where when it is run more than once it produces bad results. The workaround, which you can verify and let me know, is to type "flpr ccdmask" before every execution of this task. This forces the task to start fresh. This is less drastic that logging out of IRAF.Frank
|
|
|
|
aga |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 08/18/2008
Posts: 7
|
Frank,after the command "flpr ccdmask", IRAF gives proper mask.pl files :-).
One more question, my logfile is not being updated,
any idea why it is like that?Thank you for your help,aga
|
|
|
|
valdes |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
What logfile? For what task? Frank
|
|
|
|
aga |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 08/18/2008
Posts: 7
|
The general logfile,
aga
|
|
|
|
valdes |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
Oh, I had forgotten about that.This is a historical feature that the CL parameters include a logfile. However, it is up to each task to decide what to do about log information. They could point to this top level parameter but in general they don't. You need to look at each task and see what log information it produces and where it puts it. Typically you have to supply a logfile name for each task or package.So the short answer is that setting a name for this parameter generally doesn't do anything so ignore this parameter.Frank
|
|
|
|
aga |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 08/18/2008
Posts: 7
|
O.K.Thanks,aga
|
|
|
|
Anonymous: |
08/18/2008 03:25PM
|
|
|
|
Hi,I just want to share my experience.
I found that doing ccdmask by loading the ccdred package didn't give me any problem at all no matter how many times I do it. However, if I do ccdmask by loading the nmisc package, and running imstat on the output mask, then I get values > 3. Looks like there are two versions of ccdmask.By the way I am using IRAF v2.14 on Fedora core 6.Siti
|
|
|
|
valdes |
08/18/2008 03:25PM
|
|
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
Hi Siti,Thank you for pointing this out. I will remove the ccdmask task from nmisc. My comment to all readers is that nmisc is very old and everything included there has migrated to the core system or noao package. So until there is some other new development task which needs to be distributed prior to a new release of the full system the nmisc package should not be used.Frank Valdes
|
|
|
|