Re: MPFITFUN problem [message #81239 is a reply to message #44896] |
Tue, 28 August 2012 07:54  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Tuesday, August 28, 2012 7:43:11 AM UTC-4, Rui She wrote:
> Hi,
>
> I met a problem, when I used MPFITFUN.pro to fit a base of data using a user function, the procedure gave a error as:
>
> % MPFIT: Error detected while calling mpfitfun_eval:
>
> % MPFIT: Array dimensions must be greater than 0.
>
> % MPFIT: Error condition detected. Returning to MAIN level.
>
> % MPFITFUN: Error detected while calling mpfitfun_eval: Array dimensions must be greater than 0.
>
>
>
> I believe my user function was right, and I met this problem sometimes(not all data, error occurred about every 50 case), what's more, if I changed the start value of the parameters, it usually got to normal. So I think this may be a hidden bug of the MPFIT.
>
> Or someone has good idea?
I am 99% certain the error is happening inside of your user function. It's probably at the point where you create an array with fltarr() or dblarr() or make_array().
Here's a well-kept secret. You can call MPFITFUN() with the /NOCATCH keyword set. When NOCATCH is set, MPFITFUN will not try to trap any errors, and IDL will break at the location of the error. Then start debugging.
Craig
|
|
|