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

Home » Public Forums » archive » Re: how to suppres warning
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: how to suppres warning [message #62972] Wed, 22 October 2008 08:51 Go to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
edward.s.meinel@aero.org wrote:
> On Oct 22, 10:18�am, David Fanning <n...@dfanning.com> wrote:
>> Ingo von Borstel writes:
>>> Actually I hoped
>>> to get a useful hint, especially as I knew you �as a usually very
>>> helpful person... :S
>>
>> If I knew a useful hint, I'd probably offer it. But all
>> that comes to mind is "fix the code". :-)
>>
>> 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.")
>
> If only control-o still worked...
What did it do?

Ciao,
Paolo

>
> Ed "I've been doing this too long" Meinel
Re: how to suppres warning [message #62973 is a reply to message #62972] Wed, 22 October 2008 08:42 Go to previous messageGo to next message
edward.s.meinel@aero. is currently offline  edward.s.meinel@aero.
Messages: 52
Registered: February 2005
Member
On Oct 22, 10:18 am, David Fanning <n...@dfanning.com> wrote:
> Ingo von Borstel writes:
>> Actually I hoped
>> to get a useful hint, especially as I knew you  as a usually very
>> helpful person... :S
>
> If I knew a useful hint, I'd probably offer it. But all
> that comes to mind is "fix the code". :-)
>
> 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.")

If only control-o still worked...

