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

Home » Public Forums » archive » Re: Has USERSYM been defined?
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: Has USERSYM been defined? [message #29586] Wed, 06 March 2002 04:40
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Wayne Landsman wrote:
>
> I think the answer to the following question is "no" but it is worth a
> shot.
>
> Is there any way to determine if a user-defined plotting symbol has
> been created using USERSYM for plotting with PSYM=8? (I suppose it
> might also be nice if one could determine what the user-defined symbol
> actually is, i.e. fetch the X,Y vectors that were input to USERSYM, but
> I don't need that now.)
>
> I want to have my plotting program use the current USERSYM definition
> for PSYM=8 if it exists, but to create a default symbol if no current
> USERSYM definition exists.
>
> Thanks, --Wayne Landsman landsman@mpb.gsfc.nasa.gov

We have solved this problem indirect by defining new number codes
for usersyms.

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/icgsym_n.tar.gz

icgsym_n,/symhelp ; shows all symbols

All usersyms are defined in this routines. e.g. 208 is a filled circle

If now a number gt 7 ne 10 is used it is a user defined symbol.



regards
Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
Re: Has USERSYM been defined? [message #29591 is a reply to message #29586] Tue, 05 March 2002 13:26 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Mark Hadfield wrote:
> "David Fanning" <david@dfanning.com> wrote in message
> news:MPG.16eebb31cf80510798982f@news.frii.com...
>> Wayne Landsman (landsman@mpb.gsfc.nasa.gov) writes:
>>
>>> Is there any way to determine if a user-defined plotting symbol has
>>> been created using USERSYM for plotting with PSYM=8? (I suppose it
>>> might also be nice if one could determine what the user-defined
>>> symbol actually is, i.e. fetch the X,Y vectors that were input to
>>> USERSYM, but I don't need that now.)
>>>
>
>>> I want to have my plotting program use the current USERSYM
>>> definition for PSYM=8 if it exists, but to create a default symbol
>>> if no current USERSYM definition exists.
>>
>
>> My impression is that the whole USERSYM business is a hold-over from
>> the way graphics were done in the 70's.
>
> Indeed.
>
>> I'd bet a lot of money the answer is "no". (Or, even more likely,
>> "hell no".)
>
> How much money, David?
>
> How about plotting a test dataset inside a CATCH handler and trapping
> the error? Attempting to display a user symbol that is not yet defined
> results (in IDL 5.5) in an error with name 'IDL_M_PLOT_NOUSERSYM'

The following function returns 1B (true) if the argument (a symbol
number) can be plotted, and 0B otherwise:

FUNCTION SYMBOL_DEFINED, PSYM
current_device = !d.name
catch, status
if (status ne 0) then begin
set_plot, current_device
return, 0B
endif
set_plot, 'NULL'
plots, 0, 0, psym=psym, /device
set_plot, current_device
return, 1B
END

IDL> print, symbol_defined(7)
1
IDL> print, symbol_defined(8)
0
IDL> x = [-6, 0, 6, 0, -6]
IDL> y = [0, 6, 0, -6, 0]
IDL> usersym, x, y
IDL> print, symbol_defined(8)
1

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: Has USERSYM been defined? [message #29593 is a reply to message #29591] Tue, 05 March 2002 13:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Hadfield (m.hadfield@niwa.co.nz) writes:

> How about plotting a test dataset inside a CATCH handler and trapping
> the error? Attempting to display a user symbol that is not yet defined
> results (in IDL 5.5) in an error with name 'IDL_M_PLOT_NOUSERSYM'

Yeah, then you could use your pattern matching software (you
might have to write this yourself, but I'm sure it can be done
in IDL) to find out what symbol it was, and there you would have it.

> How much money, David?

Oh, gosh. Since it involves a computer, I'd be willing
to risk as much as a dollar. Guess that's about four
of yours, Mark. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Has USERSYM been defined? [message #29594 is a reply to message #29593] Tue, 05 March 2002 12:47 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.16eebb31cf80510798982f@news.frii.com...
> Wayne Landsman (landsman@mpb.gsfc.nasa.gov) writes:
>
>> Is there any way to determine if a user-defined plotting symbol has
>> been created using USERSYM for plotting with PSYM=8? (I suppose it
>> might also be nice if one could determine what the user-defined
>> symbol actually is, i.e. fetch the X,Y vectors that were input to
>> USERSYM, but I don't need that now.)
>>

>> I want to have my plotting program use the current USERSYM
>> definition for PSYM=8 if it exists, but to create a default symbol
>> if no current USERSYM definition exists.
>

> My impression is that the whole USERSYM business is a hold-over from
> the way graphics were done in the 70's.

Indeed.

> I'd bet a lot of money the answer is "no". (Or, even more likely,
> "hell no".)

How much money, David?

How about plotting a test dataset inside a CATCH handler and trapping
the error? Attempting to display a user symbol that is not yet defined
results (in IDL 5.5) in an error with name 'IDL_M_PLOT_NOUSERSYM'

---
Mark Hadfield
m.hadfield@niwa.co.nz Ka puwaha et tai nei
http://katipo.niwa.co.nz/~hadfield Hoea tatou
National Institute for Water and Atmospheric Research (NIWA)
Re: Has USERSYM been defined? [message #29602 is a reply to message #29594] Tue, 05 March 2002 10:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wayne Landsman (landsman@mpb.gsfc.nasa.gov) writes:

> I think the answer to the following question is "no" but it is worth a
> shot.
>
> Is there any way to determine if a user-defined plotting symbol has
> been created using USERSYM for plotting with PSYM=8? (I suppose it
> might also be nice if one could determine what the user-defined symbol
> actually is, i.e. fetch the X,Y vectors that were input to USERSYM, but
> I don't need that now.)
>
> I want to have my plotting program use the current USERSYM definition
> for PSYM=8 if it exists, but to create a default symbol if no current
> USERSYM definition exists.

My impression is that the whole USERSYM business is
a hold-over from the way graphics were done in the 70's.
I'd bet a lot of money the answer is "no". (Or, even
more likely, "hell no".)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Odd behavior of Device, cursor_image
Next Topic: Re: IDL books?

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

Current Time: Wed Oct 08 19:36:54 PDT 2025

Total time taken to generate the page: 0.16039 seconds