Re: map_image and latmin/latmax, lonmin/lonmax - edges or centres? [message #86041 is a reply to message #86039] |
Wed, 25 September 2013 13:19   |
Andy Sayer
Messages: 127 Registered: February 2009
|
Senior Member |
|
|
After fiddling some more, I agree that it's probably the outer coordinates of the image rectangle that it wants. However, I'm still encountering some odd behaviour. For example, if I take regular 1 degree gridded data and try to map that, things like the US-Canada border (at 49 degrees N) don't lie exactly on grid cell borders (as they should) but are slightly shifted. I'm going to leave it for the rest of the day in case my overtired mind is overlooking something, but if I can't figure it out tomorrow, will create some code which reproduces the issue and post it.
Adny
On Wednesday, September 25, 2013 3:18:54 PM UTC-4, David Fanning wrote:
> AMS writes:
>
>
>
>> I'm trying to map a regularly-gridded image (in IDL 7.1.1). I'm using
>
> map_image to figure out where in the output window the image should go.
>
> But, it's not lining up exactly as I expect with e.g. coastlines. I am
>
> using compress=1 (i.e. inverse transform each point), so I don't think
>
> it is that. I wonder if I am using the latmin/latmax and lonmin/lonmax
>
> keywords incorrectly.
>
>>
>
>> The documentation ( http://www.exelisvis.com/docs/MAP_IMAGE.html ) says this:
>
>>
>
>> LATMIN
>
>> The latitude corresponding to the first row of Image. The default is -90 degrees. Note also that -90°= LATMIN < LATMAX = 90°.
>
>> LATMAX
>
>> The latitude corresponding to the last row of Image. The default value is 90 degrees. Note also that -90°= LATMIN < LATMAX = 90°.
>
>> LONMIN
>
>> The longitude corresponding to the first (leftmost) column of the Image argument. Select LONMIN so that -180°= LONMIN = 180°. The default value is -180.
>
>> LONMAX
>
>> The longitude corresponding to the last (rightmost) column of the Image argument. Select LONMAX so that it is larger than LONMIN. If the longitude of the last column is equal to (LONMIN - (360. /Nx)) MODULO 360, it is assumed that the image covers all longitudes (Nx being the total number of columns in the Image argument).
>
>>
>
>> My question: are these keywords expecting you pass the centre values for the edge rows/columns? Lower-left corners? Or the outer values (lower-left and upper-right)? (The difference being half the pixel size in lat/lon.)
>
>>
>
>> My testing suggests that using the outer values of these corner pixels is probably the intention (in that the image then covers the intended portion of the output window), but to me at least the wording in the documentation could be clearer. And the end result does not look entirely correct to me, as it looks like some pixels don't match up entirely with the coastlines (from map_continents,/hires,/coast), although I don't know whether that is something that I am doing
>
> incorrectly, a deficiency with the dataset I am using (it isn't one created here), or a deficiency in the IDL coastline database.
>
>>
>
>> If someone in the know could confirm the intended use of these map_image keywords, I'd appreciate it. :)
>
>
>
> It seems to me the answer to your questions is "none of the above". I
>
> think the only way these keywords make any sense at all is if they
>
> represent the limits of the image rectangle. So, I would say, the should
>
> be the outside edges of the pixels in the very center of the image, as
>
> if you set up orthogonal axes with 0,0 at the center of the image. These
>
> values will represent the values where the axes leave the image.
>
>
>
> Of course, none of this makes much sense in lat/lon space, so I presume
>
> the program converts to xy projected meter space (where all this *does*
>
> make sense) first, then does the warping into this space. But, that's
>
> just my guess. I don't often use Map_Image.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|