1 |
gforget |
1.1 |
|
2 |
|
|
%use the field produced in sample_proccessing/example_bin_average.m |
3 |
gforget |
1.2 |
if myenv.verbose>0; |
4 |
|
|
gcmfaces_msg('* apply land mask (1/NaN) to gridded before smoothing'); |
5 |
|
|
end; |
6 |
|
|
% fld=obsMap; fld(find(isnan(fld)))=0; fld(find(mygrid.hFacCsurf==0))=NaN; |
7 |
|
|
fld=obsMap.*mygrid.mskC(:,:,1); |
8 |
gforget |
1.1 |
|
9 |
|
|
%choose smoothing scale: here 3 X grid spacing |
10 |
gforget |
1.2 |
if myenv.verbose>0; |
11 |
|
|
gcmfaces_msg('* set the smoothing scale to 3 grid points'); |
12 |
|
|
end; |
13 |
gforget |
1.1 |
distXC=3*mygrid.DXC; distYC=3*mygrid.DYC; |
14 |
|
|
|
15 |
|
|
%do the smoothing: |
16 |
gforget |
1.2 |
if myenv.verbose>0; |
17 |
|
|
gcmfaces_msg(['* call diffsmoth2D : apply smoothing operator ' ... |
18 |
|
|
'that consists in time stepping a diffusion equation ' ... |
19 |
|
|
'with accordingly chosen diffusivity and duration. In particular ' ... |
20 |
|
|
'diffsmoth2D illustrates gradient computations (using calc_T_grad) ' ... |
21 |
|
|
'and divergence computations (using calc_UV_div).']); |
22 |
|
|
end; |
23 |
|
|
obsMap_smooth=diffsmooth2D(fld,distXC,distYC); |
24 |
gforget |
1.1 |
|
25 |
|
|
%display results: |
26 |
gforget |
1.2 |
if myenv.verbose>0; |
27 |
|
|
gcmfaces_msg('* crude display of results in array format'); |
28 |
|
|
end; |
29 |
|
|
OBS_smooth=convert2array(obsMap_smooth); |
30 |
gforget |
1.1 |
|
31 |
gforget |
1.2 |
figure; imagescnan(OBS_smooth','nancolor',[1 1 1]*0.8); axis xy; caxis([-1 1]*0.4); colorbar; |
32 |
|
|
title('smoothed data') |