;+ ; NAME: ; make_grid_2deg ; ; PURPOSE: ; Given a 11306 element input array, this routine produces a ; 720x360 array suitable for plotting. ; ; ; CALLING SEQUENCE: ; make_grid_2deg,in_array,pixel,out_grid ; ; INPUTS: ; in_array: A 11306-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 11306 grid points ; constructed in the following way: ; pixel = {lat_min:fltarr(11306), $ ; lat_max:fltarr(11306), $ ; lon_min:fltarr(11306), $ ; lon_max:fltarr(11306)} ; ; 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_2deg,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:1] = in_array[0] ; do the other latitudes i=1 while i le 11304 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,358:359] = in_array[11305] end