source: trunk/src/choix_mois.m @ 325

Last change on this file since 325 was 325, checked in by pinsard, 13 years ago

rehab MSG, EPSAT tools (to be cont.)

  • Property svn:keywords set to Id
File size: 898 bytes
Line 
1%[mat3D_s, jours_s]=choix_mois(mat3D,jours,mois_deb,mois_fin )
2
3%+
4%
5% .. _choix_mois.m:
6%
7% ============
8% choix_mois.m
9% ============
10%
11% Pour un fichier mat3D(lat, lon, jours), on selectionne tous les mois
12% compris entre mois_deb et mois_fin inclus. ex: pour prendre d'avril à
13% aout, on choisit mois_deb=4,mois_fin=8 , de decembre a fevrier:
14% mois_deb=12,mois_fin=2, toute l'annee (par defaut): mois_deb=1,mois_fin=12   
15%
16% EVOLUTIONS
17% ==========
18%
19% $Id$
20%
21% $URL$
22%
23% - fplod 20110124T154950Z aedon.locean-ipsl.upmc.fr (Darwin)
24%
25%   * add minimal rest header
26%
27%-
28
29function [mat3D_s, jours_s]=choix_mois(mat3D,jours,mois_deb,mois_fin )
30if(nargin<3)
31 mois_deb=1;
32end
33if(nargin<4)
34 mois_fin=12;   
35end
36
37dd= datevec(jours);
38i=dd(:,2);
39if(mois_deb<=mois_fin )
40  i_s=find(i>=mois_deb&i<=mois_fin);
41else
42  i_s=find(i>=mois_deb|i<=mois_fin); 
43end
44jours_s=jours(i_s);
45mat3D_s=mat3D(:,:,i_s);
Note: See TracBrowser for help on using the repository browser.