 Timestamp:
 Apr 1, 2016, 7:22:25 PM (7 years ago)
 Location:
 trunk/src
 Files:

 1 added
 4 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/calc_field_tps.m
r924 r938 122 122 end 123 123 for ilist=1:length(FieldName) 124 %Operator{ilist}='';%default empty operator (vec, norm,...)125 %r=regexp(FieldName{ilist},'(?<Operator>(^vec^norm^curl^div^strain))\((?<UName>.+),(?<VName>.+)\)$','names');% TODO, replace U, V126 124 switch FieldName{ilist} 127 125 case 'vec(U,V)' 128 % ListVar=[ListVar {'U', 'V'}];129 % VarAttribute{var_count+1}.Role='vector_x';130 % VarAttribute{var_count+2}.Role='vector_y';131 126 DataOut.U(ind_sel)=DataOut.U(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,1); 132 127 DataOut.V(ind_sel)=DataOut.V(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,2); 133 128 case 'U' 134 % ListVar=[ListVar {'U'}];135 % VarAttribute{var_count+1}.Role='scalar';136 129 DataOut.U(ind_sel)=DataOut.U(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,1); 137 130 case 'V' 138 % ListVar=[ListVar {'V'}];139 % VarAttribute{var_count+1}.Role='scalar';140 131 DataOut.V(ind_sel)=DataOut.V(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,2); 141 132 case 'norm(U,V)' 142 % ListVar=[ListVar {'norm'}];143 % VarAttribute{var_count+1}.Role='scalar';144 133 U=DataOut.U(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,1); 145 134 V=DataOut.V(ind_sel)+EM *FieldVar(1:nbvec_sub+3,isub,2); 146 135 DataOut.norm(ind_sel)=sqrt(U.*U+V.*V); 147 136 case 'curl(U,V)' 148 % ListVar=[ListVar {'curl'}];149 % VarAttribute{var_count+1}.Role='scalar';150 137 DataOut.curl(ind_sel)=DataOut.curl(ind_sel)EMDY *FieldVar(1:nbvec_sub+3,isub,1)+EMDX *FieldVar(1:nbvec_sub+3,isub,2); 151 138 case 'div(U,V)' 152 % ListVar=[ListVar {'div'}];153 % VarAttribute{var_count+1}.Role='scalar';154 139 DataOut.div(ind_sel)=DataOut.div(ind_sel)+EMDX*FieldVar(1:nbvec_sub+3,isub,1)+EMDY *FieldVar(1:nbvec_sub+3,isub,2); 140 % case 'curl_polar(U,V)' 141 % DataOut.curl(ind_sel)=DataOut.curl(ind_sel)+(EMDY *FieldVar(1:nbvec_sub+3,isub,1)+EMDX *(Coord_interp(ind_sel,1).*FieldVar(1:nbvec_sub+3,isub,2)))./Coord_interp(ind_sel,1); 155 142 case 'strain(U,V)' 156 % ListVar=[ListVar {'strain'}];157 % VarAttribute{var_count+1}.Role='scalar';158 143 DataOut.strain(ind_sel)=DataOut.strain(ind_sel)+EMDY*FieldVar(1:nbvec_sub+3,isub,1)+EMDX *FieldVar(1:nbvec_sub+3,isub,2); 159 144 end 160 145 end 161 146 end 162 %DataOut.FF=nbval==0; %put errorflag to 1 for points outside the interpolation rang163 147 nbval(nbval==0)=NaN;% to avoid division by zero for averaging 164 148 ListFieldOut=fieldnames(DataOut); 
trunk/src/series/civ_series.m
r932 r938 890 890 if isempty(errormsg) 891 891 disp([ncfile_out ' written']) 892 [success,msg] = fileattrib(ncfile_out ,'+w','g');% allow writing access for the group of users, recursively in the folder892 %[success,msg] = fileattrib(ncfile_out ,'+w','g');% done in struct2nc 893 893 else 894 894 disp(errormsg) 
trunk/src/series/merge_proj.m
r937 r938 252 252 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%% 253 253 tstart=tic; %used to record the computing time 254 CheckOverwrite=1;%default 255 if isfield(Param,'CheckOverwrite') 256 CheckOverwrite=Param.CheckOverwrite; 257 end 254 258 for index=1:NbField 255 259 update_waitbar(WaitbarHandle,index/NbField) … … 258 262 return 259 263 end 264 265 %% generating the name of the merged field 266 i1=i1_series{1}(index); 267 if ~isempty(i2_series{end}) 268 i2=i2_series{end}(index); 269 else 270 i2=i1; 271 end 272 j1=1; 273 j2=1; 274 if ~isempty(j1_series{1}) 275 j1=j1_series{1}(index); 276 if ~isempty(j2_series{end}) 277 j2=j2_series{end}(index); 278 else 279 j2=j1; 280 end 281 end 282 OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomTypeOut,i1,i2,j1,j2); 283 if ~CheckOverwrite && exist(OutputFile,'file') 284 disp(['existing output file ' OutputFile ' already exists, skip to next field']) 285 continue% skip iteration if the mode overwrite is desactivated and the result file already exists 286 end 287 260 288 %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%% 261 289 Data=cell(1,NbView);%initiate the set Data … … 268 296 return 269 297 end 298 270 299 ListVar=Data{iview}.ListVarName; 271 300 for ilist=1:numel(ListVar) … … 325 354 end 326 355 327 %% generating the name of the merged field 328 i1=i1_series{1}(index); 329 if ~isempty(i2_series{end}) 330 i2=i2_series{end}(index); 331 else 332 i2=i1; 333 end 334 j1=1; 335 j2=1; 336 if ~isempty(j1_series{1}) 337 j1=j1_series{1}(index); 338 if ~isempty(j2_series{end}) 339 j2=j2_series{end}(index); 340 else 341 j2=j1; 342 end 343 end 344 OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomTypeOut,i1,i2,j1,j2); 345 356 346 357 %% recording the merged field 347 358 if strcmp(FileExtOut,'.png') %output as image 
trunk/src/struct2nc.m
r930 r938 170 170 if strcmp(action,'one_input') 171 171 netcdf.close(nc) 172 [success,errormsg] = fileattrib(flname ,'+w');% allow writing access for the group of users 172 173 end 173 174
Note: See TracChangeset
for help on using the changeset viewer.