source: trunk/toolbox/plot_image.m @ 23

Last change on this file since 23 was 20, checked in by jbrlod, 15 years ago

Help header modification

File size: 1.2 KB
Line 
1function [Image2d]=plot_image(data,Valid_Pixels,Val_Pix_Nuages,Val_Pix_Terre,CLim)
2%[Image2d]=plot_image(data,Valid_Pixels,Val_Pix_Nuages,Val_Pix_Terre,CLim)
3%Affiche la donnée data sur l'image de la mer Méditerranée avec le masque
4%de Terre et de Nuage.
5%Renvoie la donnée dans une matrice à 2 dimensions de taille (512,1024).
6%Les données manquantes (nuages/terre) sont mises à la valeur
7%nan;
8%CLim représente l'échelle de couleur Clim=[val_min val_max]
9
10Image2d=nan*ones(512,1024);
11Image2d(Valid_Pixels)=data;
12Cdirect=nan*ones(512,1024);
13
14%CLim=[0 0.05];
15
16%cmap=[data;manquantes;land;cloud];
17N=64;
18cmap=[jet(N);[0.8 0.8 0.8]; [0.8 0.6 0.4] ; [1 1 1]];
19
20data(data>=CLim(2))=CLim(2);
21data(data<=CLim(1))=CLim(1);
22
23X=floor((N-1)*(data-CLim(1))/(CLim(2)-CLim(1)))+1;
24
25Cdirect(Valid_Pixels)=X;
26Cdirect(Val_Pix_Nuages)=N+3;
27Cdirect(Val_Pix_Terre)=N+2;
28Cdirect(isnan(Cdirect))=N+1;
29clf
30image(linspace(-9.5,41.5,1024),linspace(49,29,512),Cdirect);
31colormap(cmap);
32axis image;
33axis xy;
34xlabel('longitude')
35ylabel('latitude')
36axis image
37
38%Colorbar
39pos=[0.2 0.1 0.6 0.04];
40lev=linspace(CLim(1),CLim(2),10);
41lev_pas=2;
42clip_lev=CLim;
43hpal=cmap;
44orien=0;
45[h0]=colorbartype1(pos,lev,lev_pas,clip_lev,hpal,orien);
Note: See TracBrowser for help on using the repository browser.