;----------------------------------------------------------------- ; covariance.pro ; ; written by Andreas Reigber ;------------------------------------------------------------------ ; Calculates the covariance matrices of a polarimetric data set. ; ; Usage: ; res = covariance(image,size) ; image = 3D complex array containing the polarimetric image ; the polarizations are interleaved over the third ; dimension, i.e. image has size (xdim,ydim,3). ; size = size of the filter window ; ; res = Resulting filtered covariance matrix (xdim,ydim,3,3) ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ function covariance,arr,smm siz = size(arr) anz_rg = siz[1] anz_az = siz[2] out = complexarr(anz_rg,anz_az,3,3) pbox = [0,anz_rg*anz_az,2*anz_rg*anz_az] for i=0,anz_rg-1 do begin for j=0,anz_az-1 do begin pos = i+j*anz_rg k3 = arr[pos+pbox] out[i,j,*,*] = adj(k3) ## k3 endfor endfor for i=0,2 do for j=0,2 do out[*,*,i,j]=smooth(reform(out[*,*,i,j],anz_rg,anz_az),smm,/ed) return,out end