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

Home » Public Forums » archive » FIT across images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: FIT across images [message #66054 is a reply to message #66008] Sun, 12 April 2009 16:38 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Apr 8, 8:23 am, bas.base...@virgilio.it wrote:
> Hi all,
> just to let you know, I now figured it out.
>
> I messed it up with
>
> a.      wrong dimensions of “F”, which  has to be the same as “fit”
> b.      bad use of the * “simple” matrix product.
>
> To simplify matrix products I reformed the S matrix as [n,size,size]
> to [n,m], where m=size*size, and so A to [3,m]. I then used the
> function
>
>   iv=replicate(1,(size(x,/dimensions))[0])
>   bx = EXP(-x#A[1,*])
>   F = (iv#A[0,*]) * bx + iv#A[2,*]
>
> where x is now [n] and F is [n,m]. The procedure
>
> fit=mpcurvefit(x,dummyS,W,A,sigma,function_name='expmap',chi sq=chisq,/
> noderivative,/quiet)
>
> now works, with fit=[n,m], and produces the same results as the double
> forloop procedure does. The funny thing is: it is one hundred times
> slower. Maybe there is a lesson to learn here.

Yep, I would have done the fit with a FOR loop. :-)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Positive solution for linear equations
Next Topic: Re: What exactly does the command "strech" do to the colormap?

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

Current Time: Sun Oct 12 06:01:06 PDT 2025

Total time taken to generate the page: 1.68007 seconds