Ignore:
Timestamp:
Apr 19, 2013, 8:26:15 AM (11 years ago)
Author:
sommeria
Message:

a few bugs repaired, GUI sizes optimized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_civdata.m

    r612 r613  
    22%------------------------------------------------------------------
    33%
    4 % function [Field,VelTypeOut]=read_civdata(filename,FieldNames,VelType)
     4% function [Field,VelTypeOut]=read_civdata(FileName,FieldNames,VelType)
    55%
    66% OUTPUT:
     
    3030%
    3131% INPUT:
    32 % filename: file name (string).
     32% FileName: file name (string).
    3333% FieldNames =cell of field names to get, which can contain the strings:
    3434%             'ima_cor': image correlation, vec_c or vec2_C
     
    4545% 'nc2struct': reads a netcdf file
    4646
    47 function [Field,VelTypeOut,errormsg]=read_civdata(filename,FieldNames,VelType)
     47function [Field,VelTypeOut,errormsg]=read_civdata(FileName,FieldNames,VelType)
    4848
    4949%% default input
     
    6060    FieldNames=[]; %default
    6161end
     62Field=[];
     63VelTypeOut=VelType;
    6264errormsg='';
     65if ~exist(FileName,'file')
     66    errormsg=['input file ' FileName ' does not exist'];
     67    return
     68end
    6369if ischar(FieldNames), FieldNames={FieldNames}; end;
    6470ProjModeRequest='';
     
    7581
    7682%% reading data
    77 Data=nc2struct(filename,'ListGlobalAttribute','CivStage');
     83Data=nc2struct(FileName,'ListGlobalAttribute','CivStage');
    7884if isfield(Data,'Txt')
    7985     erromsg=['error in read_civdata: ' Data.Txt];
     
    8591    return
    8692else
    87     [Field,vardetect]=nc2struct(filename,varlist);%read the variables in the netcdf file
     93    [Field,vardetect]=nc2struct(FileName,varlist);%read the variables in the netcdf file
    8894end
    8995if isfield(Field,'Txt')
     
    9298end
    9399if vardetect(1)==0
    94      errormsg=[ 'requested field not available in ' filename '/' VelType ': need to run patch'];
     100     errormsg=[ 'requested field not available in ' FileName '/' VelType ': need to run patch'];
    95101     return
    96102end
Note: See TracChangeset for help on using the changeset viewer.