Passing keywords to DLM [message #40374] |
Sun, 08 August 2004 12:43  |
jargoogle
Messages: 11 Registered: April 2004
|
Junior Member |
|
|
Hello,
I'm adapting Henry Chapman's DLM (itself modified from an earlier
version) for calling the FFTW v3 fast fourier transform library.
Henry's dlm:
http://groups.google.com/groups?as_umsgid=b8f3f671.031213215 8.5cda69f4@posting.google.com
I'm working on an Ultra Sparc 5 running Solaris 7 using IDL version
5.6 and Solaris compilers. So far, so good, except that only 2 of 7
keywords are recognized. Of the keywords, (X, Y, Z, MEDIUM, HI,
OVERWRITE, and CLEANUP), only MEDIUM and HI are recognized.
All are treated as read only input boolean keywords. In the kw_pars[]
array, they all look something like:
{"X", IDL_TYP_LONG, 1, IDL_KW_ZERO|IDL_KW_VALUE|15, 0,
IDL_KW_OFFSETOF(x)},
My IDL wrapper syntax looks something like:
dataOut = fftdft3D_IDL(dataIn, direction, [x=x, y=y, z=z,
medium=medium, $
hi=hi, overwrite=overwrite, cleanup=cleanup])
The following perform as expected:
dataOut = fftdft3D_IDL(findgen(16,16,16), -1)
dataOut = fftdft3D_IDL(findgen(16,16,16), -1, /medium)
dataOut = fftdft3D_IDL(findgen(16,16,16), -1, /hi)
While no other option using the keywords works:
dataOut = fftdft3D_IDL(findgen(16,16,16), -1, /x)
% Loaded DLM: FFTDFT3D_IDL.
% Keyword X not allowed in call to: FFTDFT3D_IDL
% Execution halted at: $MAIN$
Now, I thought that perhaps there was an ambiguity with single letter
keywords, but that doesn't explain why overwrite and cleanup are not
recognized. They generate the same "not allowed" message.
Yet the keywords that are "not allowed" are all syntactically the same
as far as the c-code declarations of kw_pars[] and KW_RESULT are
concerned.
The DLM:
MODULE fftdft3D_IDL
DESCRIPTION 3-dimensional Complex fftw (v.3)
VERSION $Revision: 1.0 $
BUILD_DATE $Date: Thu Aug 5 09:19:05 MDT 2004$
SOURCE J. Roberts
FUNCTION fftdft3D_IDL 1 2 KEYWORDS
Any ideas?
Stumped,
JG.
|
|
|
Re: Passing keywords to DLM [message #40485 is a reply to message #40374] |
Tue, 10 August 2004 06:05  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
This is the beauty of Ronn's book. Everything is explained in plain English.
An the alphabetical order is also clearly mentioned in there.
Haje
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1b8186298f1c396898981b@news.frii.com...
> JGG writes:
>
>> I did a search on the manual pages to see if the alphabetical order
>> is mentioned, but found nothing. I note that all the keyword
>> processing examples given in the manual declare the values in
>> IDL_KW_PAR in alphabetical order. Perhaps this requirement is
>> mentioned elsewhere?
>
> Well, I think have to know that "lexical order" means
> "alphabetical order". I presume most computer programmers
> have taken at least one linguistics class. In any case,
> no one here has probably run into the problem, because
> all decent programmers define their keywords alphabetically
> as a matter of course. :^)
>
> Cheers,
>
> David
>
> P.S. What do you mean you don't alphabetize your
> keywords!? What's wrong with you!
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Passing keywords to DLM [message #40486 is a reply to message #40374] |
Tue, 10 August 2004 05:49  |
kuyper
Messages: 5 Registered: June 2004
|
Junior Member |
|
|
jargoogle@explore4life.com (JGG) wrote in message news:<4ed7753c.0408091922.7ff5e2b0@posting.google.com>...
...
> I've always imagined a use for a journal of failed research. Sure,
> sometimes brilliant people discover the same thing at the same time. Think of the numbers though of all the people who try the same
> unworkable idea and fail silently, leaving later generations to repeat
> the waste of time. Too bad the journal of failed research would
> probably fill every shelf on the planet. It would have to be tightly
> refereed to include only those ideas most often entertained and
> studied with no useful results.
Richard Feynman wrote that a good scientist should always publish the
results of his work, whether or not he finds what he's looking for.
It's a fundamental part of what "integrity" means for a scientist, and
the reason you give is one of the reasons why this is so.
|
|
|
Re: Passing keywords to DLM [message #40494 is a reply to message #40374] |
Mon, 09 August 2004 21:05  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
JGG writes:
> Wouldn't it be interesting to catalog common errors, sort them, and in
> a tutorial list the top 5 common mistakes? Something like, "Here are
> the top 5 things that did NOT work when people tried to implement the
> ideas described here and here is why they failed."
It would be interesting. Of course, "Device, Decomposed=0"
would be at the top of the list by a wide margin. Followed,
I suppose, by "Device, Color=1, Bits_Per_Pixel=8" for color
PostScript output. But beyond that, I don't know. But
I'm pretty sure alphabetizing keywords wouldn't even
make the top 100. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Passing keywords to DLM [message #40495 is a reply to message #40374] |
Mon, 09 August 2004 20:22  |
jargoogle
Messages: 11 Registered: April 2004
|
Junior Member |
|
|
David Fanning <davidf@dfanning.com> wrote in message news:<MPG.1b8186298f1c396898981b@news.frii.com>...
> Well, I think have to know that "lexical order" means
> "alphabetical order". I presume most computer programmers
Sigh. I understand "lexical", but skimmed right over it and missed it
everytime I went looking for the ordering requirement.
> P.S. What do you mean you don't alphabetize your
> keywords!? What's wrong with you!
I suppose I should lexically order all the keywords in my IDL source
now to be consistent. ;-)
Wouldn't it be interesting to catalog common errors, sort them, and in
a tutorial list the top 5 common mistakes? Something like, "Here are
the top 5 things that did NOT work when people tried to implement the
ideas described here and here is why they failed."
I've always imagined a use for a journal of failed research. Sure,
sometimes brilliant people discover the same thing at the same time.
Think of the numbers though of all the people who try the same
unworkable idea and fail silently, leaving later generations to repeat
the waste of time. Too bad the journal of failed research would
probably fill every shelf on the planet. It would have to be tightly
refereed to include only those ideas most often entertained and
studied with no useful results.
Cheers,
JGG.
|
|
|
Re: Passing keywords to DLM [message #40498 is a reply to message #40374] |
Mon, 09 August 2004 13:02  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
JGG writes:
> I did a search on the manual pages to see if the alphabetical order
> is mentioned, but found nothing. I note that all the keyword
> processing examples given in the manual declare the values in
> IDL_KW_PAR in alphabetical order. Perhaps this requirement is
> mentioned elsewhere?
Well, I think have to know that "lexical order" means
"alphabetical order". I presume most computer programmers
have taken at least one linguistics class. In any case,
no one here has probably run into the problem, because
all decent programmers define their keywords alphabetically
as a matter of course. :^)
Cheers,
David
P.S. What do you mean you don't alphabetize your
keywords!? What's wrong with you!
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Passing keywords to DLM [message #40499 is a reply to message #40374] |
Mon, 09 August 2004 12:53  |
jargoogle
Messages: 11 Registered: April 2004
|
Junior Member |
|
|
Hello,
Well, I seem to have solved my problem. I arranged the
declarations in IDL_KW_PAR in alphabetical order. At that point, all
my keywords were recognized and the code functions as desired.
I did a search on the manual pages to see if the alphabetical order
is mentioned, but found nothing. I note that all the keyword
processing examples given in the manual declare the values in
IDL_KW_PAR in alphabetical order. Perhaps this requirement is
mentioned elsewhere?
Other things I tried (before alphabetizing) which did NOT fix my
problem: 1) turn off the fast keyword scan option: no change; and 2)
Remove the IDL_KW_VALUE|15 fields and leave IDL_KW_ZERO only: no
change.
Cheers,
JGG.
|
|
|