splot Gaussian Fit–higher precision–
rohit wrote on Nov 24, 2008
I am using SPLOT to identify the wavelenghts of telluric lines by fitting a Gaussian (using the key "k" ). IRAF gives the wavelength value to 5th decimal point. I would like IRAF to give me to 7th decimal point. The telluric lines that I have plotted are precised to 11th decimal point. How do ask IRAF to do that?
Thanks!
Thanks!
Mike Fitzpatrick wrote on Nov 24, 2008
To get more precision you would need to modify the code and recompile, however the Gaussian fitting appears to be done in single precision floating-point so I'm not sure printing out any more decimals would be meaningful without more extensive changes anyway.
As an alternative you might look at using the WSPECTEXT task to write the spectrum out as a (wavelength,flux) list and use 'wformat' for higher precision, the use a task like NGAUSSFIT (in the STSDAS.FITTING package) to fit it. Off hand, I'm not sure whether NGAUSSFIT gives you any more precision. I'm sure Frank will comment if he has additional ideas.
-Mike
As an alternative you might look at using the WSPECTEXT task to write the spectrum out as a (wavelength,flux) list and use 'wformat' for higher precision, the use a task like NGAUSSFIT (in the STSDAS.FITTING package) to fit it. Off hand, I'm not sure whether NGAUSSFIT gives you any more precision. I'm sure Frank will comment if he has additional ideas.
-Mike
rohit wrote on Nov 24, 2008
Thanks Mike for your response. I was able to get to 6 decimal places by looking at the splot.log file. But I suppose one needs to compare. It will be good to see if Frank has any ideas. Thanks again!
Rohit
Rohit
Francisco Valdes wrote on Nov 24, 2008
Hello Rohit,
Mike is correct that the number of places of precision in the terminal output and the log output is fixed and cannot be changed at runtime. The choice of the number of places was made to fit output to a particular line length and also, as Mike also mentioned, because things are being done in real precision in this ancient task. If we were to revise it we would probably want to do things in double precision.
The main suggestion I would make is to convert the plot to some other units, say pixels, before doing the fit. This may get you the precision you want. In particular, doing the fitting in pixels would get you the position in pixel to the limits of the fitting method. You could then convert the pixel coordinate to wavelength either by knowing your wavelength scale or possibly with wcsctran.
Yours,
Frank Valdes
Mike is correct that the number of places of precision in the terminal output and the log output is fixed and cannot be changed at runtime. The choice of the number of places was made to fit output to a particular line length and also, as Mike also mentioned, because things are being done in real precision in this ancient task. If we were to revise it we would probably want to do things in double precision.
The main suggestion I would make is to convert the plot to some other units, say pixels, before doing the fit. This may get you the precision you want. In particular, doing the fitting in pixels would get you the position in pixel to the limits of the fitting method. You could then convert the pixel coordinate to wavelength either by knowing your wavelength scale or possibly with wcsctran.
Yours,
Frank Valdes
Last post on Nov 24, 2008