Changeset 1095 for trunk/src/series/sliding_average.m
- Timestamp:
- Mar 31, 2021, 3:32:03 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/sliding_average.m
r1094 r1095 121 121 return 122 122 end 123 [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1}); 900123 [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1}); 124 124 FileType{iview}=FileInfo{iview}.FileType; 125 125 CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images … … 137 137 if size(time,1)>1 138 138 diff_time=max(max(diff(time))); 139 if diff_time>0 series139 if diff_time>0 140 140 msgbox_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)]) 141 141 end … … 185 185 186 186 %% initialisation 187 T=24. 2; %main wave period187 T=24.4; %main wave period 188 188 t0=3; % time for motion start (torus at its maximum x) 189 189 NbPeriod=2; %number of periods for the sliding average … … 195 195 DataOut.ListGlobalAttribute= {'Conventions','Time'}; 196 196 DataOut.Conventions='uvmat'; 197 DataOut.ListVarName={'coord_y','coord_x','Umean','Vmean','Ucos','Vcos',' DUDXsin','DUDXcos','DUDYsin','DVDXsin','DVDXcos'...197 DataOut.ListVarName={'coord_y','coord_x','Umean','Vmean','Ucos','Vcos','Usin','Vsin','DUDXsin','DUDXcos','DUDYsin','DVDXsin','DVDXcos'... 198 198 ,'DVDYsin','Ustokes','Vstokes'}; 199 199 DataOut.VarDimName={'coord_y','coord_x',{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},... 200 200 {'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},... 201 {'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'} };201 {'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'}}; 202 202 203 203 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%% … … 237 237 Ucos=zeros(NpTime,npy,npx); 238 238 Vcos=zeros(NpTime,npy,npx); 239 Usin=zeros(NpTime,npy,npx); 240 Vsin=zeros(NpTime,npy,npx); 239 241 DUDXcos=zeros(NpTime,npy,npx); 240 242 DUDXsin=zeros(NpTime,npy,npx); … … 249 251 Ucos=circshift(Ucos,[-1 0 0]); %shift U by ishift along the first index 250 252 Vcos=circshift(Vcos,[-1 0 0]); %shift U by ishift along the first index 253 Usin=circshift(Usin,[-1 0 0]); %shift U by ishift along the first index 254 Vsin=circshift(Vsin,[-1 0 0]); %shift U by ishift along the first index 251 255 DUDXcos=circshift(DUDXcos,[-1 0 0]); 252 256 DUDXsin=circshift(DUDXsin,[-1 0 0]); … … 259 263 Ucos(end,:,:)=Field.U*cos(omega*Time(index)); 260 264 Vcos(end,:,:)=Field.V*cos(omega*Time(index)); 265 Usin(end,:,:)=Field.U*sin(omega*Time(index)); 266 Vsin(end,:,:)=Field.V*sin(omega*Time(index)); 261 267 DUDXcos(end,:,:)=Field.DUDX*cos(omega*Time(index)); 262 268 DUDXsin(end,:,:)=Field.DUDX*sin(omega*Time(index)); … … 269 275 DataOut.Umean=(1/Uscale)*squeeze(nanmean(Umean,1)); 270 276 DataOut.Vmean=(1/Uscale)*squeeze(nanmean(Vmean,1)); 271 DataOut.Ucos=2*squeeze(nanmean(Ucos,1)); 272 DataOut.Vcos=2*squeeze(nanmean(Vcos,1)); 277 DataOut.Ucos=2*(1/Uscale)*squeeze(nanmean(Ucos,1)); 278 DataOut.Vcos=2*(1/Uscale)*squeeze(nanmean(Vcos,1)); 279 DataOut.Usin=2*(1/Uscale)*squeeze(nanmean(Usin,1)); 280 DataOut.Vsin=2*(1/Uscale)*squeeze(nanmean(Vsin,1)); 273 281 DataOut.DUDXcos=2*squeeze(nanmean(DUDXcos,1)); 274 282 DataOut.DUDXsin=2*squeeze(nanmean(DUDXsin,1));
Note: See TracChangeset
for help on using the changeset viewer.