David Fanning writes:
> Well, here is how I would orient this image. Trying
> to put continental boundaries on Antarctica is sketchy.
> But this will certainly give you a map data coordinate
> system that you can draw your own map features on.
>
> ;**********************************************************
> file = 'G:\data\pine_2009084_1545_modis_ch02.png'
> image = Read_PNG(file)
> image = Reverse(image, 2) ; Put the (0,0) point in UL.
>
> ; Display map in window.
> pos = [0.1, 0.1, 0.9, 0.9]
> TVImage, image, POSITION=pos, /KEEP_ASPECT, /NOINTERP, /ERASE
>
> ; Set up Map Projection. Polar Stereographic, WGS-84 Datum.
> map = Map_Proj_Init(106, DATUM='WGS 84', CENTER_LATITUDE=-90)
>
> ; Convert corners to XY coordinates. Clockwise, from UL.
> lons = [-113.594373, -98.868027, -98.568614, -117.004071]
> lats = [-71.998860, -72.492200, -76.115095, -75.491196]
> xy = Map_Proj_Forward(lons, lats, MAP_STRUCTURE=map)
>
> ; Set up map coordinate space for drawing on the map.
> Plot, [xy[0,0], xy[0,1]], [xy[1,0], xy[1,2]], $
> XStyle=5, YStyle=5, /NoData, POSITION=pos, /NOERASE
>
> ; Draw continental outlines.
> ; Map_Continents, MAP_STRUCTURE=map, /COASTS, /HIRES, /FILL
>
> ; Draw map grids.
> Map_Grid, MAP_STRUCTURE=map, LONDEL=2.5, LATDEL=0.25, $
> LATLAB=-105, LONLAB=-72, /LABEL
> ;*********************************************************** ****
Did I mention that learning about map projections was,
as far as I can tell, a never-ending proposition?
Here is another little tidbit I learned today. I was a little
uncomfortable with the NSIDC web page information Ken pointed
me to yesterday. It claimed a Polar Stereographic projection
with a True-Scale latitude of -70 degrees. The MAP_PROJ_INIT
function has a TRUE_SCALE_LATITUDE keyword, but it is not
allowed with the Polar Stereographic map projection.
When I checked with the experts at work today, however, I found
out that if you set the CENTER_LATITUDE keyword to -70 for the
Polar Stereographic projection (106), then instead of setting
the center latitude of the projection, it sets the true-scale
latitude. Isn't that neat? And you won't find that in any IDL
documentation, either! :-)
You find it in the bowels of Map_Set_Init if you go though the code
step by step and watch as it changes the parameter list it sends to
the GCTP software.
So now all we have to worry about is whether the reported image
"corners" are located in the center of the pixel, or at the outside
edge of the pixel. No one is saying. I'll have to run some tests
later today to find out (part of the mapx software I mentioned
yesterday). For IDL users, the only way to find out for sure is
good ol' trial and error.
We are almost there. By Friday we should have things lining up
pretty good. :-)
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|