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

Home » Public Forums » archive » Re: Mapping in IDL 8 Challenge
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: Mapping in IDL 8 Challenge [message #72609] Wed, 22 September 2010 15:46
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> This works great! Remind me again how to turn off
> window updating until the end when I am ready to
> display the whole darn thing?

Oh, oh! If the user makes the mistake of clicking
and dragging in this window. (The default behavior
of ALL new graphics windows, I guess.) Then the
graphic jumps back to a massive map projection of
the entire Northern hemisphere with a tiny
image in the center. And it appears there is no
way to go back to what I was so careful to construct.

Cheers,

David

P.S. Let's just say, keep your cotton pick'n hands
OFF my graphics windows!



--
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: Mapping in IDL 8 Challenge [message #72613 is a reply to message #72609] Wed, 22 September 2010 14:39 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> There is an ominous silence today from the new graphics
> gurus to some of my questions. I suppose the Rockies
> are playing a game that will get them into the World
> Series or something.
>
> But, I know how you folks love a challenge. So,
> here you go. Can anyone figure out how to produce
> the following figure with the new graphics in IDL 8:
>
> http://www.dfanning.com/misc/testimage.png
>
> I've put the image data here:
>
> http://www.dfanning.com/misc/testimage.img
>
> And here is the code I use to produce the figure
> in the old graphics system

Woohoo!

Thanks to Chris Torrence, I have solved this problem!

Here is the code I used, modified with Chris's suggestions:

;**********************************************************
openr, 1, 'testimage.img'
image2 = bytarr(720,600)
readu, 1, image2
close, 1
xrange=[-1440000.0, 1440000.0]
yrange=[-89421.780, 2310578.2]
m = MAP('Lambert Azimuthal', SPHERE_RADIUS=6371228L, $
CENTER_LATITUDE=90.0, CENTER_LONGITUDE=0.0, $
XRANGE=xrange, YRANGE=yrange, $
MARGIN=[0,0,0,0], DIMENSIONS=[720,600])
grid = m.mapgrid
grid.GRID_LATITUDE = 5
grid.GRID_LONGITUDE = 30
grid.LABEL_POSITION = 0.86
grid.TRANSPARENCY = 50

xdim = xrange[1] - xrange[0]
ydim = yrange[1]- yrange[0]
ctload, 4, /brewer, RGB_TABLE=rgb
im = image(image2, $
IMAGE_DIMENSIONS=[xdim,ydim], $
IMAGE_LOCATION=[xrange[0], yrange[0]], $
GRID_UNITS='meters', /OVERPLOT, RGB_TABLE=rgb)

m1 = MAPCONTINENTS(/FILL_BACKGROUND, TRANSPARENCY=75)
m.xrange = xrange
m.yrange = yrange
;**********************************************************

This works great! Remind me again how to turn off
window updating until the end when I am ready to
display the whole darn thing?

Also, a word of warning. At least in main level
programs, IDL 8 is going to get VERY confused if
you have a variable named, say, "image" and a
function call to "image". It took me awhile to
fully realize this. Better go back to calling
all variables "a". :-)

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: WShow in IDL 8
Next Topic: isotropic keyword for surface?

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

Current Time: Fri Oct 10 10:48:38 PDT 2025

Total time taken to generate the page: 0.47982 seconds