Ignore:
Timestamp:
Apr 12, 2011, 12:12:19 AM (13 years ago)
Author:
sommeria
Message:

correct Matlab PIV, remove call to image tool box. Improve menu of uvmat VelType? (replacement of buttons)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_civxdata.m

    r221 r236  
    4747% 'nc2struct': reads a netcdf file
    4848
    49 function [Field,VelTypeOut]=read_civxdata(filename,FieldNames,VelType)
     49function [Field,VelTypeOut,errormsg]=read_civxdata(filename,FieldNames,VelType)
     50errormsg='';
     51DataTest=nc2struct(filename,'ListGlobalAttribute','Conventions');
     52if isequal(DataTest.Conventions,'uvmat/civdata')%test for new civ format
     53     [Field,VelTypeOut]=read_civdata(filename,FieldNames,VelType);
     54     return
     55end
     56   
    5057%% default input
    5158if ~exist('VelType','var')
     
    6471[Field,vardetect,ichoice]=nc2struct(filename,var);%read the variables in the netcdf file
    6572if isfield(Field,'Txt')
     73    errormsg=Field.Txt;
    6674    return
    6775end
    6876if vardetect(1)==0
    69      Field.Txt=[ 'requested field not available in ' filename '/' VelType];
     77     errormsg=[ 'requested field not available in ' filename '/' VelType];
    7078     return
    7179end
     
    117125        Field.dt=double(Field.dt);
    118126    else
    119        Field.Txt='the input file is not civx';
     127       errormsg='the input file is not civx';
    120128       Field.CivStage=0;
    121129       Field.dt=0;
     
    125133    Field.dt=double(Field.dt2);
    126134else
    127     Field.Txt='the input file is not civx';
     135    errormsg='the input file is not civx';
    128136    Field.CivStage=0;
    129137    Field.dt=0;
Note: See TracChangeset for help on using the changeset viewer.