Skip to content

Commit

Permalink
Update all for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
ericaashe authored Nov 28, 2018
1 parent e7ac013 commit 081ed00
Show file tree
Hide file tree
Showing 30 changed files with 3,667 additions and 398 deletions.
254 changes: 254 additions & 0 deletions IFILES/NC_proxies.csv

Large diffs are not rendered by default.

Binary file added IFILES/TG_data.mat
Binary file not shown.
1,455 changes: 1,455 additions & 0 deletions IFILES/USAtl_ESTGP.csv

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions MFILES/CESLDefineCovFuncs.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
% This script defines some common covariance functions.
%
% kMat1 - Matern 1/2
% kMat3 - Matern 3/2
% kMat5 - Matern 5/2
% kSE - squared exponential
% kDP - dot product
% kCONST - constant
% kSIN - square exponential of sine function
% kMODSIN - product of kSIN and kSE
% kFREQ - cosine function
% kRQ - rational quadratic
% kMatG - Matern generic
% kDELTAG - delta function on a sphere
% kGEOG - Matern 5/2 on a sphere
% kGEOGG - Matern generic on a sphere
%
% It also defines first and second derivatives kMat3d, kMat3dd and kDPd, kDPdd
%
% Last updated by Robert Kopp, robert-dot-kopp-at-rutgers-dot-edu, Sat Nov 28 16:09:12 EST 2015

% we will have a vector of observations
% and a vector of their uncertainty

% define covariance functions we will use

defval('refyear',1970);

