Changeset 56 for trunk/src/uvmat.m


Ignore:
Timestamp:
Mar 17, 2010, 1:30:15 PM (14 years ago)
Author:
sommeria
Message:

uvmat: edit vector button activated
debugging and cleaning after modifications made with the windows version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r55 r56  
    822822   set(handles.Fields,'String',{'image';'get_field...';'velocity';'vort';'div';'more...'})
    823823elseif isequal(FileExt,'.nc')||isequal(FileExt,'.cdf')
    824    Data=nc2struct(FileName,[]);
     824   Data=nc2struct(FileName,'ListGlobalAttribute','absolut_time_T0','civ');
    825825   col_vec=get(handles.col_vec,'String');
    826    if isfield(Data,'absolut_time_T0')%&& (isfield(Data,'civ1')||isfield(Data,'civ'))
     826   if isfield(Data,'absolut_time_T0')&& ~(isfield(Data,'civ') && isequal(Data.civ,0))
    827827       set(handles.Fields,'String',{'image';'get_field...';'velocity';'vort';'div';'more...'})
    828828       set(handles.Fields,'Value',3) % set menu to 'velocity'
     
    19861986    Field{1}.CoordUnit='pixel'; %used for mouse_motion
    19871987end
     1988
     1989%read a second image
    19881990if ~isfield(UvData,'Txt')&& ~isempty(filename_1) && isequal(FieldName_1,'image')
    19891991    switch FileType_1
     
    27302732    netcdf.close(nc) 
    27312733else %old netcdf library
    2732     nc=netcdf(filename,'write'); %open netcdf file
    2733     result=redef(nc);
    2734     eval(['nc.' attrname '=1;']);
    2735     theDim=nc(nbname) ;% get the number of velocity vectors
    2736     nb_vectors=size(theDim);
    2737     var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag
    2738     var_FixFlag(1:nb_vectors)=AxeData.FF;%
    2739     fin=close(nc);
    2740 end
    2741 
    2742 
    2743 
    2744 
    2745 
    2746 
    2747 
     2734    netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
     2735end
     2736
     2737function netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
     2738nc=netcdf(filename,'write'); %open netcdf file
     2739result=redef(nc);
     2740eval(['nc.' attrname '=1;']);
     2741theDim=nc(nbname) ;% get the number of velocity vectors
     2742nb_vectors=size(theDim);
     2743var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag
     2744var_FixFlag(1:nb_vectors)=AxeData.FF;%
     2745fin=close(nc);
    27482746
    27492747
Note: See TracChangeset for help on using the changeset viewer.