The MAP_IMAGE function returns an image (or other dataset) warped to fit the current map projection. This function provides an easy method for displaying geographical data as an image on a map. The MAP_SET procedure should be called prior to calling MAP_IMAGE.
MAP_IMAGE works in image (graphic) space. For each destination pixel (when COMPRESS is set to one) MAP_IMAGE calculates the latitude and longitude by applying the inverse map projection. This latitude and longitude are then used to index and interpolate the Image argument, obtaining an interpolated value for the destination pixel. The time required by MAP_IMAGE depends mainly on the number of pixels in the destination and the setting of the COMPRESS parameter.
MAP_IMAGE is more efficient than MAP_PATCH when the input data set is large compared to the destination area. If the converse is true, MAP_PATCH is more efficient.
For more information, see Image Display .
A named variable that, upon return, contains the X coordinate position where the left edge of the image should be placed on the screen.
A named variable that, upon return, contains the Y coordinate position where the left edge of the image should be placed on the screen.
The latitude corresponding to the first row of Image . The default is -90 degrees. Note also that -90 <= LATMIN < LATMAX <= 90 .
The latitude corresponding to the last row of Image . The default value is 90 degrees. Note also that -90 <= LATMIN < LATMAX <= 90 .
The longitude corresponding to the first [left] column of Image_Orig. The default value is -180. Lonmin must be in the range of -180 to +180 degrees.
The longitude corresponding to the last column of Image_Orig. Lonmax must be 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.
Set this flag to use bilinear interpolation to soften edges in the returned image, otherwise, nearest neighbor sampling is used.
This keyword, the interpolation compression flag, controls the accuracy of the results from MAP_IMAGE. The default is 4 for output devices with fixed pixel sizes. The inverse projection transformation is applied to each i th row and column. Setting this keyword to a higher number saves time while lower numbers produce more accurate results. Setting this keyword to 1 solves the inverse map transformation for every pixel of the output image.
Set this keyword to the pixel/graphics scale factor for devices with scalable pixels (e.g., PostScript). The default is 0.02 pixels/graphic coordinate. This setting yields an approximate output image size of 350 x 250. Make this number larger for more resolution (and larger PostScript files and images), or smaller for faster, smaller, and less accurate images.
Data points with values equal to or greater than this value will be treated as missing data, and will be set to the value specified by the MISSING keyword.
The following lines of code set up an orthographic map projection and warp a simple image to it.
IMAGE = BYTSCL(SIN(DIST(400)/10)) ; Create a simple image to be warped.
TV, IMAGE ; Display the image so we can see what it looks like before warping.
Minlon = 160 ; Left edge is 160 East
Maxlon = -70 + 360 ; Right edge is 70 West = +290.
limit1 = [minlat, minlon, maxlat, maxlon]
idata = replicate(100, 50, 50)
MAP_SET, 0, loncenter, 0, /ORTHO, limit=limit1
result=MAP_IMAGE(idata,startx,starty,xsize,ysize,$
latmin=limit1(0),latmax=limit1(2),$
lonmin=limit1(1),lonmax=limit1(3),$
tv,result,startx,starty ; Display the warped image on the map at the proper position.
MAP_CONTINENTS, /coasts ; Draw gridlines over the map and image.
MAP_GRID,latdel=10,londel=10, /LABEL, $