Ignore:
Timestamp:
Jun 16, 2020, 5:38:56 PM (4 years ago)
Author:
sommeria
Message:

rodrigues added

File:
1 edited

Legend:

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

    r1077 r1082  
    6363    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6464    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    65     ParamOut.NbSlice=1; %nbre of slices ('off' by default)
     65    ParamOut.NbSlice='on'; %nbre of slices ('on' if needed as input, fixed value e.g. 1, 'off' by default)
    6666    ParamOut.VelType='one';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    6767    ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     
    179179DataOut.ListGlobalAttribute= {'Conventions'};
    180180DataOut.Conventions= 'uvmat';
    181 DataOut.ListVarName={'coord_y', 'coord_x' ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','CurlMean','DivMean','Curl2Mean','Div2Mean','Counter'};
    182 DataOut.VarDimName={'coord_y','coord_x',{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},...
    183     {'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'},{'coord_y','coord_x'}};
     181DataOut.ListVarName={};
     182DataOut.VarDimName={};
    184183DataOut.UMean=0;
    185184DataOut.VMean=0;
     
    213212    %%%%%%%%%%%% MAIN RUNNING OPERATIONS  %%%%%%%%%%%%
    214213    if index==1 %initiate the output data structure in the first field
    215        
    216         DataOut.coord_y=Field.coord_y;
    217         DataOut.coord_x=Field.coord_x;
     214        [CellInfo,NbDim,errormsg]=find_field_cells(Field);
     215        YName='coord_y';%default
     216        XName='coord_x';%default
     217        for icell=1:numel(NbDim)
     218            if NbDim(icell)==2 && strcmp(CellInfo{icell}.CoordType,'grid')
     219                  YName=CellInfo{icell}.YName;
     220                  XName=CellInfo{icell}.XName;
     221                  break
     222            end
     223        end
     224        DataOut.ListVarName={YName, XName ,'UMean' , 'VMean','u2Mean','v2Mean','u2Mean_1','v2Mean_1','uvMean','CurlMean','DivMean','Curl2Mean','Div2Mean','Counter'};
     225        DataOut.VarDimName={YName,XName,{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},...
     226    {YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName},{YName,XName}};
     227        DataOut.(YName)=Field.(YName);
     228        DataOut.(XName)=Field.(XName);
    218229        Uprev=Field.U;% store the current field for next iteration
    219230        Vprev=Field.V;
     
    276287%     VarName=DataOut.ListVarName{ivar};% name of the variable
    277288%     DataOut.ListVarName=[DataOut.ListVarName {[VarName 'Profile']}];%append the name of the profile variable
    278 %     DataOut.VarDimName=[DataOut.VarDimName {'coord_y'}];
     289%     DataOut.VarDimName=[DataOut.VarDimName {'(YName)'}];
    279290%    DataOut.([VarName 'Profile'])=mean(DataOut.(VarName)(:,band),2); %take the mean profile of U, excluding the edges
    280291% end
     
    283294OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,first_i,last_i,first_j,last_j);
    284295 %case of netcdf input file , determine global attributes
    285  errormsg=struct2nc(OutputFile,DataOut); %save result file
    286  if isempty(errormsg)
     296errormsg=struct2nc(OutputFile,DataOut); %save result file
     297if isempty(errormsg)
    287298     disp([OutputFile ' written']);
    288  else
     299else
    289300     disp(['error in writting result file: ' errormsg])
    290  end
     301end
    291302
    292303
Note: See TracChangeset for help on using the changeset viewer.