function xnew=stdg(x)
%function xnew=stdg(x)
% just like std, except that it skips over bad points
[imax,jmax]=size(x);
for j=1:jmax
       good=find(x(:,j)~=NaN);
       if length(good)>1
          xnew(j)=std(x(find(x(:,j)~=NaN),j));
       else
          xnew(j)=NaN;
       end
end
