1 | %+
|
---|
2 | %
|
---|
3 | % .. _testInterp2D.m:
|
---|
4 | %
|
---|
5 | % ==============
|
---|
6 | % testInterp2D.m
|
---|
7 | % ==============
|
---|
8 | %
|
---|
9 | % DESCRIPTION
|
---|
10 | % ===========
|
---|
11 | %
|
---|
12 | % EVOLUTIONS
|
---|
13 | % ==========
|
---|
14 | %
|
---|
15 | % $Id$
|
---|
16 | %
|
---|
17 | % $URL$
|
---|
18 | %
|
---|
19 | % - fplod 20110705T125628Z cratos.locean-ipsl.upmc.fr (Linux)
|
---|
20 | %
|
---|
21 | % * minimal header
|
---|
22 | %
|
---|
23 | %-
|
---|
24 | latmin = 10;
|
---|
25 | latmax = 20;
|
---|
26 | lonmin = -20;
|
---|
27 | lonmax = -10;
|
---|
28 |
|
---|
29 | filename='msg-tb108_2006-07-27_15min.nc';
|
---|
30 |
|
---|
31 | repertoire = 'C:\Users\Jas\Desktop\Documents de Travail\S6\Stage au labo LOCEAN\Matlab\MSG\';
|
---|
32 | path(path,repertoire);
|
---|
33 |
|
---|
34 | ncid = netcdf.open(filename, 'NC_NOWRITE');
|
---|
35 | Temps = netcdf.getVar(ncid,3);
|
---|
36 | Longitudes = netcdf.getVar(ncid,1);
|
---|
37 | Latitudes = netcdf.getVar(ncid,2);
|
---|
38 |
|
---|
39 | startlat = find(Latitudes>=latmin, 1 );
|
---|
40 | countlat = find(Latitudes<=latmax, 1, 'last' ) - startlat +1;
|
---|
41 | startlon = find(Longitudes>=lonmin, 1 );
|
---|
42 | countlon = find(Longitudes<=lonmax, 1, 'last' ) - startlon +1;
|
---|
43 |
|
---|
44 | Latitudes = Latitudes(Latitudes>=latmin & Latitudes<=latmax);
|
---|
45 | Longitudes = Longitudes(Longitudes>=lonmin & Longitudes<=lonmax);
|
---|
46 |
|
---|
47 | TbMSG = netcdf.getVar(ncid,0,[startlon-1 startlat-1 0],...
|
---|
48 | [countlon countlat size(Temps,1)]);
|
---|
49 |
|
---|
50 | TbMSG = TbMSG*0.01+327.68;
|
---|
51 |
|
---|
52 | ij_TbMoy = mean(TbMSG,3);
|
---|
53 |
|
---|
54 | xi = 1 : (size(ij_TbMoy,1)-1)/99 : size(ij_TbMoy,1);
|
---|
55 | yi = (1 : (size(ij_TbMoy,2)-1)/99 : size(ij_TbMoy,2))';
|
---|
56 |
|
---|
57 | ij_TbMoy_interp = interp2(ij_TbMoy,xi,yi);
|
---|
58 |
|
---|
59 | load coast
|
---|
60 |
|
---|
61 | set(gcf,'color','w','units','normalized','position',[0 0 1 1]);
|
---|
62 | subplot(1,2,1);
|
---|
63 | image = imagesc(Longitudes,Latitudes,ij_TbMoy');
|
---|
64 | set(image,'alphadata',~isnan(ij_TbMoy'));
|
---|
65 | axis([lonmin lonmax latmin latmax])
|
---|
66 | hold on
|
---|
67 | set(gca,'ydir','normal')
|
---|
68 | coast = plot(long,lat,'k-');
|
---|
69 | Title = title('Données originelles');
|
---|
70 | xlabel('Longitudes')
|
---|
71 | ylabel('Latitudes')
|
---|
72 | grid on
|
---|
73 | ticklatlon
|
---|
74 |
|
---|
75 | subplot(1,2,2);
|
---|
76 | image2 = imagesc(Longitudes,Latitudes,ij_TbMoy_interp');
|
---|
77 | set(image2,'alphadata',~isnan(ij_TbMoy_interp'));
|
---|
78 | axis([lonmin lonmax latmin latmax])
|
---|
79 | hold on
|
---|
80 | set(gca,'ydir','normal')
|
---|
81 | coast2 = plot(long,lat,'k-');
|
---|
82 | Title2 = title('Données interpolées');
|
---|
83 | xlabel('Longitudes')
|
---|
84 | ylabel('Latitudes')
|
---|
85 | grid on
|
---|
86 | ticklatlon
|
---|