From 55af71b593c4455a9198cfe70fcae8bb392212b8 Mon Sep 17 00:00:00 2001 From: "Frederik J. Simons" Date: Fri, 10 Dec 2021 17:28:23 -0500 Subject: [PATCH] Transforms covariance matrix from spherical-harmonic to spatial basis --- Clmlmp2Crrp.m | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Clmlmp2Crrp.m b/Clmlmp2Crrp.m index 74c9aec..5dd697b 100644 --- a/Clmlmp2Crrp.m +++ b/Clmlmp2Crrp.m @@ -3,7 +3,7 @@ % [r,lon,lat]=CLMLMP2CRRP(Clmlmp,[],degres,VARoption) % % Takes a spherical harmonic covariance matrix and calculates the -% spatial covariance. (map = Yrplm*Clmlmp*Yrlm') +% spatial covariance (map = Yrplm*Clmlmp*Yrlm') % OR in the case of an empty 'rnot', makes a field of spatial variance % % INPUT: @@ -11,7 +11,7 @@ % Clmlmp Spherical harmonic covariance matrix, assumed to be ordered as % in GLMALPHA (not KERNELC) % rnot The point(s) with which we want to find spatial covariance. -% - If rnot is empty(i.e. []) then do whole sphere variance [default] +% - If rnot is empty (i.e. []) then do whole sphere variance [default] % - Otherwise, rnot is a n-by-2 matrix of % [lon colat; lon2 colat2; etc] % degres The degree resolution you want. [default: Nyquist] @@ -204,7 +204,6 @@ difer(r-diag(Covrr)) end - elseif VARoption == 3 % Option 3: Loop over each spatial point and calculate % Y(r)*Clmlmp*Y(r') for each point in one go. This is @@ -229,11 +228,7 @@ % Collect output varns={r,phi,theta}; varargout=varns(1:nargout); - - end % end covariance at points or global variance? - - elseif strcmp(Clmlmp,'demo1') % Test the efficiency and accuracy of the three methods L=30; @@ -255,8 +250,6 @@ difer(r1-r2) disp('Check 1 vs. 3') difer(r1-r3) - - elseif strcmp(Clmlmp,'demo2') % Lets make a figure of the global variance L=60; @@ -289,7 +282,6 @@ colorbar longticks(gca,2) t=title('Standard deviation of noise (mm water equivalent)'); - elseif strcmp(Clmlmp,'demo3') % Lets make a figure of the error centered over Greenland, expressed % in mm of water equivalent @@ -304,7 +296,6 @@ colorbar longticks(gca,2) t=title('Spatial Variance of noise'); - elseif strcmp(Clmlmp,'demo4') % Lets make a figure of the covariance of one point % centered over Greenland @@ -342,7 +333,4 @@ colorbar longticks(gca,2) t=title('Spatial Covariance of noise'); - end % end if isstr - -