Changeset 236 for trunk/src/read_field.m


Ignore:
Timestamp:
Apr 12, 2011, 12:12:19 AM (12 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_field.m

    r233 r236  
    3636if strcmp(FileType,'netcdf')  %read the first nc field
    3737    ParamOut.FieldName=ParamIn.FieldName;
    38     GUIName='get_field'; %default name of the GUI getç_field
     38    GUIName='get_field'; %default name of the GUI get_field
    3939    if isfield(ParamIn,'GUIName')
    4040        GUIName=ParamIn.GUIName;
     
    4444        FieldList=calc_field;%list of possible fields for Civx data
    4545        ParamOut.ColorVar='';%default
    46         field_index=strcmp(ParamOut.FieldName,FieldList);%look for ParamOut.FieldName in the list
    47         if isempty(find(field_index,1))% ParamOut.FieldName is not in the list, check whether Civx data exist
    48             Data=nc2struct(ObjectName,'ListGlobalAttribute','absolut_time_T0','civ');
    49             if ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)
     46        field_index=strcmp(ParamIn.FieldName,FieldList);%look for ParamIn.FieldName in the list of possible fields for Civx data
     47        if isempty(find(field_index,1))% ParamIn.FieldName is not in the list, check whether Civx data exist
     48            Data=nc2struct(ObjectName,'ListGlobalAttribute','Conventions','absolut_time_T0','civ');
     49            if isequal(Data.Conventions,'uvmat/civdata')
     50                ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
     51                ParamOut.ColorVar='ima_cor';
     52                InputField=[{ParamOut.FieldName} {ParamOut.ColorVar}];
     53                [Field,ParamOut.VelType]=read_civdata(ObjectName,InputField,ParamIn.VelType);
     54                test_civx=Field.CivStage;
     55            elseif ~isempty(Data.absolut_time_T0)&& ~isequal(Data.civ,0)
    5056                ParamOut.FieldName='velocity';%Civx data found, set .FieldName='velocity' by default
    5157                ParamOut.ColorVar='ima_cor';
     
    6773                InputField=[InputField {ParamOut.ColorVar}];
    6874            end
    69             [Field,ParamOut.VelType]=read_civxdata(ObjectName,InputField,ParamIn.VelType);
     75            [Field,ParamOut.VelType,errormsg]=read_civxdata(ObjectName,InputField,ParamIn.VelType);
     76            if ~isempty(errormsg)
     77                return
     78            end
    7079            test_civx=Field.CivStage;
    7180            ParamOut.CivStage=Field.CivStage;
Note: See TracChangeset for help on using the changeset viewer.