Re: Least square fitting [message #60324] |
Tue, 20 May 2008 04:16  |
Chris[5]
Messages: 16 Registered: May 2008
|
Junior Member |
|
|
On May 19, 11:41 pm, MichaelT <michael.theus...@googlemail.com> wrote:
> Hi all,
>
> I have a problem with a rather complicated function depending on four
> parameters which I try to find using least square fitting and I don't
> know exactly how to do it.
>
> The basic problem is the following:
> I have an astronomical image of a star field and try to relate the sky
> coordinates (right ascension, declination) of the stars to the pixel
> coordinates (x, y).
>
> The function to relate the two depends on the not accurately known
> parameters focal length of the lens (f), the rotation of the field of
> view with respect of the north direction (beta) and the center sky
> coordinates of the image (bc, lc).
> I know the sky coordinates of certain stars accurately (bs, ls) as
> well as their pixel coordinates (xs, ys) and the center pixel
> coordinates of the image (xc, yc).
>
> Generally, the function is as follows (equivalent for ys', but the
> functions f1-f5 are slightly different):
>
> xs' = f1(xc, f2(f, f3(ls, lc, bs, bc)), f4(ls, lc, bs, bc, f5(ls, lc,
> bs, bc)), beta)
>
> The functions f1-f5 look rather complicated and contain many sines,
> cosines and acos etc.
>
> I then did the following as I didn't know better:
> First I minimized all this with respect of beta, then lc and bc and
> after that f starting with some initial values for the four
> parameters. Then I started all over again, beta, lc, bc, f (in a loop)
> until the difference between the known coordinates (xs, ys) and the
> calculated ones (xs', ys') reached a minimum.
>
> However, the minimum deviation reached at the end of the loop pretty
> much depends on the initially chosen values of beta, lc, bc and f.
>
> There certainly is a more optimal way to do the least square fitting
> than the one that I have chosen (partial derivatives etc.), but that
> f1 depends on f2 and f4 and these again depend on f3 and f5 is giving
> me some unsolvable problems.
>
> How should I proceed? What would be a good method to minimize this?
>
> Thanks, Michael
>
> The main problem now is for me, that f1 depends on f2 and f4 and that
> f2 and f4 themselves depend on f3 and f5.
How big is the field of view? If it is small enough (and the optics
consistent enough) that you don't need to worry about the pixel scale
(number of arcsecs/pixel) changing over the image, than the problem
seems easier, since most of the parameters to solve for ought to be
independent. I don't know how statistically kosher this is, but here
are some thoughts:
Assuming that the pixel scale p in arcsec/pixel is a constant, then
the RA,DEC (a,d) of stars are related to their pixel coords (x,y) by
a=ac+((x-xc)*cos(beta)-(y-yc)*sin(beta))*p
d=dc+((x-xc)*sin(beta)-(y-yc)*cos(beta))*p
where ac,dc,xc,yc are the sky and pixel coordinates of the center
pixel. Beta is the angle of rotation of the image y axis with respect
to north. I guess also here I've assumed that RA increases to the
right (backwards from convention) and that the image is near the
celestial equator so that 1 second of right ascension = 1 second of
declination. Both of these are easy to generalize (switch some of the
signs for East pointing left, and add in a cos(dec) term for off-
equator correction). Neither of these should affect the following
analysis.
For every (a,d) (x,y) pair, compute the pixel distance and angular
separation. A simple linear regression then determines p (an easier
but sloppier method would be to calculate p for each pair and take a
weighted average). p is independent of all of the other parameters, so
(to me) it seems like you could do this seperately.
Now that you know p, for a bunch of pairs of stars, compute the x
displacement in pixels and the RA displacement in arcsec. Convert the
x displacement in pixels to an angular distance using p. Now use the
equations above to solve for beta. (you can also use the y coordinates
and/or decs just as easily).
Finally, determining ac and dc is one more linear regression.
Is this the sort of thing you are trying to do?
Chris
|
|
|