PRO coordinate_grid,X,Y,N,M,CENTER=center,TYPE=type ;+ ;coordinate_grid,X,Y,N,M makes a grid of (x,y) coordinates of size NxM, ;where N is the number of columns and M is the number of rows. ; ;coordinate_grid,X,Y,N,M,/CENTER produces X and Y with (0,0) at position ;(N/2,M/2). ; ;H. Rhody ;October 31, 2002 ;- IF N_Elements(type) LE 0 THEN type=2 IF KEYWORD_SET(center) THEN BEGIN xshift=N/2 & yshift=M/2 ENDIF ELSE BEGIN xshift=0 & yshift=0 ENDELSE X=(Make_Array(N,/INDEX,TYPE=type)-xshift)#Replicate(1,M) Y=(Make_Array(M,/INDEX,TYPE=type)-yshift)##Replicate(1,N) RETURN END