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

Home » Public Forums » archive » Re: 2-d histogram and Routines of same name
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
Re: 2-d histogram and Routines of same name [message #70961] Tue, 18 May 2010 14:58
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<55c0cb24-cb7b-4365-8258-c1b21601b133@b21g2000vbh.googlegroups.com>,
Jeremy Bailin <astroconst@gmail.com> wrote:

> On May 18, 1:48�pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>> In article <hsrli1$s0...@speranza.aioe.org>,
>>
>> �mgalloy <mgal...@gmail.com> wrote:
>>> It seems that PRODUCT is a built-in, not .pro code or in a DLM. So I
>>> made my own PRODUCT routine, but couldn't get IDL to ever use it, even
>>> if I manually compiled it. IDL always found the built-in PRODUCT first
>>> and used it. Maybe this was different in older versions of IDL? The docs
>>> say PRODUCT was introduced in IDL 5.6, but I only have access back to
>>> IDL 6.4 where it still seems to be a built-in.
>>
>> For a few built-in IDL routines I have fixed bugs or made
>> minor modifications (routines for which ITT provides the
>> source code). �I keep these in a separate directory and insert that
>> directory into the IDL search path ahead of the default search
>> path.
>>
>> Maybe that won't work for those routines for which ITT does
>> not provide source code (precompiled routines) ?
>>
>> Ken
>
> I'd be very hesitant to knowingly create a function with the same name
> as one that is part of the official distribution, for exactly the
> reasons we're seeing here. When I extend/bugfix ITT routines, I give
> them a slightly different name (usually either prefixed by JB or
> having some suffix that indicates what's been changed, e.g. MEAN_D).

Yes, what you suggest is normally the best approach.

Unfortunately these are functions that are called by other built-in
routines in the iTools library, and I don't have the fortitude to
attempt to duplicate that entire code base, change names, change all
references to the updated functions, etc.

I limit this practice to a handful of routines.

Cheers, Ken
Re: 2-d histogram and Routines of same name [message #70965 is a reply to message #70961] Tue, 18 May 2010 12:53 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On May 18, 1:48 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article <hsrli1$s0...@speranza.aioe.org>,
>
>  mgalloy <mgal...@gmail.com> wrote:
>> It seems that PRODUCT is a built-in, not .pro code or in a DLM. So I
>> made my own PRODUCT routine, but couldn't get IDL to ever use it, even
>> if I manually compiled it. IDL always found the built-in PRODUCT first
>> and used it. Maybe this was different in older versions of IDL? The docs
>> say PRODUCT was introduced in IDL 5.6, but I only have access back to
>> IDL 6.4 where it still seems to be a built-in.
>
> For a few built-in IDL routines I have fixed bugs or made
> minor modifications (routines for which ITT provides the
> source code).  I keep these in a separate directory and insert that
> directory into the IDL search path ahead of the default search
> path.
>
> Maybe that won't work for those routines for which ITT does
> not provide source code (precompiled routines) ?
>
> Ken

I'd be very hesitant to knowingly create a function with the same name
as one that is part of the official distribution, for exactly the
reasons we're seeing here. When I extend/bugfix ITT routines, I give
them a slightly different name (usually either prefixed by JB or
having some suffix that indicates what's been changed, e.g. MEAN_D).

-Jeremy.
Re: 2-d histogram and Routines of same name [message #70968 is a reply to message #70965] Tue, 18 May 2010 10:48 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <hsrli1$s0r$1@speranza.aioe.org>,
mgalloy <mgalloy@gmail.com> wrote:

> It seems that PRODUCT is a built-in, not .pro code or in a DLM. So I
> made my own PRODUCT routine, but couldn't get IDL to ever use it, even
> if I manually compiled it. IDL always found the built-in PRODUCT first
> and used it. Maybe this was different in older versions of IDL? The docs
> say PRODUCT was introduced in IDL 5.6, but I only have access back to
> IDL 6.4 where it still seems to be a built-in.

For a few built-in IDL routines I have fixed bugs or made
minor modifications (routines for which ITT provides the
source code). I keep these in a separate directory and insert that
directory into the IDL search path ahead of the default search
path.

Maybe that won't work for those routines for which ITT does
not provide source code (precompiled routines) ?

Ken
Re: 2-d histogram and Routines of same name [message #70974 is a reply to message #70968] Tue, 18 May 2010 05:59 Go to previous message
Mrunmayee is currently offline  Mrunmayee
Messages: 24
Registered: May 2009
Junior Member
On May 18, 5:24 pm, Michael Galloy <mgal...@gmail.com> wrote:
> On 5/17/10 11:04 pm, Mrunmayee wrote:
>
>> PS: What's OP in Wayne's post? Other Poster?
>
> OP = original poster
>
> Mike
> --www.michaelgalloy.com
> Research Mathematician
> Tech-X Corporation


Oh! (My hindsight has 20 sheeps now.)
Re: 2-d histogram and Routines of same name [message #70978 is a reply to message #70974] Tue, 18 May 2010 05:24 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/17/10 11:04 pm, Mrunmayee wrote:
> PS: What's OP in Wayne's post? Other Poster?

OP = original poster

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
Re: 2-d histogram and Routines of same name [message #70981 is a reply to message #70978] Mon, 17 May 2010 22:04 Go to previous message
Mrunmayee is currently offline  Mrunmayee
Messages: 24
Registered: May 2009
Junior Member
On May 17, 8:51 pm, David Fanning <n...@dfanning.com> wrote:
> wlandsman writes:
>> product.pro was removed from the NASA Library on 25-Nov-2007. --Wayne
>
> Whoops! My number one rule is: Make sure you have the
> latest version of the Library before complaining.
>
> Humm. I thought I updated mine when I got the new
> OS!? Oh, well. Compassion is the end result of making
> mistakes. At least, I hope it is. :-)
>

Same here! I have the goddard library which is bundled in SDSS
library. This, I downloaded in November 2008, but product.pro
definitely shows up in goddard/pro/misc. Is that different from
NASA's? I tried to move the other routine out of path, reset session,
and use hist_nd again. It still gave me KEYWORD error.

Of course, I read Wayne's reply and it makes sense.. My IDL version is
6.0.3 Student's. Of course it would give error. So I commented the
keyword for the time being and it works for me. When I have enough
money, I will upgrade to better versions..

Thanks everyone for your input!

PS: What's OP in Wayne's post? Other Poster?
Re: 2-d histogram and Routines of same name [message #70987 is a reply to message #70981] Mon, 17 May 2010 08:51 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
wlandsman writes:

> product.pro was removed from the NASA Library on 25-Nov-2007. --Wayne

Whoops! My number one rule is: Make sure you have the
latest version of the Library before complaining.

Humm. I thought I updated mine when I got the new
OS!? Oh, well. Compassion is the end result of making
mistakes. At least, I hope it is. :-)

Cheers,

David

P.S. Maybe you have to *delete* what is already there,
before you overwrite with new stuff. :-(

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: 2-d histogram and Routines of same name [message #70988 is a reply to message #70987] Mon, 17 May 2010 08:22 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On May 17, 10:58 am, mgalloy <mgal...@gmail.com> wrote:

> It seems that PRODUCT is a built-in, not .pro code or in a DLM. So I
> made my own PRODUCT routine, but couldn't get IDL to ever use it, even
> if I manually compiled it. IDL always found the built-in PRODUCT first
> and used it. Maybe this was different in older versions of IDL? The docs
> say PRODUCT was introduced in IDL 5.6, but I only have access back to
> IDL 6.4 where it still seems to be a built-in.

It was built-in back in IDL 5.6. My only guess is that the OP has
an IDL version of V6.0 or earlier (to go along with his old version of
the NASA library?), or perhaps is using GDL. (The /PRESERVE_TYPE
keyword to PRODUCT() that is causing the error was introduced in
V6.1). --Wayne
Re: 2-d histogram and Routines of same name [message #70989 is a reply to message #70988] Mon, 17 May 2010 07:58 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/17/10 6:57 AM, David Fanning wrote:
> Mrunmayee writes:
>
>> Then I felt this is a histogram problem. So went to IDL's hist_2d
>> which does what I want, but doesn't return reverse indices. But I did
>> find hist_nd written byt David. This routine uses PRODUCT(.., /
>> Preserve_Type). Unfortunately, idlastrolib ALSO contains the routine
>> of the same name which DOESN'T use the keywords in IDL's routine. So I
>> keep getting KEYWORD NOT ALLOWED error. My guess is that (becaue of
>> various issues, I have to set my IDL_PATH such that) this other
>> routine always get compiled first. When I have such a problem, of
>> having two routines of same name doing things differently, I usually
>> compile with full path. E.g
>>
>> .com /path/to/routine/I/want/routinename
>>
>> But I don't think there is any product.pro in IDL's libs. So my second
>> problem is how do I tell IDL to use inbuilt function instead of user
>> written when there is no .pro file associated with it?
>
> Well, you are right, your first problem is a 2D
> histogram problem. :-)
>
> Your second problem is more worrisome. (And it is
> JD Smith's routine, not mine. I just host it.) This
> may truly be one of those problems that don't have
> a good solution. Or, maybe I just haven't thought of
> it yet.
>
> If I just wanted to get on with my day, I'd probably
> delete product.pro from the NASA library. It seems to
> be a subset of the IDL routine, although there is no
> question in my mind which was on the IDL scene first.
>
> But I can absolutely see why this isn't a good long-term
> solution. Maybe PRODUCT has been in IDL long enough now
> that Wayne could safely remove it from the NASA Library.
> I don't know. I'd like to hear what the principles
> have to say about this.

It seems that PRODUCT is a built-in, not .pro code or in a DLM. So I
made my own PRODUCT routine, but couldn't get IDL to ever use it, even
if I manually compiled it. IDL always found the built-in PRODUCT first
and used it. Maybe this was different in older versions of IDL? The docs
say PRODUCT was introduced in IDL 5.6, but I only have access back to
IDL 6.4 where it still seems to be a built-in.

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
Re: 2-d histogram and Routines of same name [message #70990 is a reply to message #70989] Mon, 17 May 2010 07:46 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
> But I can absolutely see why this isn't a good long-term
> solution. Maybe PRODUCT has been in IDL long enough now
> that Wayne could safely remove it from the NASA Library.
> I don't know. I'd like to hear what the principles
> have to say about this.

product.pro was removed from the NASA Library on 25-Nov-2007. --Wayne
Re: 2-d histogram and Routines of same name [message #70991 is a reply to message #70990] Mon, 17 May 2010 05:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mrunmayee writes:

> Then I felt this is a histogram problem. So went to IDL's hist_2d
> which does what I want, but doesn't return reverse indices. But I did
> find hist_nd written byt David. This routine uses PRODUCT(.., /
> Preserve_Type). Unfortunately, idlastrolib ALSO contains the routine
> of the same name which DOESN'T use the keywords in IDL's routine. So I
> keep getting KEYWORD NOT ALLOWED error. My guess is that (becaue of
> various issues, I have to set my IDL_PATH such that) this other
> routine always get compiled first. When I have such a problem, of
> having two routines of same name doing things differently, I usually
> compile with full path. E.g
>
> .com /path/to/routine/I/want/routinename
>
> But I don't think there is any product.pro in IDL's libs. So my second
> problem is how do I tell IDL to use inbuilt function instead of user
> written when there is no .pro file associated with it?

Well, you are right, your first problem is a 2D
histogram problem. :-)

Your second problem is more worrisome. (And it is
JD Smith's routine, not mine. I just host it.) This
may truly be one of those problems that don't have
a good solution. Or, maybe I just haven't thought of
it yet.

If I just wanted to get on with my day, I'd probably
delete product.pro from the NASA library. It seems to
be a subset of the IDL routine, although there is no
question in my mind which was on the IDL scene first.

But I can absolutely see why this isn't a good long-term
solution. Maybe PRODUCT has been in IDL long enough now
that Wayne could safely remove it from the NASA Library.
I don't know. I'd like to hear what the principles
have to say about this.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLWAVE idlwave-surround-by-by-blank
Next Topic: Re: x-y offsets

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

Current Time: Wed Oct 08 19:20:29 PDT 2025

Total time taken to generate the page: 0.00680 seconds