Ed "I've been doing this too long" Meinel
Re: how to suppres warning [message #62974 is a reply to message #62973] Wed, 22 October 2008 08:09 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> Err...this is also off-topic, but don't you have any curiosity to find out what is causing
> the problem?

Paul, give it up. Kids don't program like this anymore.
Probably why they are gonna love the new IDL 7.1 release. ;-)

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.")
Re: how to suppres warning [message #62975 is a reply to message #62974] Wed, 22 October 2008 07:59 Go to previous messageGo to next message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
Hi

is your problem that you get megabytes of warning texts, but execution continues?

Or do you get a run-time error and execution of your program stops, even though
you do not care that some part of your data was not read correctly?

If it is the former, maybe it is better to suffer the warnings than to waste
effort in suppressing them.

If it is the latter, one could put the offending read statements into an EXECUTE()
call and set the QuietExecution option. Of course, this only really works if there
is no important data after the read error, since that won't get read. Also, make
sure that you delete the program afterwards, or forever the dark side of the force
your destiny will control.


chl
Re: how to suppres warning [message #62976 is a reply to message #62975] Wed, 22 October 2008 07:53 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Mark wrote:
> Well, as long as this topic has come up....
>
> In alot of my code (running bash on unix) I get this warning printed
> to the screen:
>
> bash: defaults: command not found
>
> along with other occasional warnings that bash isn't happy for some
> reason I can't comprehend.
>
>
> I really have no idea at what point in the code(s) that this warning
> originates from, but since everything works fine I'd just as soon
> suppress it. Does anyone know how this might be done easily, either in
> IDL or unix?

Err...this is also off-topic, but don't you have any curiosity to find out what is causing
the problem? With google at your fingertips it's easy to get at least an idea if not the
outright answer. E.g. Have you checked your .profile, .login, .bashrc, .bash_profile, or
the various /etc forms of those files to see where the "defaults" command is being called,
why is it being called, and why it isn't in your path?

You know, this topic reminds me of callers to the NPR show "Car Talk". People describe
these sometimes bizarre things that are happening (noises, shaking, other weird stuff) as
they drive their cars. The inevitable question "How long has this been going on?" comes up
and the answers typically range from several weeks to months in some cases. It never
ceases to amaze me what people will put up with. :o)

cheers,

paulv
Re: how to suppres warning [message #62977 is a reply to message #62976] Wed, 22 October 2008 07:30 Go to previous messageGo to next message
astroboy2k is currently offline  astroboy2k
Messages: 34
Registered: July 2007
Member
Well, as long as this topic has come up....

In alot of my code (running bash on unix) I get this warning printed
to the screen:

bash: defaults: command not found

along with other occasional warnings that bash isn't happy for some
reason I can't comprehend.


I really have no idea at what point in the code(s) that this warning
originates from, but since everything works fine I'd just as soon
suppress it. Does anyone know how this might be done easily, either in
IDL or unix?

Thanks,

Mark
Re: how to suppres warning [message #62978 is a reply to message #62977] Wed, 22 October 2008 07:26 Go to previous messageGo to next message
Ingo von Borstel is currently offline  Ingo von Borstel
Messages: 54
Registered: September 2006
Member
Hi David,

> If I knew a useful hint, I'd probably offer it. But all
> that comes to mind is "fix the code". :-)

Hm, right. Then I miss read you probably, the bliss of online
communication... Thanks anyway for your time.

Cheers,
Ingo


--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc

If you need an urgent reply, replace newsgroups by vgap.
Re: how to suppres warning [message #62979 is a reply to message #62978] Wed, 22 October 2008 07:18 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ingo von Borstel writes:

> Actually I hoped
> to get a useful hint, especially as I knew you as a usually very
> helpful person... :S

If I knew a useful hint, I'd probably offer it. But all
that comes to mind is "fix the code". :-)

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.")
Re: how to suppres warning [message #62980 is a reply to message #62979] Wed, 22 October 2008 07:02 Go to previous messageGo to next message
Ingo von Borstel is currently offline  Ingo von Borstel
Messages: 54
Registered: September 2006
Member
Hi,

> If we told you how to suppress error messages, I'm pretty sure
> you would be back here in five minutes wondering how to prevent
> crap in your input variables.

I'm sure I wouldn't and I know how to fix it with some detailed
treatment of the data lines.
I know my input file, and I know I could read the input lines, and treat
every string section as something special or defining a mask which
handles only the relevant columns and rows. That'd be too much hassle in
this case as it's only trailing comments in a data file which I want to
ignore and not each throw a "conversion error" message. Actually I hoped
to get a useful hint, especially as I knew you as a usually very
helpful person... :S

> Very difficult to do your job without feedback.
Indeed, and very much so. But I don't want to over-complicate the code
for a trivial thing.

Regards,
Ingo


--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc

If you need an urgent reply, replace newsgroups by vgap.
Re: how to suppres warning [message #62981 is a reply to message #62980] Wed, 22 October 2008 06:57 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Ingo von Borstel wrote:
> Hello,
>
> is there a way to suppress warnings like
> % Type conversion error: Unable to convert given STRING to Double.
> % Detected at: READ_TABLE 58 /home/ingo/idltools/read_table.pro
> in order to not spam the console entirely?

Ummm...but that's not a warning. It's an error.

When you see errors popping up, you fix your code.

> I'd rather have the programme
> issue one warning for the entire read process instead of one for each
> line of the table I'm reading...

You can use CATCH (I think) to do this, but one would assume that you would stop the
program at the very first error, fix your code, and then re-run.

> I've been looking through the docs, but it was my impression that the
> usage of on_error doesn't help...

Did I mention you should fix your code?

:o)

cheers,

paulv
Re: how to suppres warning [message #62984 is a reply to message #62981] Wed, 22 October 2008 05:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ingo von Borstel writes:

> is there a way to suppress warnings like
> % Type conversion error: Unable to convert given STRING to Double.
> % Detected at: READ_TABLE 58 /home/ingo/idltools/read_table.pro
> in order to not spam the console entirely? I'd rather have the programme
> issue one warning for the entire read process instead of one for each
> line of the table I'm reading...
>
> I've been looking through the docs, but it was my impression that the
> usage of on_error doesn't help...

If we told you how to suppress error messages, I'm pretty sure
you would be back here in five minutes wondering how to prevent
crap in your input variables.

I don't think we can win on this one. Error messages do tend to
disappear when you write the code correctly. And nothing
focuses the mind so much as an entire screen of someone
yelling at you. :-)

Cheers,

David

P.S. The one person I know who (accidentally) suppressed
*all* error messages (by borrowing a start-up file from
someone who was a sorrier programmer than she was) was
the most confused, unhappy programmer on the planet.
Very difficult to do your job without feedback.

--
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.")
Re: how to suppres warning [message #63059 is a reply to message #62972] Thu, 23 October 2008 04:20 Go to previous message
edward.s.meinel@aero. is currently offline  edward.s.meinel@aero.
Messages: 52
Registered: February 2005
Member
On Oct 22, 11:51 am, pgri...@gmail.com wrote:
> edward.s.mei...@aero.org wrote:
>> On Oct 22, 10:18 am, David Fanning <n...@dfanning.com> wrote:
>>> Ingo von Borstel writes:
>>>> Actually I hoped
>>>> to get a useful hint, especially as I knew you as a usually very
>>>> helpful person... :S
>
>>> If I knew a useful hint, I'd probably offer it. But all
>>> that comes to mind is "fix the code". :-)
>
>>> 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.")
>
>> If only control-o still worked...
>
> What did it do?
>
> Ciao,
> Paolo
>
>
>
>> Ed "I've been doing this too long" Meinel
>
>

Control-o would suppress output to the screen.

Ed
Re: how to suppres warning [message #63060 is a reply to message #62975] Thu, 23 October 2008 01:36 Go to previous message
Ingo von Borstel is currently offline  Ingo von Borstel
Messages: 54
Registered: September 2006
Member
Hi,

> is your problem that you get megabytes of warning texts, but execution
> continues?
The only error which I get is a type conversion error - which has no
influence whatsoever and the programme happily continues to run.

> you do not care that some part of your data was not read correctly?
Exactly. I'm reading a data files with different number of columns which
as the first and last part of each line contains a textual comment -
which of course fails to convert to a numerical value.

> If it is the former, maybe it is better to suffer the warnings than to
> waste effort in suppressing them.
Well, yes, I _can_ live with them. As it seems that it's not as easy
(just changing a switch or compile option yet unknown to me), that's
what it will be. I know it's not overtly complicated to get rid of them,
but I would need to customize the read-in procedure (it can deal with
leading, but not trailing text) which I wanted to avoid in order to
avoid code duplication.

Thanks for your advice :)

Ingo

--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc

If you need an urgent reply, replace newsgroups by vgap.
Re: how to suppres warning [message #63069 is a reply to message #62976] Wed, 22 October 2008 09:59 Go to previous message
astroboy2k is currently offline  astroboy2k
Messages: 34
Registered: July 2007
Member
On Oct 22, 10:53 am, Paul van Delst <Paul.vanDe...@noaa.gov> wrote:
> Mark wrote:
>> Well, as long as this topic has come up....
>
>> In alot of my code (running bash on unix) I get this warning printed
>> to the screen:
>
>> bash: defaults: command not found
>
>> along with other occasional warnings that bash isn't happy for some
>> reason I can't comprehend.
>
>> I really have no idea at what point in the code(s) that this warning
>> originates from, but since everything works fine I'd just as soon
>> suppress it. Does anyone know how this might be done easily, either in
>> IDL or unix?
>
> Err...this is also off-topic, but don't you have any curiosity to find out what is causing
> the problem? With google at your fingertips it's easy to get at least an idea if not the
> outright answer. E.g. Have you checked your .profile, .login, .bashrc, .bash_profile, or
> the various /etc forms of those files to see where the "defaults" command is being called,
> why is it being called, and why it isn't in your path?
>
> You know, this topic reminds me of callers to the NPR show "Car Talk". People describe
> these sometimes bizarre things that are happening (noises, shaking, other weird stuff) as
> they drive their cars. The inevitable question "How long has this been going on?" comes up
>   and the answers typically range from several weeks to months in some cases. It never
> ceases to amaze me what people will put up with. :o)
>
> cheers,
>
> paulv

Well yes, I am curious, and yes, I have looked into it, and no, I
can't figure out what the problem is for the life of me.

Unfortunately, my employers don't pay me to program in IDL just for
the sake of writing elegant IDL programs; they want answers. If I want
to keep my job an occasional warning which does nothing but clutter my
screen is something I have to write off after having given it the old
college try to fix it.

As long as this topic had come up I thought I might mention it; I
wouldn't have wasted the bandwidth or the time of the people who
kindly have helped me out so many times otherwise. I thought possibly
there was some IDL or unix fix that would suppress this sort of
message that was likely common knowledge.

Having said that, I'm afraid my message did come across like I was
asking someone else to do my thinking for me out of laziness. Sorry
'bout that.

Mark
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: QUESTION: is there a command in idl which could clean up memory pieces?
Next Topic: ITK Interface

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

Current Time: Wed Oct 08 15:57:31 PDT 2025

Total time taken to generate the page: 0.00490 seconds