dYears = @(years1,years2) abs(bsxfun(@minus,years1',years2));
dYears0 = @(years1,years2) (bsxfun(@minus,years1',years2));

angd = @(Lat0,Long0,lat,long) (180/pi)*(atan2( sqrt( (cosd(lat) .* sind(long-Long0)).^2 + (cosd(Lat0) .* sind(lat) - sind(Lat0) .* cosd(lat) .* cosd(long-Long0)).^2),(sind(Lat0) .* sind(lat) + cosd(Lat0) .* cosd(lat) .* cosd(long-Long0))));

dDist = @(x1,x2) angd(repmat(x1(:,1),1,size(x2,1)),repmat(x1(:,2),1,size(x2,1)),repmat(x2(:,1)',size(x1,1),1),repmat(x2(:,2)',size(x1,1),1))' + 1e6*(bsxfun(@plus,x1(:,1)',x2(:,1))>1000);

kMat1 = @(dx,thetas) thetas(1).^2 .* (1).*exp(-dx/thetas(2));

kMat3 = @(dx,thetas) thetas(1).^2 .* (1 + sqrt(3)*dx/thetas(2)).*exp(-sqrt(3)*dx/thetas(2));

kMat5 = @(dx,thetas) thetas(1).^2 .* (1 + (sqrt(5)*dx/thetas(2)).*(1 + sqrt(5)*dx/thetas(2)/3)).*exp(-sqrt(5)*dx/thetas(2));

kSE = @(dx,thetas) thetas(1).^2 * exp(-(dx.^2)/(2*thetas(2).^2));

kDELTA = @(dx,thetas) thetas(1).^2 .* (dx==0);

kDP = @(years1,years2,thetas) thetas(1).^2 * bsxfun(@times,(years1-refyear)',(years2-refyear));
kCONST = @(thetas) thetas(1).^2;
kSIN = @(dt,thetas) thetas(1).^2 * exp(-2*sin(pi*dt/(thetas(2))).^2/thetas(3).^2);
kMODSIN = @(dt,thetas) kSIN(dt,thetas(1:3)) .* kSE(dt,[1 thetas(4)*thetas(2)]);
kFREQ = @(dt,thetas) thetas(1).^2 * cos(2*pi*dt/thetas(2));
kRQ = @(dx,thetas) thetas(1).^2 * (1 + dx.^2/(2*thetas(2)*thetas(3))).^-thetas(3);
kMatG = @(dx,thetas) thetas(1).^2 .* 2.^(1-thetas(3))./gamma(thetas(3)) .* (sqrt(2*thetas(3))*(dx+eps)/thetas(2)).^thetas(3) .* besselk(thetas(3),sqrt(2*thetas(3))*(dx+eps)/thetas(2));

kDELTAG = @(ad,thetas)thetas(1).^2.*(abs(ad)<1e-4).*(ad<360);

kGEOG = @(ad,thetas) kMat5(ad,thetas) .* (ad<360);
kGEOGG = @(ad,thetas)kMatG(ad,thetas).*(ad<360);


kMat3d = @(years1,years2,dx,thetas)thetas(1).^2.*(-3/(thetas(2).^2)).*dx.*exp(-sqrt(3)*dx/thetas(2)).*(-1+2*bsxfun(@ge,years1',years2));
kDPd = @(years1,years2,thetas) thetas(1).^2 * repmat((years1-refyear)',length(years2),1);
kMat3dd = @(dx,thetas)thetas(1).^2.*(3/(thetas(2).^2)).*(1-sqrt(3)*dx/thetas(2)).*exp(-sqrt(3)*dx/thetas(2));
kDPdd = @(years1,years2,thetas) thetas(1).^2 * ones(length(years2),length(years1));



FiniteMask = @(x1,x2) (bsxfun(@plus,sum(abs(x1),2)',sum(abs(x2),2)))<1e12;
26 changes: 13 additions & 13 deletions MFILES/DefCovOneSite.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
kMat3dd = @(dx,thetas)thetas(1).^2.*(3/(thetas(2).^2)).*(1-sqrt(3)*dx/thetas(2)).*exp(-sqrt(3)*dx/thetas(2));

% defines global, high-frequency and white noise covariance functions
cvfunc.G = @(dt1t2,thetas) kMat3(dt1t2,thetas(1:2));
cvfunc.H = @(dt1t2,thetas) kMat3(dt1t2,thetas(1:2));
cvfunc.L = @(dt1t2,thetas) kMat3(dt1t2,thetas(1:2));
cvfunc.M = @(dt1t2,thetas) kMat3(dt1t2,thetas(1:2));
cvfunc.W = @(dt1t2,ad,thetas) kDELTA(dt1t2,thetas(1));

% defines temporal derivative of covariance function
dcvfunc.G = @(t1,t2,dt1t2,thetas) kMat3d(t1,t2,dt1t2,thetas(1:2));
dcvfunc.H = @(t1,t2,dt1t2,thetas) kMat3d(t1,t2,dt1t2,thetas(1:2));
dcvfunc.L = @(t1,t2,dt1t2,thetas) kMat3d(t1,t2,dt1t2,thetas(1:2));
dcvfunc.M = @(t1,t2,dt1t2,thetas) kMat3d(t1,t2,dt1t2,thetas(1:2));
dcvfunc.W = @(dt1t2,ad,thetas) 0;

% second derivative
ddcvfunc.G = @(dt1t2,thetas) kMat3dd(dt1t2,thetas(1:2));
ddcvfunc.H = @(dt1t2,thetas) kMat3dd(dt1t2,thetas(1:2));
ddcvfunc.L = @(dt1t2,thetas) kMat3dd(dt1t2,thetas(1:2));
ddcvfunc.M = @(dt1t2,thetas) kMat3dd(dt1t2,thetas(1:2));
ddcvfunc.W = @(dt1t2,ad,thetas) 0;

clear modelspec;
Expand All @@ -28,9 +28,9 @@
modelspec(1).label = 'Full';

%model is sum of functions we defined above
modelspec(1).cvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) cvfunc.G(dt1t2,thetas(1:2)) + cvfunc.H(dt1t2,thetas(3:4)) + cvfunc.W(dt1t2,ad,thetas(5));
modelspec(1).dcvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) dcvfunc.G(t1,t2,dt1t2,thetas(1:2)) +dcvfunc.H(t1,t2,dt1t2,thetas(3:4));% + dcvfunc.R(t1,t2,dt1t2,ad,thetas(3:5));
modelspec(1).ddcvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) ddcvfunc.G(dt1t2,thetas(1:2))+ddcvfunc.H(dt1t2,thetas(3:4));% + ddcvfunc.R(dt1t2,ad,thetas(3:5));
modelspec(1).cvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) cvfunc.L(dt1t2,thetas(1:2)) + cvfunc.M(dt1t2,thetas(3:4)) + cvfunc.W(dt1t2,ad,thetas(5));
modelspec(1).dcvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) dcvfunc.L(t1,t2,dt1t2,thetas(1:2)) +dcvfunc.M(t1,t2,dt1t2,thetas(3:4));% + dcvfunc.R(t1,t2,dt1t2,ad,thetas(3:5));
modelspec(1).ddcvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) ddcvfunc.L(dt1t2,thetas(1:2))+ddcvfunc.M(dt1t2,thetas(3:4));% + ddcvfunc.R(dt1t2,ad,thetas(3:5));

%adds defined error covariance to the covariance function
modelspec(1).traincv = @(t1,t2,dt1t2,thetas,errcv,ad,fp1fp2) modelspec(1).cvfunc(t1,t2,dt1t2,thetas,ad,fp1fp2) + errcv;
Expand All @@ -41,17 +41,17 @@
tluTGG = [
60e3 1e3 10e6 % global amplitude (starting, lower, and uppper); SL in mm; how much values can go up or down over a particular time period
12e3 2e3 2e6 % temporal scale in years, how much it can very over a particular time scale
1e3 10 20e3 % high frequency amplitude (starting, lower, and uppper); SL in mm; how much values can go up or down over a particular time period
1e3 100 2e3 % HF temporal scale in years, how much it can very over a particular time scale
1e3 10 20e3 % medium frequency amplitude (starting, lower, and uppper); SL in mm; how much values can go up or down over a particular time period
1e3 100 2e3 % medium frequency temporal scale in years, how much it can very over a particular time scale
1e3 1 2e3 % white noise
];

modelspec(1).thet0=tluTGG(:,1)';
modelspec(1).lb = tluTGG(:,2)';
modelspec(1).ub = tluTGG(:,3)';
modelspec(1).subfixed=[ ];
modelspec(1).sublength=[]; % these are ones that will be tuned based only on tide gauges if use Optimize level 1
modelspec(1).sublength=[];
modelspec(1).subamp = [1 3 5];
modelspec(1).subampnoise = [3 5];
modelspec(1).subampnoise = [5];
modelspec(1).subampoffset = [];

80 changes: 37 additions & 43 deletions MFILES/DefCovST.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% DefCovST defines the covariance functions and bounds on the
% hyperparameters for the analysis
% hyperparameters for the analysis of the spatio-temporal dataset in Ashe et al., 2018

refyear=2000;
refyear=1950;

%define covariance functions
kMat1 = @(dx,thetas) thetas(1).^2 .* (1).*exp(-dx/thetas(2));
Expand All @@ -20,79 +20,73 @@

clear modelspec;

% % defines global, high-frequency and white noise covariance functions
% % defines global, regional-linear, regional non-linear, local, and white noise covariance functions
cvfunc.G = @(dt1t2,thetas) kMat3(dt1t2,thetas(1:2));
cvfunc.R = @(t1,t2,dt1t2,ad,thetas) (kMat3(dt1t2,thetas(1:2))).*(kMat1(ad,[1 thetas(3)])).*(ad<360);
cvfunc.M = @(dt1t2,ad,thetas) (kMat3(dt1t2,thetas(1:2))).*(kMat1(ad,[1 thetas(3)])).*(ad<360);
cvfunc.RL = @(t1,t2,dt1t2,ad,thetas) (kDP(t1,t2,thetas(1))).*(kMat5(ad,[1 thetas(2)])).*(ad<360); %(kMat5(dt1t2,thetas(1:2))).*(kMat5(ad,[1 thetas(3)])).*(ad<360);
cvfunc.RN = @(t1,t2,dt1t2,ad,thetas) (kMat5(dt1t2,thetas(1:2))).*(kMat3(ad,[1 thetas(3)])).*(ad<360); %(kMat5(dt1t2,thetas(1:2))).*(kMat5(ad,[1 thetas(3)])).*(ad<360);
cvfunc.L = @(dt1t2,ad,thetas) (kMat3(dt1t2,thetas(1:2))).*(kMat3(ad,[1 thetas(3)])).*(ad<360);
cvfunc.W = @(dt1t2,ad,thetas) kDELTAG(ad,1).*kDELTA(dt1t2,thetas(1));

% % defines first derivatives
dcvfunc.G = @(t1,t2,dt1t2,thetas) kMat3d(t1,t2,dt1t2,thetas(1:2));
dcvfunc.R = @(t1,t2,dt1t2,ad,thetas) (kMat3d(t1,t2,dt1t2,thetas(1:2))).*(kMat1(ad,[1 thetas(3)])).*(ad<360);
dcvfunc.M = @(t1,t2,dt1t2,ad,thetas) (kMat3d(t1,t2,dt1t2,thetas(1:2))).*(kMat1(ad,[1 thetas(3)])).*(ad<360);
dcvfunc.RL = @(t1,t2,dt1t2,ad,thetas) 0;
dcvfunc.RN = @(t1,t2,dt1t2,ad,thetas)(kMat5d(t1,t2,dt1t2,thetas(1:2))).*(kMat3(ad,[1 thetas(3)])).*(ad<360);
dcvfunc.L = @(t1,t2,dt1t2,ad,thetas) (kMat3d(t1,t2,dt1t2,thetas(1:2))).*(kMat3(ad,[1 thetas(3)])).*(ad<360);
dcvfunc.W = 0;

% % defines sedcond derivatives
% % defines second derivatives
ddcvfunc.G = @(dt1t2,thetas) kMat3dd(dt1t2,thetas(1:2));
ddcvfunc.R = @(t1,t2,dt1t2,ad,thetas) (kMat3dd(dt1t2,thetas(1:2))).*(kMat1(ad,[1 thetas(3)])).*(ad<360);
ddcvfunc.M = @(dt1t2,ad,thetas) (kMat3dd(dt1t2,thetas(1:2))).*(kMat1(ad,[1 thetas(3)])).*(ad<360);
ddcvfunc.RL = @(t1,t2,dt1t2,ad,thetas) 0;
ddcvfunc.RN = @(dt1t2,ad,thetas) (kMat5dd(dt1t2,thetas(1:2))).*(kMat3(ad,[1 thetas(3)])).*(ad<360);
ddcvfunc.L = @(dt1t2,ad,thetas) (kMat3dd(dt1t2,thetas(1:2))).*(kMat3(ad,[1 thetas(3)])).*(ad<360);
ddcvfunc.W = 0;

modelspec(1).cvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) cvfunc.G(dt1t2,thetas(1:2))+...
cvfunc.R(t1,t2,dt1t2,ad,thetas(3:5)) +...
cvfunc.M(dt1t2,ad,thetas(6:8)) +...
cvfunc.W(dt1t2,ad,thetas(9));
cvfunc.RL(t1,t2,dt1t2,ad,thetas(3:4)) +...
cvfunc.RN(t1,t2,dt1t2,ad,thetas(5:7)) +...
cvfunc.L(dt1t2,ad,thetas(8:10)) +...
cvfunc.W(dt1t2,ad,thetas(11));

modelspec(1).dcvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) dcvfunc.G(t1,t2,dt1t2,thetas(1:2)) +...
dcvfunc.R(t1,t2,dt1t2,ad,thetas(3:5)) + dcvfunc.M(t1,t2,dt1t2,ad,thetas(6:8));
dcvfunc.RL(t1,t2,dt1t2,ad,thetas(3:4)) + dcvfunc.RN(t1,t2,dt1t2,ad,thetas(5:7)) +...
dcvfunc.L(t1,t2,dt1t2,ad,thetas(8:10));

