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

Home » Public Forums » archive » Problem with Parinfo on Craig Markwardt's MPFITPEAK
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
Problem with Parinfo on Craig Markwardt's MPFITPEAK [message #80662] Wed, 27 June 2012 06:07 Go to next message
Tito is currently offline  Tito
Messages: 16
Registered: March 2012
Junior Member
I am trying to fit Gaussians/Lorentzians with mpfitpeak on which I know the center, the amplitude and the Background offset and I want those 3 to be fixed and I am searching only the Sigma width. I tried this:

parinfo = replicate({value:0.0d, fixed:0, limited:[0,0], $
limits:[0.0d,0.0d]}, 4)
parinfo[0].fixed = 1b
parinfo[1].fixed = 1b
parinfo[2].limited[0] = 1b
parinfo[2].limits[0] = 0.005
parinfo[3].fixed = 1b
parinfo[*].value = [1.0d - stell_dep[i],xaxis[index[i]],0.005, 0.0]

y_fit2 = mpfitpeak(xaxis[minus2+ind:index[i] + ind2],$
1-spec[minus2+ind:index[i] + ind2],$
p2, parinfo = parinfo)

But this just is not working..... As I see it fix the center but all the rest of the parameters are not fixed and I have a terrible fit in the end.

Anybody know what I am doing wrong?

All the best!
Trifon
Re: Problem with Parinfo on Craig Markwardt's MPFITPEAK [message #80735 is a reply to message #80662] Mon, 02 July 2012 06:22 Go to previous message
Tito is currently offline  Tito
Messages: 16
Registered: March 2012
Junior Member
Craig, Alain

Sorry for the late answer!

Thanks for the help!

Everything is fine now.

All the best!
Re: Problem with Parinfo on Craig Markwardt's MPFITPEAK [message #80742 is a reply to message #80662] Fri, 29 June 2012 23:45 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Friday, June 29, 2012 10:08:09 AM UTC-5, alx wrote:
> On 29 juin, 11:44, Trifon Trifonov <tito_trifo...@abv.bg> wrote:
>> Anybody work with mpfitpeak?
>> I still can't figure out what I am doing wrong...
>
> I read in Craig's documentation:
>
> ESTIMATES - Array of starting values for each parameter of the
> ; model. (...) If ESTIMATES is not set,
> ; then the starting values are estimated from the data
> ; directly, before fitting. (This also means that
> ; PARINFO.VALUES is ignored.)
>
> alain.

Right. MPFITPEAK is a drop-in replacement for GAUSSFIT. For compatibility it honors the ESTIMATES keyword. Use that keyword.

Sorry about that. At least one other person has been tripped up by this.

Craig
Re: Problem with Parinfo on Craig Markwardt's MPFITPEAK [message #80746 is a reply to message #80662] Fri, 29 June 2012 08:08 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On 29 juin, 11:44, Trifon Trifonov <tito_trifo...@abv.bg> wrote:
> Anybody work with mpfitpeak?
> I still can't figure out what I am doing wrong...

I read in Craig's documentation:

ESTIMATES - Array of starting values for each parameter of the
; model. (...) If ESTIMATES is not set,
; then the starting values are estimated from the data
; directly, before fitting. (This also means that
; PARINFO.VALUES is ignored.)

alain.
Re: Problem with Parinfo on Craig Markwardt's MPFITPEAK [message #80750 is a reply to message #80662] Fri, 29 June 2012 02:44 Go to previous message
Tito is currently offline  Tito
Messages: 16
Registered: March 2012
Junior Member
Anybody work with mpfitpeak?
I still can't figure out what I am doing wrong...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: convert from Julian date to calendar date and vice verse
Next Topic: Equivalent of direct graphics PSYM=10 in function graphics?

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

Current Time: Wed Oct 08 13:43:46 PDT 2025

Total time taken to generate the page: 0.00640 seconds