;+ ; NAME: ; make_grid ; ; PURPOSE: ; Given a 1790 element input array, this routine produces a ; 720x360 array suitable for plotting. ; ; ; CALLING SEQUENCE: ; make_grid,in_array,pixel,out_grid ; ; INPUTS: ; in_array: A 1790-element array containing data for quasi-equal ; area grid points. ; pixel: A structure containing min and max latitude and ; longitude values for each of the 1790 grid points ; constructed in the following way: ; pixel = {lat_min:fltarr(1790), $ ; lat_max:fltarr(1790), $ ; lon_min:fltarr(1790), $ ; lon_max:fltarr(1790)} ; ; ; OUTPUTS: ; out_grid: A 720x360 element array which is suitable for plotting ; using tvscl. ; ; MODIFICATION HISTORY: ; Version 1.0 Created 9/22/98, David Lawrence pro make_grid,in_array,pixel,out_grid ; define the output grid out_grid = fltarr(720,360) ; get the midpoint lat/lon values lat = (pixel.lat_min + pixel.lat_max)/2. lon = (pixel.lon_min + pixel.lon_max)/2. ; do the south pole out_grid[0:719,0:4] = in_array[0] ; do the other latitudes i=1 while i le 1788 do begin ; find out which longitude values exist for each latitude this_lat_mid = lat[i] q = where(lat eq this_lat_mid,nq) ; get the latitude index values this_lat_ind = fix((pixel.lat_min[i]+90)*2) next_lat_ind = fix((pixel.lat_max[i]+90)*2)-1 ; assign values to each longitude grid for j=0,nq-1 do begin ; get the longitude index values this_lon_ind = fix((pixel.lon_min[q[j]]+180)*2) next_lon_ind = fix((pixel.lon_max[q[j]]+180)*2)-1 out_grid[this_lon_ind:next_lon_ind, $ this_lat_ind:next_lat_ind] = in_array[q[j]] i=i+1 endfor endwhile ; do the north poles out_grid[0:719,355:359] = in_array[1789] end