keyword CDELT3 disapear after using splot
amivagzci wrote on Apr 04, 2008
Hello,
I have a datacube where I want to delete some cosmics rays with splot and "k" on the left, "k" on the right. I do it but when I save the image with the same name the keyword CDELT3 in the header disapear. Does anyone know how to avoid this? Just in case it could help I copy and paste below the original header.
Many thanks,
Ana
_______________________________________________________
ecl> imheader cube_test.fits l+
cubo_prueba.fits[44,44,4193][real]:
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [44,44,4193], length of user area 2633 s.u.
Created Fri 16:32:57 04-Apr-2008, Last modified Wed 16:12:36 12-Mar-2008
Pixel file "cubo_prueba.fits" [ok]
EXTEND = F / File may contain extensions
ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
IRAF-TLM= '16:12:36 (12/03/2008)' / Time of last modification
DATE = '2008-03-12T15:12:37' / Creation UTC (CCCC-MM-DD) date of FITS
header
DISPAXIS= '3 ' /
CRVAL3 = 5100. /
CRPIX3 = 1. /
COMMENT FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT and Astrophysics', volume 376, page 359; bibcode 2001A&A...376..359H
WCSDIM = 3
CTYPE1 = 'LINEAR '
CTYPE2 = 'LINEAR '
CTYPE3 = 'LINEAR '
CRPIX2 = 4.
CD1_1 = 1.
CD2_2 = 1.
CD3_3 = 0.62
LTV2 = 4.
LTM1_1 = 1.
LTM2_2 = 1.
LTM3_3 = 1.
WAT0_001= 'system=image'
IMCMB001= 'esc_fac_cube_cal_a.fits'
IMCMB002= 'esc_fac_cube_cal_b.fits'
IMCMB003= 'esc_fac_cube_cal_c.fits'
IMCMB004= 'esc_fac_cube_cal_d.fits'
NCOMBINE= 4
CDELT3 = 0.62
I have a datacube where I want to delete some cosmics rays with splot and "k" on the left, "k" on the right. I do it but when I save the image with the same name the keyword CDELT3 in the header disapear. Does anyone know how to avoid this? Just in case it could help I copy and paste below the original header.
Many thanks,
Ana
_______________________________________________________
ecl> imheader cube_test.fits l+
cubo_prueba.fits[44,44,4193][real]:
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [44,44,4193], length of user area 2633 s.u.
Created Fri 16:32:57 04-Apr-2008, Last modified Wed 16:12:36 12-Mar-2008
Pixel file "cubo_prueba.fits" [ok]
EXTEND = F / File may contain extensions
ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
IRAF-TLM= '16:12:36 (12/03/2008)' / Time of last modification
DATE = '2008-03-12T15:12:37' / Creation UTC (CCCC-MM-DD) date of FITS
header
DISPAXIS= '3 ' /
CRVAL3 = 5100. /
CRPIX3 = 1. /
COMMENT FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT and Astrophysics', volume 376, page 359; bibcode 2001A&A...376..359H
WCSDIM = 3
CTYPE1 = 'LINEAR '
CTYPE2 = 'LINEAR '
CTYPE3 = 'LINEAR '
CRPIX2 = 4.
CD1_1 = 1.
CD2_2 = 1.
CD3_3 = 0.62
LTV2 = 4.
LTM1_1 = 1.
LTM2_2 = 1.
LTM3_3 = 1.
WAT0_001= 'system=image'
IMCMB001= 'esc_fac_cube_cal_a.fits'
IMCMB002= 'esc_fac_cube_cal_b.fits'
IMCMB003= 'esc_fac_cube_cal_c.fits'
IMCMB004= 'esc_fac_cube_cal_d.fits'
NCOMBINE= 4
CDELT3 = 0.62
Francisco Valdes wrote on Apr 04, 2008
Hello,
I have less experience with usage of SPLOT on data cubes and the code for writing out or updating is complicated by the different formats supported by ONEDSPEC.
However, in my simple test with your header it looks like it is doing what I expect. The part that is bothering you is a standard behavior of all IRAF tasks since the early days of WCS and is consistent with the standard. What is happening is that there are two accepted ways to specify the coordinate interval; CDELTn and CDn_m. The latter is more general and is what IRAF uses. IRAF does support reading CDELTn if the corresponding CD matrix is missing. On creating or updating a WCS IRAF only writes the CD matrix. Therefore, the disappearing CDELTn is a wider behavior than just SPLOT.
So in your data the value of CDELT3 is found in CD3_3. If you have other software that is bothered by the disappearance of CDELT3 I'm afraid there is no parameter or trick to avoid this. The only solution is to add it back in with hedit with something like:
This uses a more advanced feature of hedit that lets a new keyword be based on an expression with other keywords. In this case the expression is simply an identity.
Yours,
Frank Valdes
I have less experience with usage of SPLOT on data cubes and the code for writing out or updating is complicated by the different formats supported by ONEDSPEC.
However, in my simple test with your header it looks like it is doing what I expect. The part that is bothering you is a standard behavior of all IRAF tasks since the early days of WCS and is consistent with the standard. What is happening is that there are two accepted ways to specify the coordinate interval; CDELTn and CDn_m. The latter is more general and is what IRAF uses. IRAF does support reading CDELTn if the corresponding CD matrix is missing. On creating or updating a WCS IRAF only writes the CD matrix. Therefore, the disappearing CDELTn is a wider behavior than just SPLOT.
So in your data the value of CDELT3 is found in CD3_3. If you have other software that is bothered by the disappearance of CDELT3 I'm afraid there is no parameter or trick to avoid this. The only solution is to add it back in with hedit with something like:
hedit <images> CDELT3 '(CD3_3)' add+
This uses a more advanced feature of hedit that lets a new keyword be based on an expression with other keywords. In this case the expression is simply an identity.
Yours,
Frank Valdes
Last post on Apr 04, 2008