Re: Map Projection Bug [message #64722] |
Thu, 15 January 2009 15:47  |
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   |
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 #64728 is a reply to message #64727] |
Thu, 15 January 2009 12:43   |
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 #64818 is a reply to message #64725] |
Fri, 16 January 2009 04:00  |
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
|
|
|