1 | %% function[mat_3D,jours,lat ,lon]=readAMSU(file,z_deb, z_fin,chemin) |
---|
2 | |
---|
3 | %+ |
---|
4 | % |
---|
5 | % .. _readAMSU.m: |
---|
6 | % |
---|
7 | % ========== |
---|
8 | % readAMSU.m |
---|
9 | % ========== |
---|
10 | % |
---|
11 | % routine de lecture d un fichier de donnees AMSU au format netcdf |
---|
12 | % nclod : simplification du seuillage et de la mise sous forme |
---|
13 | % mat_3D(lat,lon, jours) |
---|
14 | % |
---|
15 | % EVOLUTIONS |
---|
16 | % ========== |
---|
17 | % |
---|
18 | % $Id: readAMSU.m 325 2011-08-04 15:30:01Z pinsard $ |
---|
19 | % |
---|
20 | % $URL$ |
---|
21 | % |
---|
22 | % - fplod 20110124T154723Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
23 | % |
---|
24 | % * add minimal rest header |
---|
25 | % |
---|
26 | %- |
---|
27 | function[mat_3D,jours,lat ,lon]=readAMSU(file,z_deb, z_fin,chemin) |
---|
28 | |
---|
29 | if(nargin<2) |
---|
30 | z_deb=[ -30 -60 datenum(1957,1,2)] |
---|
31 | end |
---|
32 | if(nargin<3) |
---|
33 | z_fin=[ 45 50 datenum(2020,1,1)] |
---|
34 | end |
---|
35 | |
---|
36 | if(nargin<4) |
---|
37 | chemin='/homedata/eymard/AMSUAB/'; |
---|
38 | end |
---|
39 | |
---|
40 | if(chemin(end)~='/') |
---|
41 | chemin=[chemin,'/']; |
---|
42 | end |
---|
43 | |
---|
44 | file=[chemin,file]; |
---|
45 | %% on stocke le canal dans la variable string |
---|
46 | |
---|
47 | nc=netcdf(file,'nowrite'); |
---|
48 | longitude=nc{'xlon'}(:); |
---|
49 | latitude=nc{'ylat'}(:); |
---|
50 | jours=nc{'jours'}(:); |
---|
51 | |
---|
52 | %jours=jours/24+datenum(1957,01,01); % En jours juliens |
---|
53 | jo=find(jours>z_deb(3) & jours<z_fin(3)); |
---|
54 | jours=jours(jo); |
---|
55 | |
---|
56 | la=find(latitude>z_deb(1) & latitude<z_fin(1)); |
---|
57 | lat=latitude(la); |
---|
58 | |
---|
59 | lo=find(longitude>z_deb(2) & longitude<z_fin(2)); |
---|
60 | lon=longitude(lo); |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | temperature=squeeze(nc{'moyenne_tb'}(jo,la,lo)); |
---|
66 | |
---|
67 | |
---|
68 | %% mat_3D est la matrice (lat,lon,jours) que l''on utilise par la suite |
---|
69 | mat_3D=permute(temperature,[2 3 1]); |
---|
70 | |
---|
71 | %% On realise un seuillage qui optimise l''affichage |
---|
72 | %% des donnees peu traitees. |
---|
73 | mat_3D(find((mat_3D>300)|(mat_3D<140)))=NaN; |
---|