fxcor: units in saved cross-correlation
Carla Maceroni wrote on Feb 13, 2007
Hi Mike,
I have met another problem with fxcor. The same as in the old 2003 topic in the subject, i.e. when I s-plot the saved ccfs I get a shift in the image of about 1200km/s.
I have found the old post with the explanation of the reason and I checked that, indeed, the text version of the same ccf has the right scale, as you annouced in that post for a next release.
My difficulty is only that I have already saved ~50 ccfs as images, and I have to redo the whole work by hand , unless you can suggest a workaround.
Thanks,
Carla
I have met another problem with fxcor. The same as in the old 2003 topic in the subject, i.e. when I s-plot the saved ccfs I get a shift in the image of about 1200km/s.
I have found the old post with the explanation of the reason and I checked that, indeed, the text version of the same ccf has the right scale, as you annouced in that post for a next release.
My difficulty is only that I have already saved ~50 ccfs as images, and I have to redo the whole work by hand , unless you can suggest a workaround.
Thanks,
Carla
Mike Fitzpatrick wrote on Feb 13, 2007
HI Carla,
The problem is/was that the CCF was being saved using just an approximation to the velocity, specifically that the X-axis of the CCF was computed as simply
delta_V * shift
where delta_V is the velocity-per-pixel dispersion (you can get this from the difference between any two lags in the CCF). From this you can recover the wavelength-per-pixel used (the object and template are put on a common scale) as being
wpc = delta_V / CLN10 ( where CLN10 = 690297.74149142 km/s)
From there the correct velocity can be computed as
Vrel = C * ( (10 ** (wpc * shift)) - 1) (where C = 299792.5 km/s)
The shifts in the CCF will run from (-N/2) to ((N/2)-1) (e.g. for a 512 point CCF the lags are -256 to +255.
So, given this it should be possible to write a script (or a small program in any language) that simply recalculates what the correct velocities ought to be for the ccfs you already have and rewrite the file. If you're not familiar with scripts see the Script Programmer's Guide ( http://iraf.net/irafdocs/script ), I could perhaps provide a skeleton script in a few days. Note that the patched binary you already have should be using the corrected values for any new CCFs you save. Hope this helps.
Cheers,
-Mike
The problem is/was that the CCF was being saved using just an approximation to the velocity, specifically that the X-axis of the CCF was computed as simply
delta_V * shift
where delta_V is the velocity-per-pixel dispersion (you can get this from the difference between any two lags in the CCF). From this you can recover the wavelength-per-pixel used (the object and template are put on a common scale) as being
wpc = delta_V / CLN10 ( where CLN10 = 690297.74149142 km/s)
From there the correct velocity can be computed as
Vrel = C * ( (10 ** (wpc * shift)) - 1) (where C = 299792.5 km/s)
The shifts in the CCF will run from (-N/2) to ((N/2)-1) (e.g. for a 512 point CCF the lags are -256 to +255.
So, given this it should be possible to write a script (or a small program in any language) that simply recalculates what the correct velocities ought to be for the ccfs you already have and rewrite the file. If you're not familiar with scripts see the Script Programmer's Guide ( http://iraf.net/irafdocs/script ), I could perhaps provide a skeleton script in a few days. Note that the patched binary you already have should be using the corrected values for any new CCFs you save. Hope this helps.
Cheers,
-Mike
Carla Maceroni wrote on Feb 13, 2007
Hi Mike,
yes I have seen that the text version of the ccfs have the correct numbers.
Unfortunately I am not familiar with IRAF scripts but I might use IDL or another language
or it may be quicker to redo the ccfs. In future I will make text files and
convert them to images with rspectext if necessary.
It might be useful, however, if it does not take much of your time, to have
a script available inside IRAF.
thanks again
Carla
yes I have seen that the text version of the ccfs have the correct numbers.
Unfortunately I am not familiar with IRAF scripts but I might use IDL or another language
or it may be quicker to redo the ccfs. In future I will make text files and
convert them to images with rspectext if necessary.
It might be useful, however, if it does not take much of your time, to have
a script available inside IRAF.
thanks again
Carla
Last post on Feb 13, 2007