function [data]=apply_filter(data_full,ts,tfilt)

modulo = 'band';%'band';%'band','window'


[nt,nx,ny]  = size(data_full);
data = data_full;

for x = 1:nx    
data_dep = squeeze(data_full(:,x,:));
 for i = 1:ny   %min(tam(2),5)
   data_obs = data_dep(:,i);   
  if strcmp(modulo,'band')
         [y]=conv_D(data_obs,ts,tfilt);
  elseif strcmp(modulo,'window')
         [y]=weim(floor((tfilt/ts)/2)*2+1,'hann',data_obs);
  end
   data_dep(:,i) = y;
 end
data(:,x,:) = data_dep;

end
%PLOT THE ORIGINAL AND FILTERED FIELDS
%figure(1),plot(squeeze(data_full(401,tam,:)))
%hold on
%plot(squeeze(data(401,tam,:)),'r')

