I am interpolating triscattered data onto a regular grid. It works but then stops at t = 10, I don't know why it is doing this!.. I think i had this problem a while back and I managed to sort it but I can't seem to fix it this time. Does anyone know what is wrong? see after code for data dimensions…
weight = cos(REF_lat);
[x,y]=meshgrid(0:1:360,-66:1:66);x=x(1:end-1,1:end-1); y=y(1:end-1,1:end-1);load('/work/uo0122/u253082/Mat_Time_Subsampled/STORM_10d_TJJ_ssh_orig_sampling.mat');s = STORM_10d_TJJ_ssh_orig_sampling;mask = zeros(size(depth)); mask(find(depth > 0)) = 1;AM = ones(663,132,360);Wrep = ones(663,132,360);for t = 1:size(s,1); t tic a=squeeze(s(t,:,:)); a=a(:); bad1=find(isnan(a)==1); a(bad1)=[]; lon=REF_lon(:); lon(bad1)=[]; lat=REF_lat(:); lat(bad1)=[]; w = weight(:); w(bad1)=[]; F1=TriScatteredInterp(lon,lat,a,'natural'); W1=TriScatteredInterp(lon,lat,w,'natural'); a_m=F1(x,y); AM(t,:,:)=a_m; W=W1(x,y); Wrep(t,:,:)=W; tocend
weight = 3127 x 254 s = 663 x 3127 x 254 * you can ignore mask
The data I get afterwards looks reasonable too. My biggest suspicion is that it is because it is a timestep that is just NaN's, I tried removing the NaN's but I couldn't seem to do it properly.
Thanks in advance! Michael
Best Answer