comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Spline Fitting and FWHM
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Spline Fitting and FWHM [message #22476] Tue, 21 November 2000 00:00
Peter den Hartog is currently offline  Peter den Hartog
Messages: 1
Registered: November 2000
Junior Member
Hi,
I have some data tabulated in two arrays (pixels versus intensities) .
The idea is to fit a cubic spline to the data with the function SPLINE
but I am struggling with the following problem: I would like to be able
to extract a full width at half maximum and at quarter maximum out of
the fit. How can I accomplish this, as the function SPLINE only reads
x-values and returns corresponding, fitted y-values as result, while I
am interested in the reverse.

Thanks!

Omar Noor
student astronomy
Utrecht University Netherlands
o.f.d.noor@phys.uu.nl
Re: Spline Fitting and FWHM [message #22616 is a reply to message #22476] Tue, 21 November 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Martin Schultz <martin.schultz@dkrz.de> writes:
...
> the data. For this you should probably use CM_FIT by Craig Markwardt.
...

I agree with everything Martin said, *except* that it's named MPFIT,
and it's located here :-)

http://cow.physics.wisc.edu/~craigm/idl/idl.html

There are some specialized peak-fitting procedures ready to use there.

Also, if you still insist on using splines, then I suggest you use the
SPL_INIT and SPL_INTERP (sp?) functions. They seem to be much faster
and more robust.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Spline Fitting and FWHM [message #22623 is a reply to message #22476] Tue, 21 November 2000 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Peter den Hartog wrote:
>
> Hi,
> I have some data tabulated in two arrays (pixels versus intensities) .
> The idea is to fit a cubic spline to the data with the function SPLINE
> but I am struggling with the following problem: I would like to be able
> to extract a full width at half maximum and at quarter maximum out of
> the fit. How can I accomplish this, as the function SPLINE only reads
> x-values and returns corresponding, fitted y-values as result, while I
> am interested in the reverse.
>
> Thanks!
>
> Omar Noor
> student astronomy
> Utrecht University Netherlands
> o.f.d.noor@phys.uu.nl

If you want to extract meaningful information from a fit, you must
use a function that gives you meaningful information. A spline is
designed to make data smoother, but it does not give you any
analytical information. The normal thing to do is to define an
analytical function that resembles your data and fit that function to
the data. For this you should probably use CM_FIT by Craig Markwardt.
Typical functions used in spectral analysis (and, here please excuse
my ignorance) are gauss, or lorentz functions.

... then again, if you insist on splines and extracting a rather
ill-defined quantity ;-), you could do it with an iterative search
algorithm:
(1) find the maximum
(2) for the left and right side move away from the maximum until you
are below 1/2 max value
(3) decrease step size and move back up
(4) decrease step size and move back down
(...) and so on until you are satisfied with the precision

Regards,
Martin

--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL under PPCLinux?
Next Topic: filtering problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:11:52 PDT 2025

Total time taken to generate the page: 0.00744 seconds