Re: mpfitexpr using functargs [message #49343] |
Thu, 20 July 2006 09:44 |
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  |
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
------------------------------------------------------------ --------------
|
|
|