modelspec(1).ddcvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) ddcvfunc.G(dt1t2,thetas(1:2))...
+ddcvfunc.R(t1,t2,dt1t2,ad,thetas(3:5)) + ddcvfunc.M(dt1t2,ad,thetas(6:8));

% modelspec(1).cvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) kMat3(dt1t2,thetas(1:2))+...
% (kMat3(dt1t2,thetas(3:4))).*(kMat1(ad,[1 thetas(5)])).*(ad<360) +...
% (kMat3(dt1t2,thetas(6:7))).*(kMat1(ad,[1 thetas(8)])).*(ad<360) + ...
% kDELTAG(ad,1).*(kDELTA(dt1t2,thetas(9))+thetas(10).^2);

% modelspec(1).cvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) kMat3(dt1t2,thetas(1:2))+...
% (kMat3(dt1t2,thetas(3:4))).*(kMat3(ad,[1 thetas(5)])).*(ad<360) +...
% (kMat3(dt1t2,thetas(6:7))).*(kMat3(ad,[1 thetas(8)])).*(ad<360) + ...
% (kDELTAG(ad,1)).*(kDELTA(dt1t2,thetas(9))+...
% thetas(10).^2);
% modelspec(1).cvfunc = @(t1,t2,dt1t2,thetas,ad,fp1fp2) cvfunc.G(dt1t2,thetas(1:2)) + cvfunc.H(dt1t2,thetas(3:4)) + cvfunc.W(dt1t2,ad,thetas(5));
%
+ ddcvfunc.RL(t1,t2,dt1t2,ad,thetas(3:4)) + ddcvfunc.RN(dt1t2,ad,thetas(5:7))...
+ ddcvfunc.L(dt1t2,ad,thetas(8:10));

