Changeset 1010 for trunk


Ignore:
Timestamp:
Sep 22, 2017, 12:33:16 PM (7 years ago)
Author:
sommeria
Message:

multimask introduced

Location:
trunk/src
Files:
1 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r977 r1010  
    1 %'civ': function associated with the interface 'civ.fig' for PIV, spline interpolation and stereo PIV (patch)
     1%'civ': function associated with the interface 'civ.fig' for PIV, spline interpolation and stereo PIV (patch). OBSOLETE: REPLACED BY civ_series
    22%------------------------------------------------------------------------
    33%  provides an interface for the software menucivx
    44% function varargout = civ(varargin)
    55% provides an interface for the software menucivx
     6% OBSOLETE: REPLACED BY civ_series
    67
    78%=======================================================================
  • trunk/src/series.m

    r1009 r1010  
    20452045        WallTimeOneJob=min(4*JobTime+10,WallTimeTotal*60/2); % estimated max time of an individual job for checkpoint
    20462046        disp(['WallTimeOneJob: ' num2str(WallTimeOneJob) ' minutes'])
     2047        if NbProcess>=8
     2048            bigiojob_string=['+{type = ' char(39) 'bigiojob' char(39) '}/licence=1'];% char(39) is quote - bigiojob limit UVmat parallel launch on cluster to avoid saturation of disk access to data
     2049        else
     2050            bigiojob_string='';
     2051        end
    20472052        oar_command=['oarsub -n UVmat_' ActionFullName ' '...
    20482053            '-t idempotent --checkpoint ' num2str(WallTimeOneJob*60) ' '...
    20492054            '-l "/core=' num2str(NbCore)...
    2050             '+{type = ' char(39) 'bigiojob' char(39) '}/licence=1'... % char(39) is quote - bigiojob limit UVmat parallel launch on cluster
     2055            bigiojob_string... % char(39) is quote - bigiojob limit UVmat parallel launch on cluster
    20512056            ',walltime=' datestr(WallTimeTotal/24,13) '" '...
    20522057            '-E ' filename_errors ' '...
  • trunk/src/series/civ_input.m

    r1007 r1010  
    15161516hchildren=get(hparent,'children');
    15171517handle_txtbox=findobj(hchildren,'tag','Mask');% look for the mask name box in the same panel
    1518 
     1518handle_NbSlice=findobj(hchildren,'tag','num_NbSlice');% look for the mask name box in the same panel
    15191519testmask=0;
    15201520if value
     
    15261526        ind_A=2;
    15271527    end
    1528     [nbslice, flag_mask]=get_mask(InputTable{ind_A,1},handles);% look for a mask with appropriate name
    1529     if isequal(flag_mask,1)
    1530         filemask=[num2str(nbslice) 'mask'];
    1531         testmask=1;
    1532     else % browse for a mask
     1528%     [nbslice, flag_mask]=get_mask(InputTable{ind_A,1},handles);% look for a mask with appropriate name
     1529%     if isequal(flag_mask,1)
     1530%         filemask=[num2str(nbslice) 'mask'];
     1531%         testmask=1;
     1532%     else % browse for a mask
    15331533        filemask= uigetfile_uvmat('pick a mask image file:',InputTable{ind_A,1},'image');
     1534        [FilePath,FileName,Ext]=fileparts(filemask);   
     1535        [RootPath,SubDir,RootFile,i1_series,i2,j1,j2,NomType]=find_file_series(FilePath,[FileName,Ext]);
     1536        if strcmp(NomType,'_1')
     1537           NbSlice=i1_series(1,2,end);
     1538           set(handle_NbSlice,'String',num2str(NbSlice))
     1539        end
    15341540        set(hObject,'UserData',filemask);%store for future use
    15351541        if ~isempty(filemask)
    15361542            testmask=1;
    1537         end
    1538     end
     1543         end
     1544%     end
    15391545end
    15401546if testmask
     
    15421548    set(handles.Mask,'String',filemask)
    15431549    set(handles.CheckMask,'Value',1)
     1550    if strcmp(NomType,'_1')
     1551        set(handles.num_NbSlice,'Visible','on')
     1552    end
    15441553else
    15451554    set(hObject,'Value',0);
    15461555    set(handle_txtbox,'Visible','off')
     1556    set(handles.num_NbSlice,'Visible','off')
    15471557end
    15481558set(handles.ConfigSource,'String','NEW')
     
    23752385    drawnow
    23762386end
     2387
     2388
     2389
     2390function num_NbSlice_Callback(hObject, eventdata, handles)
     2391% hObject    handle to num_NbSlice (see GCBO)
     2392% eventdata  reserved - to be defined in a future version of MATLAB
     2393% handles    structure with handles and user data (see GUIDATA)
     2394
     2395% Hints: get(hObject,'String') returns contents of num_NbSlice as text
     2396%        str2double(get(hObject,'String')) returns contents of num_NbSlice as a double
     2397
     2398
     2399% --- Executes during object creation, after setting all properties.
     2400function num_NbSlice_CreateFcn(hObject, eventdata, handles)
     2401% hObject    handle to num_NbSlice (see GCBO)
     2402% eventdata  reserved - to be defined in a future version of MATLAB
     2403% handles    empty - handles not created until after all CreateFcns called
     2404
     2405% Hint: edit controls usually have a white background on Windows.
     2406%       See ISPC and COMPUTER.
     2407if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
     2408    set(hObject,'BackgroundColor','white');
     2409end
  • trunk/src/series/civ_series.m

    r1007 r1010  
    276276
    277277%%%%% MAIN LOOP %%%%%%
    278 maskname='';% initiate the mask name
     278maskoldname='';% initiate the mask name
    279279FileType_A='';
    280280FileType_B='';
     
    440440        Data.VarAttribute{4}.Role='vector_y';
    441441        Data.VarAttribute{5}.Role='warnflag';
     442        % case of mask
    442443        if par_civ1.CheckMask&&~isempty(par_civ1.Mask)
    443             if strcmp(maskname,par_civ1.Mask)% mask exist, not already read in civ1
     444            if isfield(par_civ1,'NbSlice')
     445                [RootPath_mask,SubDir_mask,RootFile_mask,i1_mask,i2_mask,j1_mask,j2_mask,Ext_mask]=fileparts_uvmat(Param.ActionInput.Civ1.Mask);
     446                i1_mask=mod(i1-1,par_civ1.NbSlice)+1;
     447                maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',i1_mask);
     448            else
     449                maskname=Param.ActionInput.Civ1.Mask;
     450            end
     451            if strcmp(maskoldname,maskname)% mask exist, not already read in civ1
    444452                par_civ1.Mask=mask; %use mask already opened
    445453            else
    446454                try
    447                     par_civ1.Mask=imread(par_civ1.Mask);%update the mask, an store it for future use
     455                    par_civ1.Mask=imread(maskname);%update the mask, an store it for future use
    448456                catch ME
    449457                    if ~isempty(ME.message)
     
    454462                end
    455463                mask=par_civ1.Mask;
    456                 maskname=par_civ1.Mask;
     464                maskoldname=maskname;
    457465            end
    458466        end
     
    704712            end
    705713        end
    706         if par_civ2.CheckMask&&~isempty(par_civ2.Mask)
    707             if strcmp(maskname,par_civ2.Mask)% mask exist, not already read in civ1
     714        if par_civ2.CheckMask&&~isempty(par_civ2.Mask)       
     715            if isfield(par_civ2,'NbSlice')
     716                [RootPath_mask,SubDir_mask,RootFile_mask,i1_mask,i2_mask,j1_mask,j2_mask,Ext_mask]=fileparts_uvmat(Param.ActionInput.Civ2.Mask);
     717                i1_mask=mod(i1-1,par_civ2.NbSlice)+1;
     718                maskname=fullfile_uvmat(RootPath_mask,SubDir_mask,RootFile_mask,Ext_mask,'_1',i1_mask);
     719            else
     720                maskname=Param.ActionInput.Civ2.Mask;
     721            end
     722            if strcmp(maskoldname,maskname)% mask exist, not already read in civ1
    708723                par_civ2.Mask=mask; %use mask already opened
    709724            else
    710                 par_civ2.Mask=imread(par_civ2.Mask);%update the mask, and store it for future use
     725                try
     726                    par_civ2.Mask=imread(maskname);%update the mask, an store it for future use
     727                catch ME
     728                    if ~isempty(ME.message)
     729                        errormsg=['error reading input image: ' ME.message];
     730                        disp_uvmat('ERROR',errormsg,checkrun)
     731                        return
     732                    end
     733                end
    711734                mask=par_civ2.Mask;
    712                 maskname=par_civ2.Mask;
    713             end
    714         end
     735                maskoldname=maskname;
     736            end
     737        end
     738
    715739        if CheckInputFile % else Dt given by par_civ2
    716740            if strcmp(Param.ActionInput.ListCompareMode,'displacement')
  • trunk/src/transform_field/signal_spectrum.m

    r977 r1010  
    11% 'signal_spectrum': calculate and display power spectrum of the current field
    22%  operate on a 1D signal or the first dimension of a higher dimensional matrix (then average over other dimensions)
    3 %  this function aplies the Welch method and call the function of the matlab signal processing toolbox
     3%  this function aplies the Welch method and calls the function  of the matlab signal processing toolbox
     4%  it calculates also the cospectrum with the signal shifted by one
     5%  index, to remove noise effects assumed uncorrelated from one iteration to
     6%  the next.
    47%
    58% OUTPUT:
     
    9194        yindex=DataOut.TransformInput.IndexRange(2,:);
    9295        y=Data.(YName)(yindex);
     96        if size(DataOut.TransformInput.IndexRange,1)>=3
    9397        xindex=DataOut.TransformInput.IndexRange(3,:);
     98        else
     99            xindex=DataOut.TransformInput.IndexRange(2,:);
     100        end
    94101        x=Data.(XName)(xindex);
    95102        haxes=findobj(huvmat,'Tag','PlotAxes');
  • trunk/src/uvmat.m

    r1009 r1010  
    56785678%------------------------------------------------------------------------
    56795679check_view=get(handles.CheckViewObject,'Value');
    5680 
     5680    hset_object=findobj(allchild(0),'tag','set_object');
     5681    if ~isempty(hset_object)
     5682        delete(hset_object)% delete existing version of set_object
     5683    end
    56815684if check_view %activate set_object
    56825685    IndexObj=get(handles.ListObject,'Value');
     
    57135716    end
    57145717else
    5715     hset_object=findobj(allchild(0),'tag','set_object');
    5716     if ~isempty(hset_object)
    5717         delete(hset_object)% delete existing version of set_object
    5718     end
     5718%     hset_object=findobj(allchild(0),'tag','set_object');
     5719%     if ~isempty(hset_object)
     5720%         delete(hset_object)% delete existing version of set_object
     5721%     end
    57195722end
    57205723
Note: See TracChangeset for help on using the changeset viewer.