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

Home » Public Forums » archive » mpfitevalexpr not compiled
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
mpfitevalexpr not compiled [message #86084] Wed, 02 October 2013 02:30 Go to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
I'm using Craig Markwardt's mpfitexpr and I'm trying to use also the companion function mpevalexpr. The problem is that after using mpfitexpr, mpevalexpr is not compiled.

My program stops with the error message:

% Variable is undefined: MPEVALEXPR.

However, right after the program has stopped, I can use it:

IDL> ys = mpevalexpr(fitexpr, xc, p)

And this is happens (and gives reasonable output) without IDL saying anything about compiling mpevalexpr at that point.

From what I understand, mpevalexpr should automatically be compiled when mpfitexpr is used for the first time, since the two functions are in the same file:

IDL> print,routine_info('mpfitexpr',/source,/func)
{ MPFITEXPR /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro}
IDL> print,routine_info('mpevalexpr',/source,/func)
{ MPEVALEXPR /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro}

I'm wondering if this has to do with mpfitexpr apparently being part of the IDL distribution, while mpevalexpr is not? Judging from the documentation this seems to be the case, since this only the first of the following two web pages exists:

http://www.exelisvis.com/docs/MPFITEXPR.html
http://www.exelisvis.com/docs/MPEVALEXPR.html

However, in my !path, /home/mats/idl/bin/markwardt/mpfit/ appears before any of the /usr/local/rsi/idl_7.1/... entries so I'm not sure why this would matter. Also, the output from routine_info above suggests that it is /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro that is compiled.

So I'm confused. Why is mpevalexpr not available right away, why can it be used right after the program stops, and what can I do to avoid the problem?


I'm using IDL Version 7.1.1.
Re: mpfitevalexpr not compiled [message #86085 is a reply to message #86084] Wed, 02 October 2013 02:32 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den onsdagen den 2:e oktober 2013 kl. 11:30:25 UTC+2 skrev Mats Löfdahl:
> I'm using Craig Markwardt's mpfitexpr and I'm trying to use also the companion function mpevalexpr. The problem is that after using mpfitexpr, mpevalexpr is not compiled.
>
>
>
> My program stops with the error message:
>
>
>
> % Variable is undefined: MPEVALEXPR.
>
>
>
> However, right after the program has stopped, I can use it:
>
>
>
> IDL> ys = mpevalexpr(fitexpr, xc, p)
>
>
>
> And this is happens (and gives reasonable output) without IDL saying anything about compiling mpevalexpr at that point.
>
>
>
> From what I understand, mpevalexpr should automatically be compiled when mpfitexpr is used for the first time, since the two functions are in the same file:
>
>
>
> IDL> print,routine_info('mpfitexpr',/source,/func)
>
> { MPFITEXPR /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro}
>
> IDL> print,routine_info('mpevalexpr',/source,/func)
>
> { MPEVALEXPR /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro}
>
>
>
> I'm wondering if this has to do with mpfitexpr apparently being part of the IDL distribution, while mpevalexpr is not? Judging from the documentation this seems to be the case, since this only the first of the following two web pages exists:
>
>
>
> http://www.exelisvis.com/docs/MPFITEXPR.html
>
> http://www.exelisvis.com/docs/MPEVALEXPR.html
>
>
>
> However, in my !path, /home/mats/idl/bin/markwardt/mpfit/ appears before any of the /usr/local/rsi/idl_7.1/... entries so I'm not sure why this would matter. Also, the output from routine_info above suggests that it is /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro that is compiled.
>
>
>
> So I'm confused. Why is mpevalexpr not available right away, why can it be used right after the program stops, and what can I do to avoid the problem?
>
>
>
>
>
> I'm using IDL Version 7.1.1.

I typoed in the subject line, but I'm really not trying to use the non-existing function mpfitevalexpr...
Re: mpfitevalexpr not compiled [message #86087 is a reply to message #86084] Wed, 02 October 2013 04:36 Go to previous messageGo to next message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Wed, 2 Oct 2013 02:30:25 -0700 (PDT), Mats Löfdahl wrote:

> I'm using Craig Markwardt's mpfitexpr and I'm trying to use also the companion function mpevalexpr. The problem is that after using mpfitexpr, mpevalexpr is not compiled.
>
> My program stops with the error message:
>
> % Variable is undefined: MPEVALEXPR.
>
> However, right after the program has stopped, I can use it:
>
> IDL> ys = mpevalexpr(fitexpr, xc, p)
>
Do you use the compile option "strictarr" (or "IDL2") in your program
(which calls mpevalexpr and then throws the error message)? If not,
IDL don't know that mpevalexpr is a function, if it compiles your
program before mpfitexpr. If this is true and you don't want to use
strictarr, you can try to explicitly declare mpevalexpr as a function.
Add the statement
forward_function mpevalexpr
in the header of your program to explicitly declare mpevalexpr as a
function.

Cheers, Heinz
Re: mpfitevalexpr not compiled [message #86088 is a reply to message #86087] Wed, 02 October 2013 04:49 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den onsdagen den 2:e oktober 2013 kl. 13:36:47 UTC+2 skrev Heinz Stege:
>
> Do you use the compile option "strictarr" (or "IDL2") in your program
> (which calls mpevalexpr and then throws the error message)? If not,
> IDL don't know that mpevalexpr is a function, if it compiles your
> program before mpfitexpr. If this is true and you don't want to use
> strictarr, you can try to explicitly declare mpevalexpr as a function.
> Add the statement
> forward_function mpevalexpr
> in the header of your program to explicitly declare mpevalexpr as a
> function.

Ah, yes that works. Thanks!

(No, I don't use strictarr. And I'm still confused about why IDL can figure it out the second time when it could not do it the first time. But now I know how to work around it.)
Re: mpfitevalexpr not compiled [message #86383 is a reply to message #86084] Sun, 03 November 2013 12:06 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, October 2, 2013 5:30:25 AM UTC-4, Mats Löfdahl wrote:
> I'm using Craig Markwardt's mpfitexpr and I'm trying to use also the companion function mpevalexpr. The problem is that after using mpfitexpr, mpevalexpr is not compiled.
>
>
>
> My program stops with the error message:
>
>
>
> % Variable is undefined: MPEVALEXPR.
>
>
>
> However, right after the program has stopped, I can use it:
>
>
>
> IDL> ys = mpevalexpr(fitexpr, xc, p)
>
>
>
> And this is happens (and gives reasonable output) without IDL saying anything about compiling mpevalexpr at that point.
>
>
>
> From what I understand, mpevalexpr should automatically be compiled when mpfitexpr is used for the first time, since the two functions are in the same file:
>
>
>
> IDL> print,routine_info('mpfitexpr',/source,/func)
>
> { MPFITEXPR /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro}
>
> IDL> print,routine_info('mpevalexpr',/source,/func)
>
> { MPEVALEXPR /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro}
>
>
>
> I'm wondering if this has to do with mpfitexpr apparently being part of the IDL distribution, while mpevalexpr is not? Judging from the documentation this seems to be the case, since this only the first of the following two web pages exists:
>
>
>
> http://www.exelisvis.com/docs/MPFITEXPR.html
>
> http://www.exelisvis.com/docs/MPEVALEXPR.html
>
>
>
> However, in my !path, /home/mats/idl/bin/markwardt/mpfit/ appears before any of the /usr/local/rsi/idl_7.1/... entries so I'm not sure why this would matter. Also, the output from routine_info above suggests that it is /home/mats/idl/bin/markwardt/mpfit/mpfitexpr.pro that is compiled.
>
>
>
> So I'm confused. Why is mpevalexpr not available right away, why can it be used right after the program stops, and what can I do to avoid the problem?

It was a bit of a mistake for me to hide MPEVALEXPR() inside of mpfitexpr.pro. I planned for it to be a diagnostic debugging aid, not a production-use function!

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: New Coyote Store Up and Running
Next Topic: Converting a string to variable name

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

Current Time: Wed Oct 08 09:09:10 PDT 2025

Total time taken to generate the page: 0.00670 seconds