modelspec(1).traincv = @(t1,t2,dt1t2,thetas,errcv,ad,fp1fp2) modelspec(1).cvfunc(t1,t2,dt1t2,thetas,ad,fp1fp2) + errcv;

tluTGG = [

2e4 2000 10e6 % Matern global amplitude
7e3 10e3 1e5 % Temporal parameter
2e5 4e4 10e6 % Matern global amplitude
70e3 30e3 10e5 % Temporal parameter

1000 1000 2e4 % Matern Regional amplitude
1500 1000 5e3 % Temporal parameters
10 5 20 % Geographic length scale
1 1e-3 10 % Linear amplitude
12 12 12 % Geographic length scale

2500 100 4e4 % Matern regional amplitude
4500 1000 5e3 % Temporal parameter
12 12 12 % Geographic length scale

%0 0 0
1000 500 1e4 % Matern HF regional amplitude
500 300 10000 % temporal parameters
2 .1 4.5 % geographic
2500 500 4e4 % Matern local amplitude
250 100 1e3 % Temporal parameters
3 3 3 % Geographic length scale

150 1e-2 1e4 % white noise
0 1e-2 1e4 % local offset
1500 100 1e4 % white noise
];

modelspec(1).thet0=tluTGG(:,1)';
modelspec(1).lb = tluTGG(:,2)';
modelspec(1).ub = tluTGG(:,3)';
modelspec(1).subfixed=[];
modelspec(1).subfixed=[4 7 10];

