Re: map_proj_init [message #53346] |
Mon, 09 April 2007 08:59 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
marit writes:
> You have a typo in the north projection that sets lat of true scale
> (which map_proj_init confusingly calls center_lat) to -70, so in this
> case both south_proj and north_proj are the same.
Ah, so I did. Thanks.
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.")
|
|
|
Re: map_proj_init [message #53347 is a reply to message #53346] |
Mon, 09 April 2007 06:56  |
marit
Messages: 4 Registered: September 1995
|
Junior Member |
|
|
> Interestingly, in research preparatory to writing an article
> about this for my web page, I discovered that if you use
> the map projection *index*, instead of the map projection
> name and GCTP keyword, then all is well:
>
> IDL> south_proj=MAP_PROJ_INIT(106, semimajor_axis=6378273.0,$
> IDL> semiminor_axis=6356889.4, center_lon=0,center_lat=-70.0,$
> IDL> false_easting=0,false_northing=0)
> IDL> north_proj = MAP_PROJ_INIT(106, semimajor_axis=6378273.0,$
> IDL> semiminor_axis=6356889.4,center_lon=0,center_lat=-70.0,$
> IDL> false_easting=0,false_northing=0)
You have a typo in the north projection that sets lat of true scale
(which map_proj_init confusingly calls center_lat) to -70, so in this
case both south_proj and north_proj are the same.
At any rate, I looked into map_proj_init.pro and found these two
internal routines: MAP_PROJ_GCTP_FORINIT and MAP_PROJ_GCTP_REVINIT.
If you call them with the proper parameters for each projection before
any call to map_proj_forward or map_proj_inverse the calculations are
correct. I guess there's an internal structure somewhere that can only
hold parameters for 1 GCTP projection at once?
Anyway, thanks for your thoughts on the problem. I did submit a
support incident Saturday, but since the weekend is barely over
haven't heard anything back yet.
|
|
|
Re: map_proj_init [message #53356 is a reply to message #53347] |
Sun, 08 April 2007 11:43  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
marit writes:
> Has anyone run into the problem that subsequent calls to map_proj_init
> using a GCTP projection interfere with previously defined maps? Here
> is an example:
>
> south_proj=MAP_PROJ_INIT('Polar Stereographic' ,/GCTP ,$
> semimajor_axis=6378273.0,semiminor_axis=6356889.4,$
> center_lon=0,center_lat=-70.0,false_easting=0,false_northing =0)
>
> print,map_proj_forward([0,0],[-90.0,-89.0],map_structure=sou th_proj)
> 0.0000000 0.0000000
> 0.0000000 108332.24
>
> north_proj=MAP_PROJ_INIT('Polar Stereographic' ,/GCTP ,$
> semimajor_axis=6378273.0,semiminor_axis=6356889.4,$
> center_lon=0,center_lat=70.0,false_easting=0,false_northing= 0)
>
> print,map_proj_forward([0,0],[-90.0,-89.0],map_structure=sou th_proj)
> 0.0000000 -2.0002841e+23
> 0.0000000 -1.4035070e+09
>
> I haven't yet seen this occur if the second projection is an IDL
> projection; however the IDL projections are not usually useful since
> they can't be set up like a normal projections with false easting and
> false northing and they are mostly spherical not ellipsoidal.
Interestingly, in research preparatory to writing an article
about this for my web page, I discovered that if you use
the map projection *index*, instead of the map projection
name and GCTP keyword, then all is well:
IDL> south_proj=MAP_PROJ_INIT(106, semimajor_axis=6378273.0,$
IDL> semiminor_axis=6356889.4, center_lon=0,center_lat=-70.0,$
IDL> false_easting=0,false_northing=0)
IDL> print,map_proj_forward([0,0],[-90.0,-89.0],$
IDL> map_structure=south_proj)
0.00000000 0.00000000
0.00000000 108332.24
IDL> north_proj = MAP_PROJ_INIT(106, semimajor_axis=6378273.0,$
IDL> semiminor_axis=6356889.4,center_lon=0,center_lat=-70.0,$
IDL> false_easting=0,false_northing=0)
IDL> print,map_proj_forward([0,0],[-90.0,-89.0],$
IDL> map_structure=south_proj)
0.00000000 0.00000000
0.00000000 108332.24
I wonder if this indicates that the bug lies in NOT
selecting the GCTP library routines, and hence, setting
something in !MAP.
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.")
|
|
|
Re: map_proj_init [message #53363 is a reply to message #53356] |
Sat, 07 April 2007 18:36  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
marit writes:
> Has anyone run into the problem that subsequent calls to map_proj_init
> using a GCTP projection interfere with previously defined maps?
I get the same result on my Windows machine. Have
you reported the problem to ITTVIS? What have they
said about this?
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.")
|
|
|