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

Home » Public Forums » archive » Re: Map Projection Bug
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: Map Projection Bug [message #64722] Thu, 15 January 2009 15:47 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ed Hyer writes:

> Wow, this is really a tough one. Out of curiosity, I just did a quick
> scan through all the map_* routines in /idl/lib/, and I'm pretty
> confident that whatever is getting modified by the call to
> map_proj_init(), it's not a ! system variable. There was one
> suspicious line, 'suspicious' in that "I don't understand it." When
> creating a new MapStruct, it starts from !MAP, but does it like this:
>
> sMap = {!MAP}
>
> What means the curly braces?

Curly braces are how you create a structure. When IDL
creates a structure like this, it doesn't save the
instance data, rather it saves the *definition* of the
structure. So, the sMap variable is a structure of the
same type as the !MAP structure. This is what you would
expect.

What you *wouldn't* expect is that this variable, created
in one program, would change because of something you did
in some completely unrelated program!

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Map Projection Bug [message #64725 is a reply to message #64722] Thu, 15 January 2009 14:25 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
cgpadwick@gmail.com writes:

> I see what you are getting at now. !MAP indeed does not change during
> the successive calls. I think your theory that there is an
> undocumented internal variable is sound. thanks for posting this,
> I'll keep this in mind when working with the map stuff.

In a discussion today among NSIDC programmers it was pointed
out that the reason we built some of our own map re-gridding
software was that the GCTP map projection software was
not re-entrant. That is to say, this problem is built
directly into the GCTP software and not necessarily something
ITTVIS has introduced. Of course, the GCTP software
is *extremely* old now, and anyone doing map projections
professionally is probably using some version of the proj4
software.

My personal belief is that the map projection software
in IDL has exceeded its shelf life. Useful map projections
(equal area cylindrical, for example) are missing, others
use only spherical projections, when most of the world
is using ellipsoid projections, etc.

I really hate to admit this, but more and more of IDL
is becoming irrelevant to me. It's always good for a quick
one-off, but there are better tools for doing particular
jobs, and I'm becoming increasingly motivated to learn them.

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Map Projection Bug [message #64727 is a reply to message #64725] Thu, 15 January 2009 13:21 Go to previous messageGo to next message
cgpadwick is currently offline  cgpadwick
Messages: 7
Registered: December 2007
Junior Member
David,

I see what you are getting at now. !MAP indeed does not change during
the successive calls. I think your theory that there is an
undocumented internal variable is sound. thanks for posting this,
I'll keep this in mind when working with the map stuff.

Chris
Re: Map Projection Bug [message #64728 is a reply to message #64727] Thu, 15 January 2009 12:43 Go to previous messageGo to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Ed Hyer wrote:
> David,
>
> Wow, this is really a tough one. Out of curiosity, I just did a quick
> scan through all the map_* routines in /idl/lib/, and I'm pretty
> confident that whatever is getting modified by the call to
> map_proj_init(), it's not a ! system variable. There was one
> suspicious line, 'suspicious' in that "I don't understand it." When
> creating a new MapStruct, it starts from !MAP, but does it like this:
>
> sMap = {!MAP}
>
> What means the curly braces?

It copies a structure, setting to 0 (or empty strings)
all the values of its tags.

Paolo
Re: Map Projection Bug [message #64731 is a reply to message #64728] Thu, 15 January 2009 12:27 Go to previous messageGo to next message
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
David,

Wow, this is really a tough one. Out of curiosity, I just did a quick
scan through all the map_* routines in /idl/lib/, and I'm pretty
confident that whatever is getting modified by the call to
map_proj_init(), it's not a ! system variable. There was one
suspicious line, 'suspicious' in that "I don't understand it." When
creating a new MapStruct, it starts from !MAP, but does it like this:

sMap = {!MAP}

What means the curly braces?
Re: Map Projection Bug [message #64733 is a reply to message #64731] Thu, 15 January 2009 09:55 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
cgpadwick@gmail.com writes:

> Everytime Map_Proj_Init is called it modifies the internal !MAP
> structure. So your second call is modifying !MAP and that's why it's
> behaving the way it is.

That was my first thought, too, but there is no evidence
of it. Since I am using the GCTC map projections, I am
not touching !MAP, and its values are all zero throughout
my example.

It is likely that there is an (undocumented) internal
configuration that gets set with MAP_PROJ_INIT, but
I have no idea what it is or how to reset it.

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Map Projection Bug [message #64736 is a reply to message #64733] Thu, 15 January 2009 09:01 Go to previous messageGo to next message
cgpadwick is currently offline  cgpadwick
Messages: 7
Registered: December 2007
Junior Member
Everytime Map_Proj_Init is called it modifies the internal !MAP
structure. So your second call is modifying !MAP and that's why it's
behaving the way it is.
Re: Map Projection Bug [message #64818 is a reply to message #64725] Fri, 16 January 2009 04:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
completly FOSS

http://www.scipy.org/Cookbook/Matplotlib/Maps
http://matplotlib.sourceforge.net/gallery.html

and not java ;)

cheers
Reimar

David Fanning schrieb:
> cgpadwick@gmail.com writes:
>
>> I see what you are getting at now. !MAP indeed does not change during
>> the successive calls. I think your theory that there is an
>> undocumented internal variable is sound. thanks for posting this,
>> I'll keep this in mind when working with the map stuff.
>
> In a discussion today among NSIDC programmers it was pointed
> out that the reason we built some of our own map re-gridding
> software was that the GCTP map projection software was
> not re-entrant. That is to say, this problem is built
> directly into the GCTP software and not necessarily something
> ITTVIS has introduced. Of course, the GCTP software
> is *extremely* old now, and anyone doing map projections
> professionally is probably using some version of the proj4
> software.
>
> My personal belief is that the map projection software
> in IDL has exceeded its shelf life. Useful map projections
> (equal area cylindrical, for example) are missing, others
> use only spherical projections, when most of the world
> is using ellipsoid projections, etc.
>
> I really hate to admit this, but more and more of IDL
> is becoming irrelevant to me. It's always good for a quick
> one-off, but there are better tools for doing particular
> jobs, and I'm becoming increasingly motivated to learn them.
>
> Cheers,
>
> David
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Trouble writing very large files
Next Topic: Re: Two Million Visitors!

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

Current Time: Wed Oct 08 16:01:06 PDT 2025

Total time taken to generate the page: 0.00516 seconds