source: altifloat/matlab_toolbox/script_pmp.m @ 160

Last change on this file since 160 was 138, checked in by jbrlod, 9 years ago

comments in script_pmp.m

File size: 1.2 KB
Line 
1%% Script used to load data from Pierre-Marie Poulain and save it in the YAO format
2
3
4%% Parametrization of the script
5start_time = '20130827T130000';
6end_time='20130915T190000';
7
8%directory/files containing data
9indir='../altifloat/';
10filename='*.mat';
11
12%directory/file to save the obs file
13outdir='../obs_float';
14fout=['obs_altifloat_all_' start_time '_' end_time '.dat'];
15
16%step time in day (6h=0?25). Discard all time that doesn not fit
17dt=0.25
18
19%meshfile to interpolate
20meshfile = '../obs_float/meshgrid3.dat';
21%% THE SCRIPT - NORMALLY NOT TO BE MODIFIED
22
23stime_num=datenum(start_time,'yyyymmddTHHMMSS');
24etime_num=datenum(end_time,'yyyymmddTHHMMSS');
25
26id=1;
27
28MM=[]; %output matrix to be saved
29
30Fdir=dir([indir filename]);
31
32for j=1:length(Fdir)
33 
34  load([indir Fdir(j).name]);
35 
36  %Prendre à Epsilon prÚs
37  I=find(time>=stime_num & time<=etime_num);
38 
39  if (length(I)>2) %%at least two positions of the drifter
40    fprintf(1,'Drifter #%d starting at %s: ',id,datestr(time(1)));
41    [x,y,t,M] = obs2yao(lon,lat,time,stime_num,dt,meshfile,id);
42    fprintf(1,'%d position selected\n',length(t));
43    if ~isempty(M)
44      id=id+1;
45      MM=[MM;M]; %à arrondir   
46    end
47  end %length(I)>2
48 
49end %for j
50
51save([outdir fout],'-ascii','MM');
Note: See TracBrowser for help on using the repository browser.