%author : Gael Forget %date : 07/25/2005 %object : test if there are enough vertical sampling to justify an interpolated value % %inputs : % profile_std standardized profile % z_std standard depths % z_in originally observed depths % fill_value_output fill value of the output files function [profile_std2]=test_interp(profile_std,z_std,z_in,fill_value_output); profile_std2=profile_std; dz=(z_std(2:end)-z_std(1:end-1)); dz=[dz(1) (dz(2:end)+dz(1:end-1))/2 dz(end)]; %1) define upper and lower limits of the cells : zinf0=z_std-dz/2; zsup0=z_std+dz/2; zinf1=z_std-dz; zsup1=z_std+dz; zinf2=max(z_std-3*dz,z_std-500); zsup2=min(z_std+3*dz,z_std+500); %2) make the test itself : for kkk=1:length(z_std) tmp0=~isempty( find((z_in>=zinf0(kkk))&(z_in<=zsup0(kkk))) ); tmp1_1=~isempty( find((z_in>zinf1(kkk))&(z_in<=z_std(kkk))) ); tmp2_1=~isempty( find((z_in>=z_std(kkk))&(z_inzinf2(kkk))&(z_in<=z_std(kkk))) ); tmp2_2=~isempty( find((z_in>=z_std(kkk))&(z_in