Posted: Tue Jun 21, 2011 6:20 pm Post subject: FITS header + addstar command
I'm trying to create a synthetic star image with CFITSIO to check the astrometric precision of determining the real centre using psf fitting.
In doing this, I always get an error of 0.5 pixel from the real centre. This is not due to any noise, background, etc. To be sure about this I used the IRAF "addstar" command to create another synthetic star with similar parameters and this time psf fitting gives the exact centre. I don't see any difference between the two images (one created with my program and the other with addstar command).
However, when using the imhead lo+ long header command I found that the two images differ in the "length of the user area" parameter.
With my program:
Line storage mode, physdim [50,50], length of user area 405 s.u.
Line storage mode, physdim [50,50], length of user area 1215 s.u.
May be this is the source of the error. I'm not sure how to correct this in my program as this is generated automatically and I don't write this parameter in the header.
The length of the user area refers to an internal image structure for the header, the difference is likely just because there are some default keywords and values put in the header by the FITS kernel that aren't in your CFITSIO-created image.
The difference in position may just be in how the pixel coordinates are defined: IRAF uses the convention that a pixel coordinate refers to the center of the pixel i.e. pixel (1,1) is the center of the first pixel, not the lower-left corner of that pixel. This would explain a shift of exactly (or nearly so) 0.5, but if you think it is something else I would need more information (e.g. your addstar task parameters).
Yes I know about this positioning in IRAF. I was initially convinced that it is because of this I get a 0.5 pixel shift.
But, now when I use the addstar command to add a new star, I see only the artificial star (AS1) and not the original star (OS) I created using CFITSIO.
I then add one more artificial star (AS2) to AS1 and I see both AS1 and AS2. So I think there should be some compatibility issues between the OS and ASs. I don't know how can check this except checking the header file (which except for the "length of the user area" looks exactly the same otherwise).
Which parameter of the addstar do you need ? I use the psf image from the OS along with the datapars, daopars (fwhm, sigma, etc. - same as OS) to create AS1. I give the coordinates for AS with a simple photometry file like this:
XPOS YPOS MAG. ID
25 25 -6.5 1
You started this post by saying you used CFITSIO to add a synthetic star at a position but then get a 0.5 pixel error. Could you upload this original image to the anonftp at ftp://iraf.noao.edu/pub and tell me what the expected star position should be? Also, how exactly did you determine there was an error in this position?
As for the parameters, I would need to see the 'dpar' output for ADDSTAR task and the DATAPARS and DAOPARS psets. If you were to be able to demonstrate the problem using the dev$pix test image that would also help rule out problems in the original image. The psfimage or other input files you used should also be uploaded to the anonftp so I can reproduce the problem. Also, which IRAF version and platform is this?
I have uploaded the file (sig_sm_1.fits) to ftp://iraf.noao.edu/pub.
It is a simulated star with a gaussian profile created using FITSIO. I ve placed the star exactly at the centre (25,25) of the CCD which is 50X50 pixels wide.
I use the "daofind", "phot", "pstselect" and "psf" for the psf fitting. I then do a "peak" to get the centre. Please let me know if I'm making any mistakes here or if there are any compatibility issues with the fits file created with FITSIO.
I used the addstar command just to crosscheck. That is not my ultimate goal. I use IRAF V2.14 on ubuntu.
I ve uploaded all the parameters in the ftp server under the name "iraf_parameters.tar.gz".
I ve tried changing the parameters many times. For example: I tried psfrad = 2* FWHM and also psfrad = object_aperture_radius with the fitrad = 1.2*FWHM. But I still get a 0.5 pixel offset from the real centre.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum