[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POLYWARP question.
Octavi Fors <octavi@fajnm1.am.ub.es> writes:
>
> Hi everybody,
>
> this is regarding POLYWARP function, in particular DEGREE argument. As
> far as I
> understood by the Online Help, POLYWARP accepts the following polynomial
> models
> depending on the value of DEGREE:
>
> ... details omitted ...
>
> This is fine, but poor in flexibility: what happens if I want to
> consider a model like this, which acounts for 1st. degree crossed XY
> terms and 2nd. degree in X and Y?
>
> Xi = kx00 + kx01 Xo + kx10 Yo + kx11 XoYo + kx02Xo2+ kx20Yo2
> Yi = ky00 + ky01 Xo + ky10 Yo + ky11 XoYo + ky02Xo2+ ky20Yo2
>
>
> Does anybody know any implementation/patch of POLYWARP which permits
> more freedom in considering
> coeficients to obtain?
You may be asking for too much. I think routines such as POLYWARP
implement a simple matrix inversion (Kramer's rule?) to determine the
polynomial coefficients, and thus you are stuck with all coefficients.
The polynomial you are interested in fitting is degree two, with a
bunch of terms "missing", ie coefficients are to be forced to zero.
Since the source code is available in POLYWARP.PRO, you may be able to
modify this to your needs. I can't help you there.
I recommend however that you may be able to solve your problem more
straightforwardly by a curve fitting procedure where you explicitly
write out the polynomial you are interested in fitting. Your options
are:
CURVEFIT - simple, fast - IDL distribution
LMFIT - simple, slow - IDL distribution
MPFITFUN - robust, medium speed -
http://cow.physics.wisc.edu/~craigm/idl/idl.html (get MPFIT and MPFITFUN)
Best of luck,
Craig
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@astrog.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------