Changeset 56 for trunk/src/uvmat.m
- Timestamp:
- Mar 17, 2010, 1:30:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r55 r56 822 822 set(handles.Fields,'String',{'image';'get_field...';'velocity';'vort';'div';'more...'}) 823 823 elseif isequal(FileExt,'.nc')||isequal(FileExt,'.cdf') 824 Data=nc2struct(FileName, []);824 Data=nc2struct(FileName,'ListGlobalAttribute','absolut_time_T0','civ'); 825 825 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)) 827 827 set(handles.Fields,'String',{'image';'get_field...';'velocity';'vort';'div';'more...'}) 828 828 set(handles.Fields,'Value',3) % set menu to 'velocity' … … 1986 1986 Field{1}.CoordUnit='pixel'; %used for mouse_motion 1987 1987 end 1988 1989 %read a second image 1988 1990 if ~isfield(UvData,'Txt')&& ~isempty(filename_1) && isequal(FieldName_1,'image') 1989 1991 switch FileType_1 … … 2730 2732 netcdf.close(nc) 2731 2733 else %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) 2735 end 2736 2737 function netcdf_toolbox(filename,AxeData,attrname,nbname,flagname) 2738 nc=netcdf(filename,'write'); %open netcdf file 2739 result=redef(nc); 2740 eval(['nc.' attrname '=1;']); 2741 theDim=nc(nbname) ;% get the number of velocity vectors 2742 nb_vectors=size(theDim); 2743 var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag 2744 var_FixFlag(1:nb_vectors)=AxeData.FF;% 2745 fin=close(nc); 2748 2746 2749 2747
Note: See TracChangeset
for help on using the changeset viewer.