Ignore:
Timestamp:
Jan 18, 2011, 10:50:40 PM (13 years ago)
Author:
sommeria
Message:

rationalisation of uvmat, introduction of the new function read_field, links with get_field, several bug repairs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_civxdata.m

    r179 r180  
    6161[var,role,units,vel_type_out_cell]=varcivx_generator(FieldNames,VelType);%determine the names of constants and variables to read
    6262[Field,vardetect,ichoice]=nc2struct(filename,var);
    63 if isfield(Field,'Txt')
    64     return % error in file reading
    65 end
     63% if isfield(Field,'Txt')
     64%     return % error in file reading
     65% end
    6666if vardetect(1)==0
    6767     Field.Txt=[ 'requested field not available in ' filename '/' VelType];
    68      return
    6968end
    7069var_ind=find(vardetect);
     
    8988Field.NbCoord=Field.nb_coord;
    9089Field.NbDim=Field.nb_dim;
    91 
    92 %determine the appropriate constant for time and dt for the PIV pair
    93 test_civ1=isequal(VelTypeOut,'civ1')||isequal(VelTypeOut,'interp1')||isequal(VelTypeOut,'filter1');
    94 test_civ2=isequal(VelTypeOut,'civ2')||isequal(VelTypeOut,'interp2')||isequal(VelTypeOut,'filter2');
    95 if test_civ1
    96     Field.Time=double(Field.absolut_time_T0);
    97     Field.dt=double(Field.dt);
    98 elseif test_civ2
    99     Field.Time=double(Field.absolut_time_T0_2);
    100     Field.dt=double(Field.dt2);
    101 else
    102     Field.Txt='the input file is not civx';
    103     display(Field.Txt)
    104 end
    10590
    10691% CivStage
     
    119104end
    120105
     106%determine the appropriate constant for time and dt for the PIV pair
     107test_civ1=isequal(VelTypeOut,'civ1')||isequal(VelTypeOut,'interp1')||isequal(VelTypeOut,'filter1');
     108test_civ2=isequal(VelTypeOut,'civ2')||isequal(VelTypeOut,'interp2')||isequal(VelTypeOut,'filter2');
     109Field.Time=0; %default
     110if test_civ1
     111    if isfield(Field,'absolut_time_T0')
     112        Field.Time=double(Field.absolut_time_T0);
     113        Field.dt=double(Field.dt);
     114    else
     115       Field.Txt='the input file is not civx';
     116       Field.CivStage=0;
     117       Field.dt=0;
     118    end
     119elseif test_civ2
     120    Field.Time=double(Field.absolut_time_T0_2);
     121    Field.dt=double(Field.dt2);
     122else
     123    Field.Txt='the input file is not civx';
     124    Field.CivStage=0;
     125    Field.dt=0;
     126end
     127
     128
     129
    121130%% rescale fields to pixel coordinates
    122131if isfield(Field,'pixcmx')
Note: See TracChangeset for help on using the changeset viewer.