Ignore:
Timestamp:
May 3, 2012, 7:30:05 PM (12 years ago)
Author:
sommeria
Message:

bugs corrected in civ_matlab and object projection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_civdata.m

    r404 r406  
    4848
    4949function [Field,VelTypeOut,errormsg]=read_civdata(filename,FieldNames,VelType,CivStage)
    50 errormsg='';
     50
    5151%% default input
    5252if ~exist('VelType','var')
     
    6262    FieldNames=[]; %default
    6363end
     64errormsg='';
    6465
    6566%% reading data
    6667[varlist,role,units,VelTypeOut]=varcivx_generator(FieldNames,VelType,CivStage);
    67 [Field,vardetect]=nc2struct(filename,varlist);%read the variables in the netcdf file
     68if isempty(varlist)
     69    erromsg=['error in read_civdata: unknow velocity type ' VelType];
     70    return
     71else
     72    [Field,vardetect]=nc2struct(filename,varlist);%read the variables in the netcdf file
     73end
    6874if isfield(Field,'Txt')
    6975    errormsg=Field.Txt;
     
    106112%            if vel_type=[] or'*', a  priority choice is done, civ2 considered better than civ1 )
    107113
    108 function [var,role,units,vel_type_out]=varcivx_generator(FieldNames,vel_type,CivStage)
     114function [var,role,units,vel_type_out,errormsg]=varcivx_generator(FieldNames,vel_type,CivStage)
    109115
    110116%% default input values
     
    113119if ~exist('FieldNames','var'),FieldNames={'ima_cor'};end;%default scalar
    114120if ischar(FieldNames), FieldNames={FieldNames}; end;
     121errormsg='';
    115122
    116123%% select the priority order for automatic vel_type selection
     
    127134    end
    128135end
    129 if isempty(vel_type)
     136if isempty(vel_type)||strcmp(vel_type,'*')
    130137    switch CivStage
    131138        case {6} %filter2 available
     
    146153    vel_type='filter1';
    147154end
    148 
     155var={};
    149156switch vel_type
    150157    case 'civ1'
Note: See TracChangeset for help on using the changeset viewer.