Ignore:
Timestamp:
Mar 31, 2021, 3:32:03 PM (4 years ago)
Author:
sommeria
Message:

reading mat files added, +-fixed,OpenDAP improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/sliding_average.m

    r1094 r1095  
    121121        return
    122122    end
    123     [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1});900
     123    [FileInfo{iview},MovieObject{iview}]=get_file_info(filecell{iview,1});
    124124    FileType{iview}=FileInfo{iview}.FileType;
    125125    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
     
    137137if size(time,1)>1
    138138    diff_time=max(max(diff(time)));
    139     if diff_time>0series
     139    if diff_time>0
    140140        msgbox_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)])
    141141    end   
     
    185185
    186186%% initialisation
    187 T=24.2; %main wave period
     187T=24.4; %main wave period
    188188t0=3; % time for motion start (torus at its maximum x)
    189189NbPeriod=2; %number of periods for the sliding average
     
    195195DataOut.ListGlobalAttribute= {'Conventions','Time'};
    196196DataOut.Conventions='uvmat';
    197 DataOut.ListVarName={'coord_y','coord_x','Umean','Vmean','Ucos','Vcos','DUDXsin','DUDXcos','DUDYsin','DVDXsin','DVDXcos'...
     197DataOut.ListVarName={'coord_y','coord_x','Umean','Vmean','Ucos','Vcos','Usin','Vsin','DUDXsin','DUDXcos','DUDYsin','DVDXsin','DVDXcos'...
    198198    ,'DVDYsin','Ustokes','Vstokes'};
    199199DataOut.VarDimName={'coord_y','coord_x',{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},...
    200200    {'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'}};
    202202
    203203%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
     
    237237        Ucos=zeros(NpTime,npy,npx);
    238238        Vcos=zeros(NpTime,npy,npx);
     239        Usin=zeros(NpTime,npy,npx);
     240        Vsin=zeros(NpTime,npy,npx);
    239241        DUDXcos=zeros(NpTime,npy,npx);
    240242        DUDXsin=zeros(NpTime,npy,npx);
     
    249251    Ucos=circshift(Ucos,[-1 0 0]); %shift U by ishift along the first index
    250252    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
    251255    DUDXcos=circshift(DUDXcos,[-1 0 0]);
    252256    DUDXsin=circshift(DUDXsin,[-1 0 0]);
     
    259263    Ucos(end,:,:)=Field.U*cos(omega*Time(index));
    260264    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));
    261267    DUDXcos(end,:,:)=Field.DUDX*cos(omega*Time(index));
    262268    DUDXsin(end,:,:)=Field.DUDX*sin(omega*Time(index));
     
    269275    DataOut.Umean=(1/Uscale)*squeeze(nanmean(Umean,1));
    270276    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));
    273281    DataOut.DUDXcos=2*squeeze(nanmean(DUDXcos,1));
    274282    DataOut.DUDXsin=2*squeeze(nanmean(DUDXsin,1));
Note: See TracChangeset for help on using the changeset viewer.