Changeset 937


Ignore:
Timestamp:
Mar 30, 2016, 11:04:43 PM (8 years ago)
Author:
sommeria
Message:

various upgrades

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_object.m

    r924 r937  
    448448    switch ObjectData.Type
    449449        case 'points'
    450             hh=line(ObjectData.Coord(:,1),ObjectData.Coord(:,2),'Color',col,'LineStyle','.','Marker','+');
     450            hh=line(ObjectData.Coord(:,1),ObjectData.Coord(:,2),'Color',col,'LineStyle','none','Marker','+');
    451451            for ipt=1:length(xline)
    452452                PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',...
    453                     col,'LineStyle','.','SelectionHighlight','off','UserData',hh,'Tag','DeformPoint');
     453                    col,'LineStyle','none','SelectionHighlight','off','UserData',hh,'Tag','DeformPoint');
    454454                %create circle around each point
    455455                if ~isequal(YMax,0)
  • trunk/src/proj_field.m

    r936 r937  
    22392239                    eval(['ProjData.' VarName '=reshape(vec_B,npY,npX,nbcolor);']);
    22402240                end
    2241                 ProjData.FF=reshape(~flagin,npY,npX);%false flag A FAIRE: tenir compte d'un flga antï¿œrieur 
     2241                ProjData.FF=reshape(~flagin,npY,npX);%false flag A FAIRE: tenir compte d'un flga ant???rieur 
    22422242                ProjData.ListVarName=[ProjData.ListVarName 'FF'];
    22432243                ProjData.VarDimName=[ProjData.VarDimName {DimCell}];
  • trunk/src/series.m

    r935 r937  
    467467%% look for the previously opened file 'oldfile'
    468468InputTable=get(handles.InputTable,'Data');
    469 RootPathCell=InputTable(:,1);
    470 SubDirCell=InputTable(:,2);
     469if ~isempty(InputTable)
    471470oldfile=fullfile(InputTable{1,1},InputTable{1,2});
    472 if isempty(oldfile)
     471else
    473472    % use a file name stored in prefdir
    474473    dir_perso=prefdir;
     
    476475    if exist(profil_perso,'file')
    477476        h=load (profil_perso);
    478         if isfield(h,'RootPath') && ischar(h.RootPath)
    479             oldfile=h.RootPath;
     477        if isfield(h,'MenuCampaign') && ~isempty(h.MenuCampaign)&& ischar(h.MenuCampaign{1})
     478            oldfile=h.MenuCampaign{1};
    480479        end
    481480    end
     
    519518REFRESH_Callback(hObject, eventdata, handles)
    520519
    521 
    522 % %------------------------------------------------------------------------
    523 % % --- fct activated by the browser under 'Open campaign/Browse...'
    524 % %------------------------------------------------------------------------
    525 % function MenuBrowseCampaignAppend_Callback(hObject, eventdata, handles)
    526 % append='append';
    527 % browse_campaign(handles,append);
    528 
    529 % %------------------------------------------------------------------------
    530 % function browse_campaign(handles,append);
    531 %
    532 % %% look for the previously opened file 'oldfile'
    533 %
    534 % %
    535 % %
    536 % % InputTable=get(handles.InputTable,'Data');
    537 % % RootPath=InputTable{1,1};
    538 % % CampaignPath=fileparts(fileparts(RootPath));
    539 % % DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir');
    540 % % if ~ischar(DirFull)|| ~exist(DirFull,'dir')
    541 % %     return
    542 % % end
    543 % OutPut=browse_data(oldfile);% open the GUI browse_data to get select a campaign dir, experiment and device
    544 % if ~isfield(OutPut,'Campaign')
    545 %     return
    546 % end
    547 % DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1});
    548 % ListStruct=dir(DirName); %list files and the dir DataSeries
    549 % % select the first appropriate file in the dir
    550 % FileName='';
    551 % for ilist=1:numel(ListStruct)
    552 %     if ~isequal(ListStruct(ilist).isdir,1)%look for files, not dir
    553 %         FileName=ListStruct(ilist).name;
    554 %         FileInfo=get_file_info(fullfile(DirName,FileName));
    555 %         switch FileInfo.FileType
    556 %             case {'image','multimage','civx','civdata','netcdf'}
    557 %                 break
    558 %         end
    559 %     end
    560 % end
    561 % if isempty(FileName)
    562 %     msgbox_uvmat('ERROR',['no appropriate input file in the DataSeries folder ' fullfile(DirName)])
    563 %     return
    564 % end
    565 %
    566 % %% update the list of campaigns in the menubar
    567 % MenuCampaign=[{get(handles.MenuCampaign_1,'Label')};{get(handles.MenuCampaign_2,'Label')};...
    568 %     {get(handles.MenuCampaign_3,'Label')};{get(handles.MenuCampaign_4,'Label')};{get(handles.MenuCampaign_5,'Label')}];
    569 % check_dir=isempty(find(strcmp(DirName,MenuCampaign)));
    570 % if check_dir %insert the new campaign in the list if it is not found
    571 %     MenuCampaign(end)=[]; %suppress the last item
    572 %     MenuCampaign=[{DirName};MenuCampaign];%insert the new campaign
    573 %     for ilist=1:numel(MenuCampaign)
    574 %         set(handles.(['MenuCampaign_' num2str(ilist)]),'Label',MenuCampaign{ilist})
    575 %     end
    576 %     % save the list for future opening:
    577 %     dir_perso=prefdir;
    578 %     profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    579 %     if exist(profil_perso,'file')
    580 %         save (profil_perso,'MenuCampaign','-append'); %store the file names for future opening of uvmat
    581 %     else
    582 %         save (profil_perso,'MenuCampaign','-V6'); %store the file names for future opening of uvmat
    583 %     end
    584 % end
    585 %
    586 % %% display the selected field and related information
    587 % if get(handles.CheckAppend,'Value')
    588 %     display_file_name(handles,fullfile(DirName,FileName),'append')
    589 % else
    590 %     display_file_name(handles,fullfile(DirName,FileName),'one')
    591 % end
    592 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0])
    593 
    594520% --------------------------------------------------------------------
    595521function MenuCampaign_Callback(hObject, eventdata, handles)
    596522% --------------------------------------------------------------------
    597 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0])
     523
    598524OutPut=browse_data(get(hObject,'Label'),'on','on');% open the GUI browse_data to get select a campaign dir, experiment and device
    599525if ~isfield(OutPut,'Campaign')
     
    636562set(handles.InputTable,'Data',InputTable)
    637563REFRESH_Callback(hObject, eventdata, handles)
    638 
    639 
    640 % DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1});
    641 % hdir=dir(DirName); %list files and dirs
    642 % for ilist=1:numel(hdir)
    643 %     if ~isequal(hdir(ilist).isdir,1)%look for files, not dir
    644 %         FileName=hdir(ilist).name;
    645 %         FileInfo=get_file_info(fullfile(DirName,FileName));
    646 %         switch FileInfo.FileType
    647 %             case {'image','multimage','civx','civdata','netcdf'}
    648 %             break
    649 %         end
    650 %     end
    651 % end
    652 % if get(handles.CheckAppend,'Value')
    653 %     display_file_name(handles,fullfile(DirName,FileName),'append')
    654 % else
    655 %     display_file_name(handles,fullfile(DirName,FileName),'one')
    656 % end
    657 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0])
    658564
    659565
     
    816722
    817723%% enable other menus and uicontrols
    818 set(handles.MenuOpenCampaign,'Enable','on')
     724% set(handles.MenuOpenCampaign,'Enable','on')
    819725set(handles.MenuCampaign_1,'Enable','on')
    820726set(handles.MenuCampaign_2,'Enable','on')
     
    1006912ref_i=1;
    1007913if isfield(SeriesData,'ref_i')
    1008 ref_i=SeriesData.ref_i;
     914    ref_i=SeriesData.ref_i;
    1009915end
    1010916if isempty(first_i)
     
    1019925ref_j=1;
    1020926if isfield(SeriesData,'ref_j')
    1021 ref_j=SeriesData.ref_j;
     927    ref_j=SeriesData.ref_j;
    1022928end
    1023929if isempty(first_j)
     
    1046952    last_j=first_j;
    1047953end
    1048 set(handles.num_first_i,'String',num2str(first_i)); 
     954set(handles.num_first_i,'String',num2str(first_i));
    1049955set(handles.num_first_j,'String',num2str(first_j));
    1050 set(handles.num_last_i,'String',num2str(last_i)); 
     956set(handles.num_last_i,'String',num2str(last_i));
    1051957set(handles.num_last_j,'String',num2str(last_j));
    1052958
    1053959%% number of slices set by default
    1054 NbSlice=1;%default
     960NbSlice=[];%default
    1055961% read  value set by the first series for the append mode (iwiew >1)
    1056962if iview>1 && strcmp(get(handles.num_NbSlice,'Visible'),'on')
    1057     NbSlice=str2num(get(handles.num_NbSlice,'String'));
     963    NbSlice=str2double(get(handles.num_NbSlice,'String'));
    1058964end
    1059965
     
    1061967TimeUnit='';
    1062968% read  value set by the first series for the append mode (iwiew >1)
    1063 if iview>1 
     969if iview>1
    1064970    TimeUnit=get(handles.TimeUnit,'String');
    1065971end
     
    1078984    [XmlData,errormsg]=imadoc2struct(XmlFileName);
    1079985    if ~isempty(errormsg)
    1080          msgbox_uvmat('WARNING',['error in reading ' XmlFileName ': ' errormsg]);
     986        msgbox_uvmat('WARNING',['error in reading ' XmlFileName ': ' errormsg]);
    1081987    end
    1082988    % read time if available
    1083989    if isfield(XmlData,'Time')
    1084          Time=XmlData.Time;
     990        Time=XmlData.Time;
    1085991        TimeName='xml';
    1086992    end
    1087993    if isfield(XmlData,'Camera')
    1088         if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)
    1089             if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,XmlData.Camera.NbSlice)
    1090                 msgbox_uvmat('WARNING','inconsistent number of slices with the first field series');
    1091             end
    1092             NbSlice=XmlData.Camera.NbSlice;% Nbre of slices from camera
    1093         end
     994        %         if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)
     995        %             if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,XmlData.Camera.NbSlice)
     996        %                 msgbox_uvmat('WARNING','inconsistent number of slices with the first field series');
     997        %             end
     998        %             NbSlice=XmlData.Camera.NbSlice;% Nbre of slices from camera
     999        %         end
    10941000        if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit)
    10951001            if iview>1 && ~isempty(TimeUnit) && ~strcmp(TimeUnit,XmlData.Camera.TimeUnit)
     
    11001006    end
    11011007    % number of slices
     1008    if isfield(XmlData,'TranslationMotor')&& isfield(XmlData.TranslationMotor,'NbSlice')
     1009        NbSlice_motor=XmlData.TranslationMotor.NbSlice;
     1010        if ~isempty(NbSlice) && ~isequal(NbSlice_motor,NbSlice)
     1011                msgbox_uvmat('WARNING','inconsistent Z numbers of Z indices');
     1012        else
     1013            NbSlice=NbSlice_motor;
     1014        end
     1015    end
     1016   
    11021017    if isfield(XmlData,'GeometryCalib')
    11031018        check_calib=1;
    11041019        if isfield(XmlData.GeometryCalib,'SliceCoord')
    11051020            siz=size(XmlData.GeometryCalib.SliceCoord);
    1106             if siz(1)>1
    1107                 if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,siz(1))
    1108                     msgbox_uvmat('WARNING','inconsistent number of Z indices with the first field series');
    1109                 end
     1021            if ~isempty(NbSlice)&& ~isequal(size(1),NbSlice)
     1022                msgbox_uvmat('WARNING','inconsistent numbers of Z indices between motor and calibration');
     1023            else
    11101024                NbSlice=siz(1);
    11111025            end
    11121026        end
    11131027    end
    1114     set(handles.num_NbSlice,'String',num2str(NbSlice))
     1028end
     1029if ~isempty(NbSlice)
     1030set(handles.num_NbSlice,'String',num2str(NbSlice))
     1031set(handles.num_NbSlice,'Visible','on')
    11151032end
    11161033
     
    20131930                    '#!/bin/bash \n'...
    20141931                    '. /etc/sysprofile \n'...
     1932                    'module load matlab/8.6 \n'...% CHOICE OF MATLAB VERSION
    20151933                    'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog{iprocess} ''' <<END_MATLAB \n'...
    20161934                    'addpath(''' path_series '''); \n'...
  • trunk/src/series/merge_proj.m

    r924 r937  
    381381        end
    382382       
    383     else
    384         MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end','nb_coord','nb_dim'};
     383    else   %output as netcdf files
     384        MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end','NbCoord','NbDim'};
    385385        MergeData.Conventions='uvmat';
    386         MergeData.nb_coord=2;
    387         MergeData.nb_dim=2;
    388         dt=[];
    389         if isfield(Data{1},'dt')&& isnumeric(Data{1}.dt)
    390             dt=Data{1}.dt;
     386        MergeData.NbCoord=2;
     387        MergeData.NbDim=2;
     388        % time interval of PIV
     389        Dt=[];
     390        if isfield(Data{1},'Dt')&& isnumeric(Data{1}.Dt)
     391            Dt=Data{1}.Dt;
    391392        end
    392393        for iview =2:numel(Data)
    393             if ~(isfield(Data{iview},'dt')&& isequal(Data{iview}.dt,dt))
    394                 dt=[];%dt not the same for all fields
     394            if ~(isfield(Data{iview},'Dt')&& isequal(Data{iview}.Dt,Dt))
     395                Dt=[];%dt not the same for all fields
    395396            end
    396397        end
     
    399400            MergeData.Time=timeread;
    400401        end
    401         if ~isempty(dt)
    402             MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'dt'}];
    403             MergeData.dt=dt;
     402        % position of projection plane
     403        if isfield(Data{1},'ProjObjectCoord')&& isfield(Data{1},'ProjObjectAngle')
     404            'test'
     405            ProjObjectCoord=Data{1}.ProjObjectCoord;
     406            ProjObjectAngle=Data{1}.ProjObjectAngle;
     407            for iview =2:numel(Data)
     408                if ~(isfield(Data{iview},'ProjObjectCoord')&& isequal(Data{iview}.ProjObjectCoord,ProjObjectCoord))...
     409                        ||~(isfield(Data{iview},'ProjObjectAngle')&& isequal(Data{iview}.ProjObjectAngle,ProjObjectAngle))
     410                    ProjObjectCoord=[];%dt not the same for all fields
     411                end
     412            end
     413            if ~isempty(ProjObjectCoord)
     414                MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'ProjObjectCoord'} {'ProjObjectAngle'}];
     415                MergeData.ProjObjectCoord=ProjObjectCoord;
     416                MergeData.ProjObjectAngle=ProjObjectAngle;
     417            end
     418        end
     419        % coord unit
     420        if isfield(Data{1},'CoordUnit')
     421            CoordUnit=Data{1}.CoordUnit;
     422            for iview =2:numel(Data)
     423                if ~(isfield(Data{iview},'CoordUnit')&& isequal(Data{iview}.CoordUnit,CoordUnit))
     424                    CoordUnit=[];%CoordUnit not the same for all fields
     425                end
     426            end
     427            if ~isempty(CoordUnit)
     428                MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'CoordUnit'}];
     429                MergeData.CoordUnit=CoordUnit;
     430            end
     431        end
     432        % time unit
     433        if isfield(Data{1},'TimeUnit')
     434            TimeUnit=Data{1}.TimeUnit;
     435            for iview =2:numel(Data)
     436                if ~(isfield(Data{iview},'TimeUnit')&& isequal(Data{iview}.TimeUnit,TimeUnit))
     437                    TimeUnit=[];%TimeUnit not the same for all fields
     438                end
     439            end
     440            if ~isempty(TimeUnit)
     441                MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'TimeUnit'}];
     442                MergeData.TimeUnit=TimeUnit;
     443            end
    404444        end
    405445        error=struct2nc(OutputFile,MergeData);%save result file
  • trunk/src/uvmat.m

    r936 r937  
    12131213
    12141214%% read the content of the GUI set_slice
    1215 SliceData=read_GUI(get(hObject,'parent'));
     1215hset_slice=get(hObject, 'parent');
     1216hZ=findobj(hset_slice,'Tag','num_Z_1');
     1217Z_plane=str2num(get(hZ,'String'));% set of Z positions explicitly entered as a Matlab vector
     1218SliceData=read_GUI(hset_slice);
    12161219GeometryCalib.NbSlice=SliceData.NbSlice;
    12171220GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan;
    1218 Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice);
     1221if numel(Z_plane)<=2
     1222    Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice);
     1223else
     1224    set(hZ,'String',num2str(Z_plane))% restitute the display qfter reqding by read_GUI
     1225end
    12191226GeometryCalib.SliceCoord=Z_plane'*[0 0 1];
    12201227GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3);
Note: See TracChangeset for help on using the changeset viewer.