Changeset 1083 for trunk/src/get_field.m


Ignore:
Timestamp:
Jun 18, 2020, 11:16:14 AM (4 years ago)
Author:
sommeria
Message:

bug on velocity comparison solved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_field.m

    r1082 r1083  
    172172
    173173%% select the Time attribute from input
    174 if Field.MaxDim >=2
     174if Field.MaxDim >2
    175175    variable_index=find(strcmp('variable',ListSwitchVarIndexTime),1);
    176176    set(handles.SwitchVarIndexTime,'Value',variable_index);
    177177else
    178     if isfield(ParamIn,'TimeAttrName')
     178    if isfield(ParamIn,'TimeAttrName')&& ~isempty(ParamIn.TimeAttrName)
    179179        time_index=find(strcmp(ParamIn.TimeAttrName,Field.Display.ListGlobalAttribute),1);
    180180    else
    181         time_index=find(~cellfun('isempty',regexp(Field.Display.ListGlobalAttribute,'Time')),1);% look for global attribute containing name 'Time'
     181        time_index=find(strcmp('Time',Field.Display.ListGlobalAttribute));% look for global attribute containing name 'Time'
    182182    end
    183183    if isempty(time_index)
     
    796796        set(handles.SwitchVarIndexTime,'Value',3)% the last dim must be considered as time
    797797    end
    798     if numel(var_component)<2
     798    if numel(var_component)<2 %unstructured coordinates excluded
    799799        if numel(find(test_coord))<2
    800800            ListCoord={''};
     
    828828        end
    829829        if numel(find(coord_val))<2
    830             %coord_val=[numel(var_component)+2 numel(var_component)+1];
    831830            coord_val=[1 2 3];
    832831        end
    833         set(handles.Coord_x,'Value',coord_val(1))
    834         set(handles.Coord_y,'Value',coord_val(2))
     832        set(handles.Coord_x,'Value',coord_val(end))
     833        set(handles.Coord_y,'Value',coord_val(end-1))
    835834        if numel(coord_val)>=3
    836             set(handles.Coord_z,'Value',coord_val(3))
     835            set(handles.Coord_z,'Value',coord_val(end-2))
    837836        end
    838837    end
Note: See TracChangeset for help on using the changeset viewer.