Changeset 144


Ignore:
Timestamp:
04/01/15 18:20:38 (9 years ago)
Author:
jbrlod
Message:

adding feature for loading obs and filter design + dan_experiment

Location:
altifloat
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • altifloat/matlab_toolbox/script_perso.m

    r143 r144  
    77%vt=load([ indir 'vzero.dat']); 
    88robs=load([ indir 'rfloat_total.dat']); 
     9rsim=load([ indir 'rfloat_total_jum0.dat']); 
    910uvb=load([ indir 'uv_bck_dan.dat']); 
    10 uv=load([indir 'uv_total.dat']); 
     11uv=load([indir 'uv_total_jum0.dat']); 
    1112meshg=load([indir 'meshgrid_dan.dat']); 
    1213drifterdir='../altifloat/'; 
     
    5758 
    5859for j=1:nfloat      
     60  data= load([drifterdir fname{j}]); 
     61   
    5962  rfloat=robs(robs(:,2)==j-1&robs(:,end)>0,[end-1 end]); 
    6063  rfloat_lon=interp1(1:nlon,lon,rfloat(:,2)+1); 
    6164  rfloat_lat=interp1(1:nlat,lat',rfloat(:,1)+1); 
     65  Hobs=plot([data.lon(1);rfloat_lon],[data.lat(1);rfloat_lat],'.-b'); 
     66   
     67  rfloat=rsim(rsim(:,2)==j-1&rsim(:,end)>0,[end-1 end]); 
     68  rfloat_lon=interp1(1:nlon,lon,rfloat(:,2)+1); 
     69  rfloat_lat=interp1(1:nlat,lat',rfloat(:,1)+1); 
     70  Hsim=plot([data.lon(1);rfloat_lon],[data.lat(1);rfloat_lat],'.-r'); 
     71   
     72 
    6273  %   plot(rfloat(:,2)+1,rfloat(:,1)+1,'.-m'); 
    63   data= load([drifterdir fname{j}]); 
    64   Hobs=plot(data.lon(1:4),data.lat(1:4),'.-k') 
     74 
     75  Hreal=plot(data.lon(1:4),data.lat(1:4),'.-k') 
    6576   
    66   Hsim=plot([data.lon(1);rfloat_lon],[data.lat(1);rfloat_lat],'.-m'); 
    6777end 
    6878 
  • altifloat/matlab_toolbox/script_prepare_exp_modele.m

    r143 r144  
    3939end % for j 
    4040dlmwrite(['../exp_forw_dan/' initfile],MM,'\t'); 
     41 
     42%STEP OBS : modify obs file 
     43 
  • altifloat/scripts/floater_model_forward.i

    r143 r144  
    1616 
    1717#Conditions initiales : 
    18 #loadstate r_float 0 i 0 A 1 ../obs_float/init.dat D 
     18 
    1919setstate r_float_d 0 
    2020 
    21 loadstate cfil 0 ij 0 A 1 ../obs_float/CC.dat D 
    22 loadstate dfil 0 ij 0 A 1 ../obs_float/DD.dat D 
    23 loadstate mask 0 ij 0 A 1 ../obs_float/Mask.dat D 
    24 loadstate u_norm 0 ij 0 A 1 ../obs_float/NU.dat D 
    25 loadstate v_norm 0 ij 0 A 1 ../obs_float/NV.dat D 
     21loadstate cfil 0 ij 0 A 1 ../exp_forw_dan/CC.dat D 
     22loadstate dfil 0 ij 0 A 1 ../exp_forw_dan/DD.dat D 
     23loadstate u_norm 0 ij 0 A 1 ../exp_forw_dan/NU.dat D 
     24loadstate v_norm 0 ij 0 A 1 ../exp_forw_dan/NV.dat D 
    2625 
    2726#Observations : 
  • altifloat/src/floater.h

    r143 r144  
    3939//YREAL c2,c3,c4,c5; 
    4040//YREAL dtfil=26042000; 
    41 YREAL dtfil=2.604166666666667e+07; 
    42  
     41//YREAL dtfil=2.604166666666667e+07; 
     42YREAL dtfil=200000; 
    4343#endif 
    4444 
     
    213213        status=fscanf(fid,"%f",&val); 
    214214        mask[ilon][ilat]=(int)val; 
     215        YS1_mask(ilon,ilat)=mask[ilon][ilat]; 
    215216if (status!=1) { 
    216217        fprintf(stderr,"(read_mask) unable to read mask value (lon=%d,lat=%d)\n",ilon,ilat); 
     
    267268  
    268269} 
    269   
     270 
     271void read_obs_2(int argv, char *argc[]) { 
     272  /* Read observation in a ascii file compatible with save_output_rfloat 
     273     format  
     274     Column 1 (%d) : time step (from 0 to jptfl-1) 
     275     Column 2 (%d) : idfloat (from 0 to jpnfl-1) 
     276     Column 3 (%f) : grid point piret (lon) 
     277     Column 4 (%f) : grid point pjret (lat) 
     278  */ 
     279  if (argv!=2) { 
     280    printf("(read_obs) Error : read_obs with %d (1 nedded)\n",argv-1); 
     281    printf("No obs read\n"); 
     282    return; 
     283  } 
     284 FILE *fid; 
     285  int count=0; 
     286  fid=fopen(argc[1],"r"); 
     287  if (fid==NULL) { 
     288    printf("(read_obs) Error : unable to open %s\n",argc[1]); 
     289    return; 
     290  } 
     291 int it,id; 
     292 YREAL posi,posj; 
     293  int status=4; 
     294  while(status==4) { 
     295    status=fscanf(fid,"%d %d %lf %lf",&it,&id,&posi,&posj); 
     296    if (status!=4) break; 
     297    count++; 
     298    piobs[it][id]=posi; 
     299    pjobs[it][id]=posj; 
     300    pmask[it][id]=1; 
     301  }//while (status==4) 
     302  fclose(fid); 
     303  fprintf(stdout,"(read_obs) %d data were loaded as observations\n",count); 
     304} 
     305 
    270306void read_obs(int argv, char *argc[]) { 
    271307  /* Read observation in a ascii file 
  • altifloat/src/floater_delta.d

    r143 r144  
    1818#ifdef FILTER 
    1919defval K_FILTER //create a define K_FILTER in the source code 
    20 defval OFIL 6  //order of the filter 
     20defval OFIL 5  //order of the filter 
    2121#else 
    2222defval OFIL 0 //Offtime of the main trajectory (0 since there is no filter) 
     
    237237insert_fct arg run_inc 
    238238insert_fct arg read_obs 
     239insert_fct arg read_obs_2 
    239240insert_fct multirun 
    240241insert_fct arg save_output_uv 
Note: See TracChangeset for help on using the changeset viewer.