Re: why is amoeba not working ?? [message #54932] |
Wed, 18 July 2007 01:36 |
wlandsman@jhu.edu
Messages: 12 Registered: September 2006
|
Junior Member |
|
|
"trex" <Terry.Suer@gmail.com> wrote in message
news:1184722537.753989.104610@d30g2000prg.googlegroups.com.. .
> I am trying to do a image subtraction minimization using amoeba.
> When I try running the code below I get this error. Any ideas?
AMOEBA requires that the supplied function return a *scalar* value, whereas
your FUNC is returning an array the same size as the two images. You might
insert a TOTAL() into the last line of FUNC so that it returns a scalar,
e.g.
res = total( abs(s - xyshift( (i*q[2]), q[0], q[1])) )
though I think I would instead prefer to maximize the correlation
coefficient of the two images. --Wayne
>
> REPLICATE: Expression must be a scalar in this context: <DOUBLE
> Array[201, 151]>.
> % Execution halted at: AMOEBA 161 /opt/rsi/idl/lib/
> amoeba.pro
> % $MAIN$ 28 /home/idl/func.pro
>
>
>
> FUNCTION FUNC,q
>
> i=mrdfits('/home/imcen.fits',/silent)
> s=mrdfits('/home/spcen.fits',/silent)
> res = s-xyshift((i*q[2]),q[0],q[1])
>
> return,res
> END
|
|
|