modelspec(1).sublength=[5 8]; % these are ones that will be tuned based only on tide gauges if use Optimize level 1
modelspec(1).subamp = [1 3 6 9 10];
modelspec(1).sublength=[5 8];
modelspec(1).subamp = [1 3 5 8 11];
modelspec(1).subamplinear = [];
modelspec(1).subampnonlinear = [];
modelspec(1).subampoffset = [];
modelspec(1).subampnoise = [9];
modelspec(1).subampnoise = [11];
modelspec(1).subampHF = [];
modelspec(1).label='default';

105 changes: 105 additions & 0 deletions MFILES/GPSmoothNearbyTideGauges.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
function [TGdata2,TGdata,thetL,TGmodellocal] = GPSmoothNearbyTideGauges(targcoords,addlsites,thetL0,winlength,thinlength,minlength,optimizemode,psmsldir,gslfile,maxdist,noiseMask)

% [TGdata2,TGdata,thetL,TGmodellocal] = GPSmoothNearbyTideGauges(targcoords,
% [addlsites],[thetL0],[winlength],[thinlength],[minlength],[optimizemode],
% psmsldir,gslfile,[maxdist],[noiseMask])
%
% Find tide gauge sites to include, based on length and proximity criteria, then
% fit GP model to them in order to interpolate and take running averge.
%
% Specifically, from the site of all tide gauge sites with length of at least
% minlength(3), identifies sites that fit one of the following criteria:
% 1. are longer than minlength(1)
% 2. are within maxdist degrees of one of the sites listed in targcoords
% and are longer than minlength(2)
% 3. is the nearest tide gauge to one of the sites listed in targcoords
% 4. has a PSMSL ID listed in addlsites
%
% Data are then smoothed and thinned by
%
% [TGdata2,thetL,TGmodellocal] = GPSmoothTideGauges(TGdata,winlength, ...
% optimizemode,thinlength,thetL0);
%
% EXAMPLE:
%
% [TG,TG0,thetL,TGmodellocal] = GPSmoothNearbyTideGauges(PX.sitecoords, ...
% [],[],[],[],[150 75 20],1.0,psmsldir,'none');
%
% Last updated by Robert Kopp, robert-dot-kopp-at-rutgers-dot-edu, Thu Nov 06 21:04:21 EST 2014
%

