Changeset 761 for trunk/src/series
- Timestamp:
- May 1, 2014, 8:28:05 AM (11 years ago)
- Location:
- trunk/src/series
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r758 r761 143 143 iview_image=2;%line # for the input images 144 144 case 'civxdata'% case of civx data, 145 NomTypeNc=NomTypeInput;146 ind_opening=FileInfo.CivStage;147 set(handles.Program,'Value',3) %select Cix by default148 145 msgbox_uvmat('ERROR','old civX convention, use the GUI civ') 146 return 147 otherwise 148 msgbox_uvmat('ERROR','civ_series needs images or civ data as input') 149 149 return 150 150 end -
trunk/src/series/civ_series.m
r758 r761 97 97 end 98 98 if isfield(Param,'InputTable') 99 [tild,i_series,tild,j_series]=get_file_series(Param);99 [tild,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 100 100 % iview_nc=0;% series index (iview) for an input nc file (for civ2 or patch2) 101 101 iview_A=0;% series index (iview) for the first image series … … 107 107 end 108 108 if strcmp(Param.ActionInput.ListCompareMode,'shift') 109 iview_B=iview_A+1; % the second image series is on the next line of the tinput table109 iview_B=iview_A+1; % the second image series is on the next line of the input table 110 110 end 111 111 if iview_A~=0 … … 132 132 PairCiv2=Param.ActionInput.PairIndices.ListPairCiv2; 133 133 end 134 [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=... 135 find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 136 if ~isempty(PairCiv2) 137 [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=... 138 find_pair_indices(PairCiv2,i_series{1},j_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 139 check_bounds=check_bounds | check_bounds_Civ2; 140 end 141 i1_series_Civ1=i1_series_Civ1(~check_bounds); 142 i2_series_Civ1=i2_series_Civ1(~check_bounds); 143 j1_series_Civ1=j1_series_Civ1(~check_bounds); 144 j2_series_Civ1=j2_series_Civ1(~check_bounds); 134 if iview_A==1% if Civ1 is performed 135 [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=... 136 find_pair_indices(PairCiv1,i1_series{1},j1_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 137 if ~isempty(PairCiv2) 138 [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds_Civ2]=... 139 find_pair_indices(PairCiv2,i1_series{1},j1_series{1},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 140 check_bounds=check_bounds | check_bounds_Civ2; 141 end 142 else% we start from an existing Civ1 file 143 i1_series_Civ1=i1_series{1}; 144 i2_series_Civ1=i2_series{1}; 145 j1_series_Civ1=j1_series{1}; 146 j2_series_Civ1=j2_series{1}; 147 NomTypeNc=Param.InputTable{1,4}; 148 if ~isempty(PairCiv2) 149 [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds,NomTypeNc]=... 150 find_pair_indices(PairCiv2,i1_series{2},j1_series{2},MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j); 151 % check_bounds=check_bounds | check_bounds_Civ2; 152 end 153 end 154 % i1_series_Civ1=i1_series_Civ1(~check_bounds); 155 % i2_series_Civ1=i2_series_Civ1(~check_bounds); 156 % j1_series_Civ1=j1_series_Civ1(~check_bounds); 157 % j2_series_Civ1=j2_series_Civ1(~check_bounds); 145 158 case 'displacement' 146 159 i1_series_Civ1=Param.ActionInput.OriginIndex*ones(size(i_series{1})); 147 160 i2_series_Civ1=i_series{1};i2_series_Civ2=i_series{1}; 148 161 j1_series_Civ1=ones(size(i_series{1}));% first j index is 1 149 if isempty(j _series{1})162 if isempty(j1_series_Civ1) 150 163 j2_series_Civ1=ones(size(i_series{1})); 151 164 else 152 j2_series_Civ1=j _series{1};165 j2_series_Civ1=j1_series_Civ1; 153 166 end 154 167 i1_series_Civ2=i1_series_Civ1; … … 170 183 NomTypeNc=NomType_A; 171 184 end 172 if isempty(j _series{1})185 if isempty(j1_series_Civ1) 173 186 FrameIndex_A_Civ1=i1_series_Civ1; 174 187 FrameIndex_B_Civ1=i2_series_Civ1; 188 j1_series_Civ1=ones(size(i1_series_Civ1)); 189 j2_series_Civ1=ones(size(i1_series_Civ1)); 175 190 else 176 191 FrameIndex_A_Civ1=j1_series_Civ1; … … 178 193 end 179 194 if ~isempty(PairCiv2) 180 i1_series_Civ2=i1_series_Civ2(~check_bounds);181 i2_series_Civ2=i2_series_Civ2(~check_bounds);182 j1_series_Civ2=j1_series_Civ2(~check_bounds);183 j2_series_Civ2=j2_series_Civ2(~check_bounds);184 if isempty(j _series{1})195 % i1_series_Civ2=i1_series_Civ2(~check_bounds); 196 % i2_series_Civ2=i2_series_Civ2(~check_bounds); 197 % j1_series_Civ2=j1_series_Civ2(~check_bounds); 198 % j2_series_Civ2=j2_series_Civ2(~check_bounds); 199 if isempty(j1_series_Civ2) 185 200 FrameIndex_A_Civ2=i1_series_Civ2; 186 201 FrameIndex_B_Civ2=i2_series_Civ2; … … 300 315 break 301 316 end 317 if iview_A==1% if Civ1 is performed 318 Civ1Dir=OutputDir; 319 else 320 Civ1Dir=Param.InputTable{1,2}; 321 end 302 322 if strcmp(Param.ActionInput.ListCompareMode,'PIV') 303 ncfile=fullfile_uvmat(RootPath_A, OutputDir,RootFile_A,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),...323 ncfile=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),... 304 324 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 305 325 else 306 ncfile=fullfile_uvmat(RootPath_A, OutputDir,RootFile_A,'.nc',NomTypeNc,i2_series_Civ1(ifield),[],...326 ncfile=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.nc',NomTypeNc,i2_series_Civ1(ifield),[],... 307 327 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 308 328 end … … 400 420 CivFile=Param.Patch1.CivFile; 401 421 end 402 Data=nc2struct(CivFile,'ListGlobalAttribute','absolut_time_T0'); %look for the constant 'absolut_time_T0' to detect old civx data format 403 if isfield(Data,'Txt') 404 errormsg=Data.Txt; 422 [Data,tild,tild,errormsg]=nc2struct(CivFile,'ListGlobalAttribute','absolut_time_T0'); %look for the constant 'absolut_time_T0' to detect old civx data format 423 if ~isempty(errormsg) 405 424 disp_uvmat('ERROR',errormsg,checkrun) 406 425 return … … 410 429 [Data,vardetect,ichoice]=nc2struct(CivFile);%read the variables in the netcdf file 411 430 else 412 Data=nc2struct(CivFile);%read civ1 and fix1 data in the existing netcdf file431 [Data,tild,tild,errormsg]=nc2struct(CivFile);%read civ1 and fix1 data in the existing netcdf file 413 432 end 414 433 end … … 526 545 NbSubDomain=size(Data.Civ1_SubRange,3); 527 546 % get the guess from patch1 528 for isub=1:NbSubDomain 529 nbvec_sub=Data.Civ1_NbCentres(isub); 530 ind_sel=find(GridX>=Data.Civ1_SubRange(1,1,isub) & GridX<=Data.Civ1_SubRange(1,2,isub) & GridY>=Data.Civ1_SubRange(2,1,isub) & GridY<=Data.Civ1_SubRange(2,2,isub)); 531 epoints = [GridX(ind_sel) GridY(ind_sel)];% coordinates of interpolation sites 547 for isub=1:NbSubDomain% for each sub-domain of Patch1 548 nbvec_sub=Data.Civ1_NbCentres(isub);% nbre of Civ1 vectors in the subdomain 549 ind_sel=find(par_civ2.Grid(:,1)>=Data.Civ1_SubRange(1,1,isub) & par_civ2.Grid(:,1)<=Data.Civ1_SubRange(1,2,isub) &... 550 par_civ2.Grid(:,2)>=Data.Civ1_SubRange(2,1,isub) & par_civ2.Grid(:,2)<=Data.Civ1_SubRange(2,2,isub)); 551 epoints = par_civ2.Grid(ind_sel,:);% coordinates of interpolation sites 532 552 ctrs=Data.Civ1_Coord_tps(1:nbvec_sub,:,isub) ;%(=initial points) ctrs 533 553 nbval(ind_sel)=nbval(ind_sel)+1;% records the number of values for eacn interpolation point (in case of subdomain overlap) … … 552 572 par_civ2.SearchBoxSize(2)=2*iby2+9; 553 573 par_civ2.SearchBoxShift=[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)]; 554 par_civ2.Grid=[ GridX(nbval>=1)-par_civ2.SearchBoxShift(:,1)/2 GridY(nbval>=1)-par_civ2.SearchBoxShift(:,2)/2];% grid taken at the extrapolated origin of the displacement vectors574 par_civ2.Grid=[par_civ2.Grid(nbval>=1,1)-par_civ2.SearchBoxShift(:,1)/2 par_civ2.Grid(nbval>=1,2)-par_civ2.SearchBoxShift(:,2)/2];% grid taken at the extrapolated origin of the displacement vectors 555 575 if par_civ2.CheckDeformation 556 576 par_civ2.DUDX=DUDX./nbval; -
trunk/src/series/turb_stat.m
r751 r761 184 184 U2Mean_1=0; 185 185 V2Mean_1=0; 186 checkgrid=0;% test for a structured grid for input field 186 Counter_1=0; 187 187 188 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%% 188 189 for index=1:NbField … … 201 202 Uprev=Field.U; 202 203 Vprev=Field.V; 203 end 204 FF=isnan(Field.U)|Field.U<-60|Field.U>30;% threshold on U 204 FFprev=Field.FF; 205 end 206 FF=isnan(Field.U);%|Field.U<-60|Field.U>30;% threshold on U 205 207 DataOut.Counter=DataOut.Counter+ (~FF);% add 1 to the couter for non NaN point 208 Counter_1=Counter_1+(~FF & ~FFprev); 206 209 Field.U(FF)=0;% set to 0 the nan values 207 210 Field.V(FF)=0; … … 215 218 Uprev=Field.U; %store for next iteration 216 219 Vprev=Field.V; 220 FFprev=FF; 217 221 end 218 222 %%%%%%%%%%%%%%%% end loop on field indices %%%%%%%%%%%%%%%% … … 224 228 V2Mean=V2Mean./DataOut.Counter; % normalize the mean 225 229 UVMean=UVMean./DataOut.Counter; % normalize the mean 226 U2Mean_1=U2Mean_1./ DataOut.Counter; % normalize the mean227 V2Mean_1=V2Mean_1./ DataOut.Counter; % normalize the mean230 U2Mean_1=U2Mean_1./Counter_1; % normalize the mean 231 V2Mean_1=V2Mean_1./Counter_1; % normalize the mean 228 232 DataOut.u2Mean=U2Mean-DataOut.UMean.*DataOut.UMean; % normalize the mean 229 233 DataOut.v2Mean=V2Mean-DataOut.VMean.*DataOut.VMean; % normalize the mean
Note: See TracChangeset
for help on using the changeset viewer.