Changeset 586 for trunk/src/get_field.m


Ignore:
Timestamp:
Mar 13, 2013, 9:12:09 AM (12 years ago)
Author:
sommeria
Message:

tps_coeff_field introduced and several bugs corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_field.m

    r582 r586  
    406406    set(handles.CheckScalar,'Value',0)
    407407    set(handles.PanelVectors,'Visible','on')
     408    set(handles.XVarName,'Visible','on')
     409    set(handles.YVarName,'Visible','on')
     410    set(handles.X_title,'Visible','on')
     411    set(handles.Y_title,'Visible','on')
    408412end
    409413
     
    413417function scalar_Callback(hObject, eventdata, handles)
    414418%------------------------------------------------------------------------
     419Field=get(handles.get_field,'UserData');
    415420index=get(handles.scalar,'Value');
    416421string=get(handles.scalar,'String');
     
    420425%eliminate time
    421426TimeDimName='';%default
    422 if strcmp(get(handles.TimeDimensionMenu,'Visible'),'on')
    423     TimeDimList=get(handles.TimeDimensionMenu,'String');
    424     TimeDimIndex=get(handles.TimeDimensionMenu,'Value');
    425     TimeDimName=TimeDimList{TimeDimIndex};
    426 end
     427SwitchVarIndexTime=get(handles.SwitchVarIndexTime,'String');
     428TimeVarOption=SwitchVarIndexTime{get(handles.SwitchVarIndexTime,'Value')};
     429if strcmp(TimeVarOption,'variable')
     430    List=get(handles.TimeVarName,'String');
     431    TimeVarName=List{get(handles.TimeVarName,'Value')};
     432elseif  strcmp(TimeVarOption,'dim index')
     433    List=get(handles.TimeVarName,'String');
     434    TimeDimName=List{get(handles.TimeVarName,'Value')};
     435end
     436% A completer
     437% if strcmp(get(handles.TimeDimensionMenu,'Visible'),'on')
     438%     TimeDimList=get(handles.TimeDimensionMenu,'String');
     439%     TimeDimIndex=get(handles.TimeDimensionMenu,'Value');
     440%     TimeDimName=TimeDimList{TimeDimIndex};
     441% end
    427442
    428443%check possible coordinates
     
    432447for ilist=1:numel(Field.VarDimName)
    433448    dimnames=Field.VarDimName{ilist}; %list of dimensions for variable #ilist
    434     if isequal(dimnames,{TimeDimName})
     449    if isequal(dimnames,TimeDimName)
    435450        test_coord(ilist)=0;%mark time variables fo elimination
     451    end
     452    if ischar(dimnames)
     453        dimnames={dimnames};
    436454    end
    437455    for idim=1:numel(dimnames)
Note: See TracChangeset for help on using the changeset viewer.