;+ ; NAME: ; locgrid_latband ; PURPOSE: (one line) ; Return location arrays for evenly spaced latitude bands ; DESCRIPTION: ; Return location arrays for evenly spaced latitude bands ; CATEGORY: ; Volatile Transport ; CALLING SEQUENCE: ; locgrid_latband, n_lat, n_loc, lat, lon, angarea_delta ; INPUTS: ; n_lat - number of latitude bands ; OUTPUTS: ; n_loc - number of locations ; lat - latitude center of each location (radians) ; lon - longitude center of each location (radians) ; angarea_delta - angular area of each location (ster) ; ; n_vert - number of vertices ; lon_vert - lonitude of vertices ; lat_vert - latitude of vertices ; vert[10,n_loc] - indices of vertices ; PROCEDURE ; The exact area of a latitude band is the area from ; north pole to the bottom of the band minus the area ; from the north pole to the top of the band. ; MODIFICATION HISTORY: ; Written 2011 Aug 3, by Leslie Young, SwRI ; 2015 Apr 11, move to grahics IDL library ; 2015 Apr 13, make lon double instead of float ;- pro locgrid_latband, n_lat, n_loc, lon, lat, angarea_delta, $ n_vert, lon_vert, lat_vert, vert deg = !dpi/180.d n_loc = n_lat lat_delta = !dpi/n_lat lat = ( dindgen(n_lat) + 0.5d ) * lat_delta - !dpi/2.d lon = replicate(!dpi, n_loc) ; The approximate area ;;; angarea_delta = 2*!pi*lat_delta*cos(lat) ; The exact area angarea_delta = 2.*!pi*( sin(lat+lat_delta/2) - sin(lat-lat_delta/2)) ; band 0: pole, [180,-90+dlat], [-180, -90+dlat] ; band 1: [-180,-90+dlat], [180, -90+dlat], [180,-90+2dlat], [-180, -90+2dlat] ; band n_loc-1: [-180,90-dlat], [180, 90-dlat], pole nc = n_loc - 1 n_vert = nc * 5 + 2*5 lon_vert = [ -180,-90,0,90,180, $ reform(transpose([ [replicate(-180,nc)], $ [replicate( -90,nc)], $ [replicate( 0,nc)], $ [replicate( 90,nc)], $ [replicate( 180,nc)]]),5*nc), $ -180,-90,0,90,180] * deg latc = (indgen(nc)+1) * lat_delta/deg - 90 lat_vert = [ replicate(-90,5), $ reform(transpose([ [latc], [latc], [latc], [latc], [latc]]),5*nc), $ replicate(90,5)] * deg vert = replicate(-1,10,n_vert) vert[0:9,0] = [0,1,2,3,4,9, 8, 7, 6, 5] for i_loc = 1, n_loc - 2 do begin vert[0:9,i_loc] = [5,6,7,8,9,14,13,12,11,10] + 5 * (i_loc - 1) endfor vert[0:9,n_loc-1] = [-10,-9,-8,-7,-6, -1, -2, -3, -4, -5] + n_vert end