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

Home » Public Forums » archive » Re: Save 2D conversion matrix
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Save 2D conversion matrix [message #46160 is a reply to message #46158] Mon, 07 November 2005 08:25 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Peter Albert writes:

> I am currently working on the display of climate datasets. One window
> shows a map with e.g. some monthly mean values. My plan now is to let
> the user pick a location using CURSOR, and then to display a time
> series at the chosen point in a second window. O.k., I can get the
> latitude / longitude of the chosen point using CONVERT_COORD, then I
> can pick the appropriate time series and plot it in the second window.
> However, if I am now going back to the map window, the correlation
> between device and data coordinates is of course gone. If it was 3D
> data, I would use T3D, but this is plain 2D data and don't see the
> appropriate feature in the documentation. Any help which would save me
> from re-drawing this map over and over again would be appreciated.
>
> N.b. this is all done using direct graphics. Is this finally the reason
> to go ahead and read the manual about OO graphics?

Object graphics is certainly overkill, but I would suggest
you learn a little widget programming (seriously, the CURSOR
command!? Sigh...).

Benjamin's suggestion to save and restore the system variables
is a good one, but it has always struck me as inelegant. Which
variables, after all, did you really need to restore the
coordinate system? It surely couldn't be ALL of them!

So I spent a couple of days experimenting until I found out which
ones I needed. (I was actually trying to find out which ones
had to be set so I could establish a data coordinate system without
going to the trouble of actually drawing a plot.) It turns out
that these four pieces of information are needed to establish
the data coordinate system: !X.S, !Y.S, !X.Window, and !Y.Window.
Plus, the current window has to be the one your plot is in. (Not
a given, always, in widget programming unless you explicitly
make it so.)

I found out that I could easily establish a data coordinate
system for *any* window if I knew the X and Y range of the
coordinate system and the location of the coordinate system
in the window (i.e., its position). (I simply constructed the
scaling parameters normally found in !X.S and !Y.S from the
range and position.)

So, even if you still save *everything*, it feels good
to know what it is in that mess you really need. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Converting Doubles to Strings
Next Topic: writing ascii-file with separator

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

Current Time: Fri Oct 10 00:56:55 PDT 2025

Total time taken to generate the page: 1.11894 seconds