clear variables %% Do whole-greenland NSIDC-0670 test dx = 250; dy = 250; L = dx * 5; % to make the frame length odd (5) for Savitzky-Golay alg x = -645125 : dx : (859875-dx); y = -3370125: dy :(-640125-dy); filepath = '../../../gly-kpoinar-students/zz/kpoinar-ericcice/velocity_NSIDC_0670_twentyyearmosaic/'; [vx,vy,~,ex,ey] = readicevelocity_0670(x,y,filepath); %% [ep,e1,e3,de] = principalstrainrates_savitzkygolay(vx,vy,dx,dy,ex,ey,L); figure(670); clf; hold on pcolor(x/1e3,y/1e3,ep); shading flat; colorbar cmap = flipud(cbrewer('div','RdBu',30)); colormap(cmap); caxis([-1 1]*0.01); % % Write out as asc (to become geotiffs) [X,Y] = meshgrid(x,y); filesave = 'principalstrainrate_NSIDC0670_ep.tif'; arcgridwrite(filesave,X,Y,ep); filesave = 'principalstrainrate_NSIDC0670_e1.tif'; arcgridwrite(filesave,X,Y,e1); filesave = 'principalstrainrate_NSIDC0670_e3.tif'; arcgridwrite(filesave,X,Y,e3);