Changeset 498


Ignore:
Timestamp:
Jul 23, 2012, 8:44:33 PM (12 years ago)
Author:
sommeria
Message:

various bug corrections, compatibilty with older PIV data

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_files.m

    r497 r498  
    5454    'fill_GUI';...%  fill a GUI with a set of parameters from a Matlab structure
    5555    'filter_tps';...% find the thin plate spline coefficients for interpolation-smoothing
    56     'find_field_indices';...% group the variables of a nc-formated Matlab structure into 'fields' with common dimensions
     56    'find_field_indices';...% group the variables of a 'field object' into 'field cells' and specify their structure
    5757    'find_file_series';...%check the content of an input file and find the corresponding file series
     58    'find_imadoc';...% find the ImaDoc xml file associated with a given input file
    5859    'fullfile_uvmat';...%creates a file name from a root name and indices.
    5960    'geometry_calib';...%performs geometric calibration from a set of reference points
     
    8485    'read_civxdata';...reads civx data from netcdf files
    8586    'read_civdata';... reads new civ data from netcdf files
    86     'read_image';... read images or video objects
     87    'read_field';...% read the fields from files in different formats (netcdf files, images, video)
    8788    'read_get_field';... read the list of selected variables from the GUI get_field (TODO: use read_GUI)
    8889    'read_GUI';... %read a GUI and provide the data as a Matlab structure
    89     'read_image';...%read .civ files (obsolete, but can be adapted to other text documentation files)
     90    'read_image';...%read images or video objects
    9091    'read_multimadoc';... %read a set of Imadoc files and compare their timing of different file series
    9192    'read_xls';...%read excel files containing the list of the experiments
  • trunk/src/civ.m

    r495 r498  
    13181318            Param.Civ2.ImageHeight=ImageInfoA_civ2.Height;
    13191319            if strcmp(NomTypeIma,'*')
    1320                 Param.Civ2.FrameIndexA=i1_civ2(ifile,j);
    1321                 Param.Civ2.FrameIndexB=i2_civ2(ifile,j);
     1320                Param.Civ2.FrameIndexA=i1_civ2(ifile);
     1321                Param.Civ2.FrameIndexB=i2_civ2(ifile);
    13221322            else% case of movies indexed with i, the frame index is then in j
    1323                 Param.Civ2.FrameIndexA=j1_civ2(ifile,j);
    1324                 Param.Civ2.FrameIndexB=j2_civ2(ifile,j);
     1323                Param.Civ2.FrameIndexA=j1_civ2(j);
     1324                Param.Civ2.FrameIndexB=j2_civ2(j);
    13251325            end
    13261326        end
     
    15511551                                fprintf(fid,['#!/bin/bash \n' ...
    15521552                                    '/etc/sysprofile \n'...
    1553                                     'matlab -nodisplay -nosplash -nojvm <<END_MATLAB \n'...
     1553                                    'matlab -nodisplay -nosplash -nojvm -logfile  <<END_MATLAB \n'...
    15541554                                    'addpath(''' path_civ ''');\n']);
    15551555                                for p=1:length(batch_file_list)
  • trunk/src/geometry_calib.m

    r494 r498  
    113113    set(handles.ListCoord,'String',{'......'})
    114114    if exist(inputfile,'file')
    115         Heading=loadfile(handles,inputfile);% load the point coordinates existing in the xml file
     115        Heading=loadfile(handles,inputfile);% load data from the xml file
    116116        if isfield(Heading,'Campaign')&& ischar(Heading.Campaign)
    117117            struct.Campaign=Heading.Campaign;
     
    274274        GeometryCalib.RefractionIndex=str2double(answer{4});     
    275275    end
     276    UserData=get(handles.geometry_calib,'UserData');
     277    if isfield(UserData,'XmlInputFile')&&~strcmp(UserData.XmlInputFile, outputfile)&&~exist(outputfile,'file')
     278     [success,message]=copyfile(UserData.XmlInputFile,outputfile);%copy the old xml file to a new one with the new convention
     279    end
    276280    errormsg=update_imadoc(GeometryCalib,outputfile);% introduce the calibration data in the xml file
    277281    if ~strcmp(errormsg,'')
     
    290294    set(hhuvmat.CheckFixLimits,'Value',0)% put FixedLimits option to 'off'
    291295    set(hhuvmat.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7])
    292     UserData=get(handles.geometry_calib,'UserData');
     296   
    293297    UserData.XmlInputFile=outputfile;%save the current xml file name
    294298    set(handles.geometry_calib,'UserData',UserData)
     
    13701374GeometryCalib=s.GeometryCalib;
    13711375fx=1;fy=1;Cx=0;Cy=0;kc=0; %default
    1372 %     Tabchar={};
    13731376CoordCell={};
    1374 %     kc=0;%default
    1375 %     f1=1000;
    1376 %     f2=1000;
    1377 %     hhuvmat=guidata(findobj(allchild(0),'Name','uvmat'));
    1378 %     Cx=str2num(get(hhuvmat.num_Npx,'String'))/2;
    1379 %     Cy=str2num(get(hhuvmat.num_Npy,'String'))/2;
    13801377Tabchar={};%default
    13811378val_cal=1;%default
  • trunk/src/read_civxdata.m

    r472 r498  
    156156    Field.Y=Field.Y*Field.pixcmy;
    157157end
    158 if ~isequal(Field.dt,0)
    159     Field.U=Field.U*Field.dt;%translate in px displacement
    160     Field.V=Field.V*Field.dt;
     158if ~isequal(Field.Dt,0)
     159    Field.U=Field.U*Field.Dt;%translate in px displacement
     160    Field.V=Field.V*Field.Dt;
    161161    if isfield(Field,'DjUi')
    162        Field.DjUi(:,1,1)=Field.dt*Field.DjUi(:,1,1);
    163        Field.DjUi(:,2,2)=Field.dt*Field.DjUi(:,2,2);
    164        Field.DjUi(:,1,2)=(Field.pixcmy/Field.pixcmx)*Field.dt*Field.DjUi(:,1,2);
    165        Field.DjUi(:,2,1)=(Field.pixcmx/Field.pixcmy)*Field.dt*Field.DjUi(:,2,1);
     162       Field.DjUi(:,1,1)=Field.Dt*Field.DjUi(:,1,1);
     163       Field.DjUi(:,2,2)=Field.Dt*Field.DjUi(:,2,2);
     164       Field.DjUi(:,1,2)=(Field.pixcmy/Field.pixcmx)*Field.Dt*Field.DjUi(:,1,2);
     165       Field.DjUi(:,2,1)=(Field.pixcmx/Field.pixcmy)*Field.Dt*Field.DjUi(:,2,1);
    166166    end
    167167end
  • trunk/src/read_get_field.m

    r434 r498  
    179179            end
    180180            test_xdimvar=1;
    181             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
     181%             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    182182        else
    183183            SubVarAttribute{nbvar}.Role='coord_x';%abcissa with unstructured coordinates
     
    214214             end
    215215            test_ydimvar=1;
    216             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
     216%             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    217217        else
    218218            SubVarAttribute{nbvar}.Role='coord_y';%abcissa with unstructured coordinates
     
    247247                end
    248248                test_zdimvar=1;
    249                 SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
     249%                 SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    250250            else
    251251                SubVarAttribute{nbvar}.Role='coord_z';%abcissa with unstructured coordinates
     
    331331            end
    332332             test_vec_x_dimvar=1;
    333             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
     333%             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    334334        else
    335335            SubVarAttribute{nbvar}.Role='coord_x';%abcissa with unstructured coordinates
     
    364364            end
    365365             test_vec_y_dimvar=1;
    366             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
     366%             SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    367367        else
    368368            SubVarAttribute{nbvar}.Role='coord_y';%abcissa with unstructured coordinates
     
    398398                end
    399399%                 test_vec_z_dimvar=1;
    400                 SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
     400%                 SubVarAttribute{nbvar}.Role='dimvar';% dimension variable
    401401            else
    402402                SubVarAttribute{nbvar}.Role='coord_z';%abcissa with unstructured coordinates
  • trunk/src/update_imadoc.m

    r414 r498  
    1010errormsg='';
    1111testappend=0;
    12 if exist(outputfile,'file');%=1 if the output file already exists, 0 else 
     12%% backup the output file if it already exist, and read it
     13if exist(outputfile,'file');%=1 if the output file already exists, 0 else
    1314    testappend=1;
    14     t=xmltree(outputfile); %read the file
    1515    backupfile=outputfile;
    1616    testexist=2;
    1717    while testexist==2
    18        backupfile=[backupfile '~'];
    19        testexist=exist(backupfile,'file');
     18        backupfile=[backupfile '~'];
     19        testexist=exist(backupfile,'file');
    2020    end
    2121    [success,message]=copyfile(outputfile,backupfile);%make backup
    22     if success==0
    23         errormsg=message;
     22    if success~=1
     23        errormsg=['errror in xml file backup: ' message];
     24        return
    2425    end
    25     uid=find(t,'ImaDoc');
    26     if ~isequal(uid,1)
    27         return
    28     end       
    29     %if the xml file is  ImaDoc
    30     uid_calib=find(t,'ImaDoc/GeometryCalib');
    31     if isempty(uid_calib)  %if GeometryCalib does not already exists, create it
    32         [t,uid_calib]=add(t,1,'element','GeometryCalib');
    33     else %if GeometryCalib already exists, delete its content
    34         if isequal(success,1)
    35             delete(outputfile)
    36         else
    37             return
     26    t=xmltree(outputfile); %read the file
     27    title=get(t,1,'name');
     28    if strcmp(title,'ImaDoc'))
     29        testappend=1;
     30        %if the xml file is  ImaDoc
     31        uid_calib=find(t,'ImaDoc/GeometryCalib');
     32        if isempty(uid_calib)  %if GeometryCalib does not already exists, create it
     33            [t,uid_calib]=add(t,1,'element','GeometryCalib');
     34        else %if GeometryCalib already exists, delete its content
     35            uid_child=children(t,uid_calib);
     36            t=delete(t,uid_child);
    3837        end
    39         uid_child=children(t,uid_calib);
    40         t=delete(t,uid_child);
    4138    end
    4239end
    43 %create a new xml file
     40
     41%% create a new xml file
    4442if ~testappend
    4543    t=xmltree;
     
    6967    [t,uid_calib]=add(t,1,'element','GeometryCalib');
    7068end
     69
     70%% save the output file
    7171t=struct2xml(GeometryCalib,t,uid_calib);
    7272save(t,outputfile);
  • trunk/src/uvmat.m

    r497 r498  
    27432743                end
    27442744            end
    2745             if isequal(PlotType,'none')
    2746                 hget_field=findobj(allchild(0),'name','get_field');
    2747                 if isempty(hget_field)
    2748                     get_field(FileName)% the projected field cannot be automatically plotted: use get_field to specify the variablesdelete(hget_field)
    2749                 end
    2750                 errormsg='The field defined by get_field cannot be plotted';
    2751                 return
    2752             end
     2745%             if isequal(PlotType,'none')
     2746%                 hget_field=findobj(allchild(0),'name','get_field');
     2747%                 if isempty(hget_field)
     2748%                     get_field(FileName)% the projected field cannot be automatically plotted: use get_field to specify the variablesdelete(hget_field)
     2749%                 end
     2750%                 errormsg='The field defined by get_field cannot be plotted';
     2751%                 return
     2752%             end
    27532753        end
    27542754    end
Note: See TracChangeset for help on using the changeset viewer.