defval('minlength',[150 75 20]); % minimum length for global curves, most purposes and minimum
defval('thetL0',[]);
defval('winlength',11);
defval('thinlength',winlength-1);
defval('optimizemode',1.1); % set to 1.0 for local optimization only
defval('maxdist',5);
defval('thinyrstart',1700);
defval('noiseMask',[]);

defval('targcoords',[
34.97 -76.38; %Tump Point, NC
35.89 -75.64; %Sand Point, NC
39.085 -74.811; % Cape May Courthouse, NJ
39.50 -74.415; % Leeds Point, NJ
30.6 -81.7; % Nassau, FL
44.72 -63.23; % Chezzetcook, Nova Scotia
]);

defval('addlsites',[]);

defval('psmsldir',fullfile('.','rlr_annual'));
defval('gslfile',fullfile('.','CSIRO_Recons_gmsl_yr_2011.csv'));

% read PSMSL data for all sites longer than minlength(3)
[TGcoords,TGrsl,TGrslunc,TGid,TGsiteid,sitenames,TGsitecoords,sitelen]=ReadPSMSLData(0,1000,minlength(3),psmsldir,gslfile);

% find long tide gauge sites anywhere
sub1=find((sitelen>minlength(1)));
sub1=union(sub1,find(TGsiteid==0));

% compute angular distances between sites, and add any tide gauges within
% maxdist degrees with length greater than minlength(2)

angd= @(Lat0,Long0,lat,long) (180/pi)*(atan2(sqrt((cosd(lat).*sind(long-Long0)).^2+(cosd(Lat0).*sind(lat)-sind(Lat0).*cosd(lat).*cosd(long-Long0)).^2),(sind(Lat0).*sind(lat)+cosd(Lat0).*cosd(lat).*cosd(long-Long0))));

dDist=@(x1,x2)angd(repmat(x1(:,1),1,size(x2,1)),repmat(mod(x1(:,2),360),1,size(x2,1)),repmat(x2(:,1)',size(x1,1),1),repmat(mod(x2(:,2),360)',size(x1,1),1))'+1e6*(bsxfun(@plus,x1(:,1)',x2(:,1))>1000);

sub2=[];
for ii=1:size(targcoords,1)
TGdist=dDist(TGsitecoords,targcoords(ii,:));
[m,mi]=min(TGdist);
mi=union(mi,find((TGdist<maxdist).*(sitelen'>minlength(2))));
sub2=union(sub2,mi);
end


% add addlsites
addlsites=addlsites(:)';
subaddlsites=find(ismember(TGsiteid,addlsites));

sitesub=union(sub1,sub2);
sitesub=union(sitesub,subaddlsites);
sub=find(ismember(TGid,TGsiteid(sitesub)));

clear TGdata;
TGdata.datid=TGid(sub);
TGdata.time1=TGcoords(sub,3);
TGdata.time2=TGcoords(sub,3);
TGdata.meantime=TGcoords(sub,3);
TGdata.limiting=zeros(size(TGid(sub)));
TGdata.Y=TGrsl(sub);
TGdata.dY =TGrslunc(sub);
TGdata.compactcorr=zeros(size(TGid(sub)));
TGdata.istg = ones(size(TGid(sub)));
TGdata.lat=TGcoords(sub,1);
TGdata.long=TGcoords(sub,2);;
TGdata.Ycv=sparse(diag(TGrslunc(sub).^2));
TGdata.siteid=TGsiteid(sitesub);
TGdata.sitenames=sitenames(sitesub);
TGdata.sitecoords=TGsitecoords(sitesub,:);
TGdata.sitelen=sitelen(sitesub);

%%%%%%%%%%

[TGdata2,thetL,TGmodellocal] = GPSmoothTideGauges(TGdata,winlength,optimizemode,thinlength,thetL0,thinyrstart,noiseMask);
Loading

0 comments on commit 081ed00

Please sign in to comment.