- Timestamp:
- Aug 16, 2012, 8:47:11 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/calc_field_interp.m
r515 r516 17 17 function [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp(Coord,FieldVar,Operation,XI,YI) 18 18 19 %% nbre of subdomains20 % if ndims(Coord_interp)==321 % nb_coord=size(Coord_interp,3);22 % npx=size(Coord_interp,2);23 % npy=size(Coord_interp,1);24 % nb_sites=npx*npy;25 % Coord_interp=reshape(Coord_interp,nb_sites,nb_coord);26 % else27 % nb_coord=size(Coord_interp,2);28 % nb_sites=size(Coord_interp,1);29 % end30 19 VarVal=[]; 31 20 ListVarName={}; -
trunk/src/calc_tps.m
r515 r516 15 15 if ~isempty(VarType.vector_x)&&~isempty(VarType.vector_y) 16 16 Attr=DataIn.VarAttribute{VarType.vector_x}; 17 if ~isfield(Attr,'VarIndex_tps')&& (checkall || (isfield(Attr,'FieldRequest')&&strcmp(Attr.FieldRequest,' derivatives')))17 if ~isfield(Attr,'VarIndex_tps')&& (checkall || (isfield(Attr,'FieldRequest')&&strcmp(Attr.FieldRequest,'interp_tps'))) 18 18 U=DataIn.(DataIn.ListVarName{VarType.vector_x}); 19 19 V=DataIn.(DataIn.ListVarName{VarType.vector_y}); … … 52 52 DataOut.VarAttribute{nbvar+5}=DataIn.VarAttribute{VarType.vector_y};%reproduce attributes of velocity 53 53 DataOut.VarAttribute{nbvar+5}.Role='vector_y_tps'; 54 % if isfield(DataOut.VarAttribute{VarType.vector_x},'FieldRequest') 55 % DataOut.VarAttribute{VarType.vector_x}=rmfield(DataOut.VarAttribute{VarType.vector_x},'FieldRequest'); 56 % end 57 % if isfield(DataOut.VarAttribute{VarType.vector_x},'Operation') 58 % DataOut.VarAttribute{VarType.vector_x}=rmfield(DataOut.VarAttribute{VarType.vector_x},'Operation'); 59 % end 60 if isfield(DataOut,'ListDimName')%cleaning'FieldRequest' 54 if isfield(DataOut,'ListDimName')%cleaning' 61 55 DataOut=rmfield(DataOut,'ListDimName'); 62 56 end -
trunk/src/find_field_cells.m
r515 r516 20 20 % .coord: vector of indices of coordinate variables corresponding to matrix dimensions 21 21 % 22 % .FieldRequest= 'interp ', 'derivatives' indicate whetherinterpolation or derivatives (tps) is needed to calculate the requested field22 % .FieldRequest= 'interp_lin', 'interp_tps' indicate whether lin interpolation or derivatives (tps) is needed to calculate the requested field 23 23 % .FieldNames = cell of fields to calculate from the fied cell 24 24 % -
trunk/src/proj_field.m
r515 r516 980 980 if isfield(VarTypeCell{icell},'FieldRequest') 981 981 switch VarTypeCell{icell}.FieldRequest 982 case 'interp '982 case 'interp_lin' 983 983 ProjMode{icell}='interp'; 984 case ' derivatives'984 case 'interp_tps' 985 985 ProjMode{icell}='filter'; 986 986 end … … 1225 1225 VarDimName{ilist}={'coord_y','coord_x'}; 1226 1226 end 1227 % if ~isfield(ProjData,'coord_x')1228 % ProjData.coord_x=[XMin XMax];1229 % ProjData.coord_y=[YMin YMax];1230 % ListFieldProj=[{'coord_x','coord_y'} ListFieldProj'];1231 % VarDimName=[{'coord_x','coord_y'} VarDimName];1232 % VarAttribute=[{[],[]} VarAttribute];1233 % end1234 1227 ProjData.ListVarName=[ProjData.ListVarName ListFieldProj]; 1235 1228 ProjData.VarDimName=[ProjData.VarDimName VarDimName]; … … 1276 1269 ProjData.ListVarName=[ProjData.ListVarName {AYProjName} {AXProjName}]; %TODO: check if it already exists in Projdata (several cells) 1277 1270 ProjData.VarDimName=[ProjData.VarDimName {AYProjName} {AXProjName}]; 1271 ProjData.VarAttribute=[ProjData.VarAttribute {[]} {[]}]; 1278 1272 Coord_z=[]; 1279 1273 Coord_y=[]; -
trunk/src/read_GUI.m
r497 r516 57 57 if ~isempty(listinput) 58 58 if numel(value)==1% single selection 59 if ischar(listinput) 60 input=listinput; 61 else 59 62 input=listinput{value}; 63 end 60 64 else % multiple selection 61 65 input=listinput(value); -
trunk/src/read_civdata.m
r515 r516 64 64 errormsg=''; 65 65 if ischar(FieldNames), FieldNames={FieldNames}; end; 66 FieldRequest=' vec';66 FieldRequest=''; 67 67 for ilist=1:length(FieldNames) 68 68 if ~isempty(FieldNames{ilist}) 69 69 switch FieldNames{ilist} 70 70 case{'U','V','norm(U,V)'} 71 FieldRequest='interp ';71 FieldRequest='interp_lin'; 72 72 case {'curl(U,V)','div(U,V)','strain(U,V)'} 73 FieldRequest=' derivatives';73 FieldRequest='interp_tps'; 74 74 end 75 75 end … … 128 128 Field.VarAttribute{ivar_U}.VarIndex_tps=ivar_U_tps; 129 129 end 130 % if strcmp(FieldRequest,'derivatives')% fields will be calculated from the tps131 % Field.VarAttribute{ivar_U_tps}.FieldRequest=FieldRequest;132 % Field.VarAttribute{ivar_U_tps}.Operation=FieldNames;133 % else% fields will be calculated from the initial fields134 % Field.VarAttribute{ivar_U}.FieldRequest=FieldRequest;%135 % Field.VarAttribute{ivar_U}.Operation=FieldNames;136 % end137 130 138 131 Field.ListGlobalAttribute=[Field.ListGlobalAttribute {'NbCoord','NbDim','TimeUnit','CoordUnit'}]; … … 211 204 % units={'pixel','pixel','pixel','pixel','pixel','pixel','','','','pixel','pixel','pixel','pixel','pixel',''}; 212 205 end 213 if ~strcmp(FieldRequest,' derivatives')206 if ~strcmp(FieldRequest,'interp_tps') 214 207 var=var(:,1:9);%suppress tps if not needed 215 208 end -
trunk/src/read_field.m
r497 r516 43 43 switch FileType 44 44 case {'civx','civdata','netcdf'} %read the first nc field 45 % ParamOut.FieldName=ParamIn.FieldName;46 45 GUIName='get_field'; %default name of the GUI get_field 47 46 if isfield(ParamIn,'GUIName') … … 115 114 set(hhget_field.TimeIndexValue,'String',num2str(num)) 116 115 end 117 funct_list=get(hhget_field.ACTION,'UserData'); 118 funct_index=get(hhget_field.ACTION,'Value'); 119 funct=funct_list{funct_index};%select the current action in get_field, e;g. PLOT 120 Field=funct(hget_field); %%activate the current action selected in get_field, e;g.read the names of the variables to plot 116 % funct_list=get(hhget_field.ACTION,'UserData'); 117 % funct_index=get(hhget_field.ACTION,'Value'); 118 % funct=funct_list{funct_index};%select the current action in get_field, e;g. PLOT 119 % Field=funct(hget_field); %%activate the current action selected in get_field, e;g.read the names of the variables to plot 120 [Field,errormsg]=read_get_field(hget_field); 121 121 Tabchar={''};%default 122 122 Tabcell=[]; -
trunk/src/uvmat.m
r515 r516 2216 2216 % display the Fields menu from the input file and pick the selected one: 2217 2217 if isstruct(ParamOut) 2218 field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList);2219 set(handles.Fields,'String',ParamOut.FieldList); %update the field menu2220 set(handles.Fields,'Value',find(field_index,1))2218 field_index=strcmp(ParamOut.FieldName,ParamOut.FieldList); 2219 set(handles.Fields,'String',ParamOut.FieldList); %update the field menu 2220 set(handles.Fields,'Value',find(field_index,1)) 2221 2221 end 2222 2222
Note: See TracChangeset
for help on using the changeset viewer.