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

Home » Public Forums » archive » Re: mpfitexpr using functargs
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
Re: mpfitexpr using functargs [message #49343] Thu, 20 July 2006 09:44
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
Thanks, I thought I tried that... I'll give it a go.

Craig Markwardt wrote:

> The simple answer is, use 'mpfitFUN' if you are using a fitting function.
> Then you could do this,
> function myfunct, x, p, other=other
> ;; calculate y using x, p, and other
> return, y
> end
>
> and
> pout = mpfitfun('myfunct', x,data,err,p,parinfo=parinfo, functargs={other:other}
>
> Craig
Re: mpfitexpr using functargs [message #49345 is a reply to message #49343] Thu, 20 July 2006 09:02 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"hradilv" <hradilv@yahoo.com> writes:
> (Craig M.,)
>
> I'm having trouble figuring out how to use the functargs keyword to
> mpfitexpr.
>
> In particular, how do I "retrieve" the values from within "myfunct"?
> Your documentation mentions "PRIVATE"?
>
> This is what I _think_ it should be:
>
> function myfunct, x, p, other=other
> ;; calculate y using x, p, and other
> return, y
> end

The simple answer is, use 'mpfitFUN' if you are using a fitting function.
Then you could do this,
function myfunct, x, p, other=other
;; calculate y using x, p, and other
return, y
end

and
pout = mpfitfun('myfunct', x,data,err,p,parinfo=parinfo, functargs={other:other}

Craig



>
> pro mainpro, data
>
> ....
> other = read_somefixed_data(afile)
> f = {other:other}
> pout = mpfitexpr('myfunct',x,data,err,p,parinfo=parinfo,functargs=f )
>
> return
> end
>

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: String Spliting
Next Topic: IDL syntax coloring for BBEdit and TextWrangler

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

Current Time: Fri Oct 10 11:12:48 PDT 2025

Total time taken to generate the page: 0.56121 seconds