Changeset 591 for trunk/src/civ_matlab.m


Ignore:
Timestamp:
Mar 25, 2013, 5:43:18 PM (11 years ago)
Author:
sommeria
Message:

various updates, in particular modification of series to do calculations in the cluster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ_matlab.m

    r582 r591  
    8585    end
    8686   
    87     % caluclate velocity data (y and v in indices, reverse to y component)
    88     [xtable ytable utable vtable ctable F result_conv errormsg] = civ (par_civ1);
    89     if ~isempty(errormsg)
    90         return
    91     end
    9287    list_param=(fieldnames(Param.Civ1))';
    9388    Civ1_param=list_param;%default
     89   
    9490    %set the values of all the global attributes in list_param
     91    Data.ListGlobalAttribute=[Data.ListGlobalAttribute Civ1_param];
    9592    for ilist=1:length(list_param)
    9693        Civ1_param{ilist}=['Civ1_' list_param{ilist}];
    9794        Data.(['Civ1_' list_param{ilist}])=Param.Civ1.(list_param{ilist});
    9895    end
    99     Data.ListGlobalAttribute=[Data.ListGlobalAttribute Civ1_param];% {'Civ1_Time','Civ1_Dt'}];
     96    Data.CivStage=1;
     97   
     98    % set the list of variables
    10099    Data.ListVarName={'Civ1_X','Civ1_Y','Civ1_U','Civ1_V','Civ1_F','Civ1_C'};%  cell array containing the names of the fields to record
    101100    Data.VarDimName={'nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1','nb_vec_1'};
     
    105104    Data.VarAttribute{4}.Role='vector_y';
    106105    Data.VarAttribute{5}.Role='warnflag';
    107     Data.Civ1_X=reshape(xtable,[],1);
    108     Data.Civ1_Y=reshape(Param.Civ1.ImageHeight-ytable+1,[],1);
    109     Data.Civ1_U=reshape(utable,[],1);
    110     Data.Civ1_V=reshape(-vtable,[],1);
    111     Data.Civ1_C=reshape(ctable,[],1);
    112     Data.Civ1_F=reshape(F,[],1);
    113     Data.CivStage=1;
     106   
     107    if 'PIV volume'
     108        Data.ListVarName=[Data.ListVarName 'Civ1_Z'];
     109        Data.Civ1_X=[];Data.Civ1_Y=[];Data.Civ1_Z=[];
     110        Data.Civ1_U=[];Data.Civ1_V=[];Data.Civ1_C=[];Data.Civ1_F=[];
     111        for ivol=1:NbSlice
     112            % caluclate velocity data (y and v in indices, reverse to y component)
     113            [xtable ytable utable vtable ctable F result_conv errormsg] = civ (par_civ1);
     114            if ~isempty(errormsg)
     115                return
     116            end
     117            Data.Civ1_X=[Data.Civ1_X reshape(xtable,[],1)];
     118            Data.Civ1_Y=[Data.Civ1_Y reshape(Param.Civ1.ImageHeight-ytable+1,[],1)];
     119            Data.Civ1_Z=[Data.Civ1_Z ivol*ones(numel(xtable),1)];% z=image index in image coordinates
     120            Data.Civ1_U=[Data.Civ1_U reshape(utable,[],1)];
     121            Data.Civ1_V=[Data.Civ1_V reshape(-vtable,[],1)];
     122            Data.Civ1_C=[Data.Civ1_C reshape(ctable,[],1)];
     123            Data.Civ1_F=[Data.Civ1_C reshape(F,[],1)];
     124        end
     125    else %usual PIV
     126        % caluclate velocity data (y and v in indices, reverse to y component)
     127        [xtable ytable utable vtable ctable F result_conv errormsg] = civ (par_civ1);
     128        if ~isempty(errormsg)
     129            return
     130        end
     131        Data.Civ1_X=reshape(xtable,[],1);
     132        Data.Civ1_Y=reshape(Param.Civ1.ImageHeight-ytable+1,[],1);
     133        Data.Civ1_U=reshape(utable,[],1);
     134        Data.Civ1_V=reshape(-vtable,[],1);
     135        Data.Civ1_C=reshape(ctable,[],1);
     136        Data.Civ1_F=reshape(F,[],1);
     137    end
    114138else
    115139    if exist('ncfile','var')
Note: See TracChangeset for help on using the changeset viewer.