Changeset 476 for trunk


Ignore:
Timestamp:
Jun 25, 2012, 10:50:51 AM (12 years ago)
Author:
sommeria
Message:

bugs corrected +
* filter parameter multiplied by 1000 in filter_tps*

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_files.m

    r475 r476  
    5454    'fileparts_uvmat';...% extracts the root name,field indexes and nomenclature type from an input filename
    5555    'fill_GUI';...% fill a GUI with handles 'handles' from input data Param
     56    'filter_tps';...% find the thin plate spline coefficients for interpolation-smoothing
    5657    'find_field_indices';...% group the variables of a nc-formated Matlab structure into 'fields' with common dimensions
    5758    'find_file_series';...%check the content of an input file and find the corresponding file series
     
    128129
    129130%% loop on the list of functions in the uvmat package
    130 
    131131icount=0;
    132132datnum=zeros(1,length(list_fct));
     
    160160        [tild,result]=system(['svn status'  dir_fct]);
    161161        svn_info.status=result;
     162        errormsg =[errormsg {['SVN revision : ' num2str(svn_info.cur_rev)]}];
    162163        if svn_info.rep_rev>svn_info.cur_rev
    163             errormsg {length(errormsg)+1}=['Repository now at revision ' num2str(svn_info.rep_rev) '. Please type svn update in uvmat folder'];
     164            errormsg =[errormsg ...
     165                {['Repository now at revision ' num2str(svn_info.rep_rev) '. Please type svn update in uvmat folder']}];
    164166        end
    165167        modifications=regexp(svn_info.status,'M\s[^(\n|\>)]+','match');
    166168        if ~isempty(modifications)
    167             for k=1:length(modifications)
    168                 errormsg {length(errormsg)+1}=modifications{k};
    169             end
     169            errormsg=[errormsg modifications];
    170170        end
     171    else
     172        errormsg=[errormsg {'SVN not available'}];
    171173    end
    172174catch ME
    173     errormsg=ME.message;
     175    errormsg=[errormsg {'SVN not available'}];
    174176end
    175177errormsg=errormsg';
  • trunk/src/civ.m

    r469 r476  
    356356    elseif ~isempty(Data.absolut_time_T0')% case of  civx data,
    357357        set(handles.Program,'Value',1) %select Cix by default
    358         ListProgram_Callback([],[], handles)
     358        Program_Callback([],[], handles)
    359359        if ~isempty(Data.fix2)
    360360            ind_opening=5;
     
    423423set(handles.RootFile,'String',RootFile)
    424424if strcmp(ExtInput,'.nc')
    425     SubDirCiv=regexprep(SubDir,[SuddirImages '^'],'');%suppress the root  SuddirImages;
     425    SubDirCiv=regexprep(SubDir,[SubdirImages '^'],'');%suppress the root  SuddirImages;
    426426else
    427427    SubDirCiv= '.civ';
     
    449449
    450450%% look for an image documentation file
    451 XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt);
     451XmlFileName=find_imadoc(RootPath,SubDir,RootFile,ImaExt);
    452452% SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.'
    453453% filexml=fullfile(RootPath,[SubDirBase '.xml']);% new convention: xml above the image dir
     
    482482    [XmlData,warntext]=imadoc2struct(XmlFileName);
    483483    nom_type_read=[];
    484     if isfield(XmlData,'Heading')&&isfield(XmlData.Heading','ImageName')&&ischar(XmlData.Heading.ImageName)% get image nom type and extension from the xml file
    485         [~,tild,tild,tild,tild,tild,tild,tild,nom_type_read]=fileparts_uvmat(XmlData.Heading.ImageName);
    486         fullname=fullfile(fileparts(RootName),XmlData.Heading.ImageName); %full name (including path) of the first image defined by the xmle file,
    487         if ~exist(fullname,'file')
    488             msgbox_uvmat('WARNING',['FirstImage ' fullname ' defined in the xml file does not exist'])
    489         end
    490     end
     484%     if isfield(XmlData,'Heading')&&isfield(XmlData.Heading','ImageName')&&ischar(XmlData.Heading.ImageName)% get image nom type and extension from the xml file
     485%         [~,tild,tild,tild,tild,tild,tild,tild,nom_type_read]=fileparts_uvmat(XmlData.Heading.ImageName);
     486%         fullname=fullfile(fileparts(RootName),XmlData.Heading.ImageName); %full name (including path) of the first image defined by the xmle file,
     487%         if ~exist(fullname,'file')
     488%             msgbox_uvmat('WARNING',['FirstImage ' fullname ' defined in the xml file does not exist'])
     489%         end
     490%     end
    491491    if isfield(XmlData,'Time') && ~isempty(XmlData.Time)
    492492        time=XmlData.Time;
     
    11831183    end
    11841184    if Param.CheckCiv2
    1185         [Param.Civ2.FileTypeA,FileInfoA_civ2,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1});
    1186         [Param.Civ2.FileTypeB,FileInfoB_civ2,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1});
     1185        [Param.Civ2.FileTypeA,ImageInfoA_civ2,Param.Civ2.ImageA]=get_file_type(filecell.ima1.civ2{1});
     1186        [Param.Civ2.FileTypeB,ImageInfoB_civ2,Param.Civ2.ImageB]=get_file_type(filecell.ima2.civ2{1});
    11871187    end
    11881188% end
     
    12061206
    12071207        if Param.CheckCiv1
    1208             % read image-dependent parameters
    1209            
     1208            % read image-dependent parameters         
    12101209            if ~checkframe% && size(time,1)>=i2_civ1(ifile) && size(time,2)>=j2_civ1(j)
    12111210                Param.Civ1.Dt=(time(i2_civ1(ifile)+1,j2_civ1(j)+1)-time(i1_civ1(ifile)+1,j1_civ1(j)+1));
     
    12201219            Param.Civ1.ImageA=filecell.ima1.civ1{ifile,j};
    12211220            Param.Civ1.ImageB=filecell.ima2.civ1{ifile,j};
    1222             Param.Civ1.ImageBitDepth=FileInfoA_civ1.BitDepth;
    1223             Param.Civ1.ImageWidth=FileInfoA_civ1.Width;
    1224             Param.Civ1.ImageHeight=FileInfoA_civ1.Height;
     1221            Param.Civ1.ImageBitDepth=ImageInfoA_civ1.BitDepth;
     1222            Param.Civ1.ImageWidth=ImageInfoA_civ1.Width;
     1223            Param.Civ1.ImageHeight=ImageInfoA_civ1.Height;
    12251224            Param.Civ1.FrameIndexA=i1_civ1(ifile);
    12261225            Param.Civ1.FrameIndexB=i2_civ1(ifile);
     
    12941293            end
    12951294
    1296             Param.Civ2.ImageBitDepth=FileInfoA_civ2.BitDepth;
    1297             Param.Civ2.ImageWidth=FileInfoA_civ2.Width;
    1298             Param.Civ2.ImageHeight=FileInfoA_civ2.Height;
     1295            Param.Civ2.ImageBitDepth=ImageInfoA_civ2.BitDepth;
     1296            Param.Civ2.ImageWidth=ImageInfoA_civ2.Width;
     1297            Param.Civ2.ImageHeight=ImageInfoA_civ2.Height;
    12991298            Param.Civ2.FrameIndexA=i1_civ2(ifile);
    13001299            Param.Civ2.FrameIndexB=i2_civ2(ifile);           
     
    14991498            else
    15001499                for p=1:length(batch_file_list)
    1501                     fid=fopen( batch_file_list{p});
     1500%                     civ_matlab([batch_file_list{p} '.xml'], [batch_file_list{p} '.nc'])
     1501                    fid=fopen(batch_file_list{p});
    15021502                    eval(fscanf(fid,'%s'));
    15031503                    fclose(fid);
  • trunk/src/fill_GUI.m

    r472 r476  
    4747                    set(hh,'String',input_data)
    4848                case{'listbox','popupmenu'}
    49                     input_data
    5049                    if isnumeric(input_data)
    5150                        input_data=num2str(input_data);
     
    5958                        iline=find(strcmp(input_data{idata},menu));
    6059                        if isempty(iline)
    61                             values(idata)=numel(menu)+1;
    62                             menu=[menu;input_data(idata)];
     60                            values(idata)=1;
     61                            menu=[input_data(idata);menu];
    6362                        else
    64                             values(idata)=iline;
     63                            values(idata)=iline(1);
    6564                        end
    6665                    end
    67                     set(hh,'String',[menu;input_data(idata)])
     66                    set(hh,'String',menu)
    6867                    set(hh,'Value',values)
    6968            end
  • trunk/src/filter_tps.m

    r389 r476  
     1%'filter_tps': find the thin plate spline coefficients for interpolation-smoothing
    12%------------------------------------------------------------------------
    2 % patch function
     3% [SubRange,NbSites,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomain,Rho,Threshold)
     4%
    35% OUTPUT:
    46% SubRange(NbCoord,NbSubdomain,2): range (min, max) of the coordiantes x and y respectively, for each subdomain
     
    1012%
    1113% INPUT:
    12 % X, Y: set of coordinates of the initial data
     14% coord=[X Y]: matrix whose first column is the x coordinates of the initial data, the second column the y coordiantes
    1315% U,V: set of velocity components of the initial data
    1416% Rho: smoothing parameter
     
    1618% Subdomain: estimated number of data points in each subdomain
    1719
    18 %function [SubRangx,SubRangy,nbpoints,FF,U_smooth,V_smooth,X_tps,Y_tps,U_tps,V_tps,Indices_tps] =filter_tps(Coord,U,V,W,SubDomain,Rho,Threshold)
    1920function [SubRange,NbSites,Coord_tps,U_tps,V_tps,W_tps,U_smooth,V_smooth,W_smooth,FF] =filter_tps(Coord,U,V,W,SubDomain,Rho,Threshold)
    2021%subdomain decomposition
    2122warning off
    22 % U=reshape(U,[],1);
    23 % V=reshape(V,[],1);
    24 % X=reshape(X,[],1);
    25 % Y=reshape(Y,[],1);
    2623nbvec=size(Coord,1);
    2724W_tps=[];%default
     
    4340CentreY=reshape(CentreY,1,[]);% Y positions of subdomain centres
    4441CentreX=reshape(CentreX,1,[]);% X positions of subdomain centres
    45 rho=Siz(1)*Siz(2)*Rho/1000000;%optimum rho increase as the area of the subdomain (division by 10^6 to reach good values with the default GUI input)
     42rho=Siz(1)*Siz(2)*Rho/1000;%optimum rho increase as the area of the subdomain (division by 10^6 to reach good values with the default GUI input)
    4643U_tps_sub=zeros(nbvec,NbSubDomain);%default spline
    4744V_tps_sub=zeros(nbvec,NbSubDomain);%default spline
  • trunk/src/series.m

    r472 r476  
    101101end
    102102if isfield(param,'FileName')
     103    InputTable={'','','','',''};
     104    set(handles.InputTable,'Data',InputTable)
    103105    if isfield(param,'FileName_1')
    104106        display_file_name(handles,param.FileName_1,0)
     
    107109        display_file_name(handles,param.FileName,0)
    108110    end
    109     InputTable={'','','','',''};
    110     set(handles.InputTable,'Data',InputTable)
    111111end 
    112112
  • trunk/src/uvmat.m

    r469 r476  
    207207guidata(hObject, handles);
    208208
    209 %% check the path and date of modification of all functions in uvmat
    210 path_to_uvmat=which ('uvmat');% check the path detected for source file uvmat
    211 [errormsg,date_str,svn_info]=check_files;%check the path of the functions called by uvmat.m
    212 date_str=['last modification: ' date_str];
    213 
    214 
    215209%% set the position of colorbar and ancillary GUIs:
    216210set(hObject,'Units','Normalized')
     
    330324    end
    331325else
    332    if ishandle(handles.UVMAT_title)
    333        set(handles.UVMAT_title,'String',...
    334            [{'Copyright  LEGI UMR 5519 /CNRS-UJF-Grenoble INP, 2010'};...
    335            {'GNU General Public License'};...
    336            {path_to_uvmat};...
    337            {date_str};...
    338            {['SVN revision : ' num2str(svn_info.cur_rev)]};...
    339            errormsg]);
    340    end
     326    %% check the path and date of modification of all functions in uvmat
     327    path_to_uvmat=which ('uvmat');% check the path detected for source file uvmat
     328    [infomsg,date_str,svn_info]=check_files;%check the path of the functions called by uvmat.m   
     329    date_str=['last modification: ' date_str];
     330    if ishandle(handles.UVMAT_title)
     331        set(handles.UVMAT_title,'String',...
     332            [{'Copyright  LEGI UMR 5519 /CNRS-UJF-Grenoble INP, 2010'};...
     333            {'GNU General Public License'};...
     334            {path_to_uvmat};...
     335            {date_str};...
     336            infomsg]);
     337    end
    341338end
    342339set(handles.uvmat,'UserData',UvData)
     
    41274124    set(handles.ViewObject,'value',1)
    41284125    ViewObject_Callback(hObject, eventdata, handles)
    4129 %     if isempty(hset_object)% open the GUI set_object with data of the currently selected object
    4130 %         ViewObject_Callback(hObject, eventdata, handles)
    4131 %         %         hset_object=findobj(allchild(0),'Tag','set_object');
    4132 %     else
    4133 %         hhset_object=guidata(hset_object);
    4134 %         set(hhset_object.PLOT,'enable','on');
    4135 %         set(get(hset_object,'children'),'enable','on')
    4136 %     end
    41374126else % desctivate object edit mode
    41384127    set(handles.edit_object,'BackgroundColor',[0.7,0.7,0.7]) 
     
    45864575set(handles.edit_object,'Value',1)
    45874576edit_Callback(hObject, eventdata, handles)
    4588 
    4589 % %------------------------------------------------------------------------
    4590 % function enable_transform(handles,state)
    4591 % %------------------------------------------------------------------------
    4592 % set(handles.transform_fct,'Visible',state)
    4593 % set(handles.TRANSFORM_txt,'Visible',state)   
    4594 % set(handles.transform_fct,'Visible',state) 
    4595 % set(handles.path_transform,'Visible',state)
    4596 % set(handles.pxcmx_txt,'Visible',state)
    4597 % set(handles.pxcmy_txt,'Visible',state)
    4598 % set(handles.pxcm,'Visible',state)
    4599 % set(handles.pycm,'Visible',state)
    46004577
    46014578%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.