Home > . > check_functions.m

# check_functions

## PURPOSE

'check_functions': check the path and modification date for all the

## SYNOPSIS

function [errormsg,date_str]=check_functions

## DESCRIPTION

    'check_functions': check the path and modification date for all the
      function in the toolbox UVMAT. Called at the opening of uvmat.fig
    ----------------------------------------------------------------------
     function [errormsg,date_str]=check_functions

     OUTPUT:
     errormsg: error message listing functions whose paths are not in the directory of uvmat.m
     date_str: date of the most recent modification of a file in the toolbox

    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
      Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
         This file is part of the toolbox UVMAT.

         UVMAT is free software; you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
         the Free Software Foundation; either version 2 of the License, or
         (at your option) any later version.

         UVMAT is distributed in the hope that it will be useful,
         but WITHOUT ANY WARRANTY; without even the implied warranty of
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
         GNU General Public License (file UVMAT/COPYING.txt) for more details.
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- get_field 'get_field': display variables and attributes from a Netcdf file, and plot selected fields
- series 'series': master function associated to the GUI series.m for analysis field series
- uvmat 'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization

## SOURCE CODE

    0001 %'check_functions': check the path and modification date for all the
    0002 %  function in the toolbox UVMAT. Called at the opening of uvmat.fig
    0003 %----------------------------------------------------------------------
    0004 % function [errormsg,date_str]=check_functions
    0005 %
    0006 % OUTPUT:
    0007 % errormsg: error message listing functions whose paths are not in the directory of uvmat.m
    0008 % date_str: date of the most recent modification of a file in the toolbox
    0009 %
    0010 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    0011 %  Copyright Joel Sommeria, 2008, LEGI / CNRS-UJF-INPG, sommeria@coriolis-legi.org.
    0012 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    0013 %     This file is part of the toolbox UVMAT.
    0014 %
    0015 %     UVMAT is free software; you can redistribute it and/or modify
    0016 %     it under the terms of the GNU General Public License as published by
    0017 %     the Free Software Foundation; either version 2 of the License, or
    0018 %     (at your option) any later version.
    0019 %
    0020 %     UVMAT is distributed in the hope that it will be useful,
    0021 %     but WITHOUT ANY WARRANTY; without even the implied warranty of
    0022 %     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    0023 %     GNU General Public License (file UVMAT/COPYING.txt) for more details.
    0024 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    0025
    0026 function [errormsg,date_str]=check_functions
    0027 errormsg={};%default
    0028 list_fct={'calc_field';...% defines fields (velocity, vort, div...) from civx data and calculate them
    0029           'cell2tab';... %transform a Matlab cell in a character array suitable for display in a table
    0030           'check_functions';...
    0031           'civ';...   %function associated with the interface 'civ.fig' for PIV and spline interpolation
    0032           'civ.fig';...
    0033           'civ_3D';... function associated with the interface 'civ_3D.fig' for PIV in volume (in progress)
    0034           'civ_3D.fig';...
    0035           'close_fig';...% function  activated when a figure is closed
    0036           'copyfields';...%copy fields between two matlab structures
    0037           'delete_object';...%delete a projection object, defined by its index in the Uvmat list or by its graphic handle
    0038           'editxml';...%display and edit xml files using a xls schema
    0039           'editxml.fig';...%interface for editxml
    0040           'find_field_indices';...% group the variables of a nc-formated Matlab structure into 'fields' with common dimensions
    0041           'geometry_calib';...%performs geometric calibration from a set of reference points
    0042           'geometry_calib.fig';...%interface for geometry_calib
    0043           'get_field';...% choose and plot a field from a Netcdf file
    0044           'get_field.fig';...%interface for get_field
    0045           'get_plot_handles';... %provides handles of elements setting the plotting parameters in the uvmat interface
    0046           'griddata_uvmat';...%make 2D linear interpolation using griddata, with input appropriate for both Matlab 6.5 and 7
    0047           'hist_update';...%  update of a current global histogram by inclusion of a new field
    0048           'imadoc2struct';...%convert the image documentation file ImaDoc into a Matlab structure
    0049           'keyboard_callback';... % function activated when a key is pressed on the keyboard
    0050           'ListDir';... scan the structure of the directory tree (for dataview.m)
    0051           'mouse_down';% function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn')
    0052           'mouse_motion';...% permanently called by mouse motion over a figure (callback for 'WindowButtonMotionFcn')
    0053           'mouse_up';... % function to be activated when the mouse button is released (callback for 'WindowButtonUpFcn')
    0054           'msgbox_uvmat';... associated with GUI msgbox_uvmat.fig to display message boxes, for error, warning or input calls
    0055           'msgbox_uvmat.fig';...
    0056           'name2display';...% extracts the root name and field numbers from an input filename
    0057           'name_generator';...%creates a file name from a root name and indices.
    0058           'nc2struct';...% transform a netcdf file in a corresponding matlab structure
    0059           'peaklock';...%
    0060           'phys';...% transforms fields from image (px) to real world (phys) coordinates using geometric calibration parameters
    0061           'phys_polar';... transform image coordinates (px) to physical ploar coordinates
    0062           'phys_XYZ';...%transforms image (px) to real world (phys) coordinates using geometric calibration parameters
    0063           'px';...% transform fields from physical to px coordinates using geometrical calibration parameters
    0064           'px_XYZ';...% ransform physical to px coordinates using geometrical calibration parameters
    0065           'plot_field';...%displays a vector field and/or scalar or images
    0066           'plot_object';...%draws a projection object (points, line, plane...)
    0067           'proj_field';...%project a field on a projection object (plane, line,...)
    0068           'read_civxdata';...reads civx data from netcdf files
    0069           'read_imatext';...%read .civ files (obsolete, but can be adapted to other text documentation files)
    0070            'read_plot_param';... %read the plotting option parameters on the uvmat interface
    0071            'read_set_object';...%read the data on the set_object interface
    0072            'read_xls';...%read excel files containing the list of the experiments
    0073            'reinit';...% suppress the personal parameter file 'uvmat_perso.mat'
    0074            'RUN_FIX';...% fix velocity fields
    0075            'RUN_STLIN';...% combine 2 displacement fields for stereo PIV
    0076            'series';...% master function for analysis field series, with interface 'series.fig'
    0077            'series.fig';...% interface for 'series'
    0078            'set_col_vec';...
    0079            'set_grid';...% creates a grid for PIV
    0080            'set_grid.fig';...% interface for set_grid
    0081            'set_object.m';...%  edit a projection object
    0082            'set_object.fig';...% interface for set_object
    0083            'sub_field';...% combine the two input fields,
    0084            'struct2nc';...% %write fields in netcdf files
    0085            'uvmat';...% master function for file scanning and visualisation of 2D fields
    0086            'uvmat.fig';...  %interface for uvmat
    0087            'update_obj';... update the object representation graph and its projection field, record it in the uvmat interface
    0088            'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series'
    0089            'warndlg_uvmat';...% display messages (error, warning, confirmation) , OBSOLETE, use msgbox_uvmat
    0090             'write_plot_param'};%update plotting parameters after plot
    0091  dir_fct=which('uvmat');% path to uvmat
    0092 [pathuvmat,name,ext]=fileparts(dir_fct);
    0093 icount=0;
    0094 % loop on the list of functions in the uvmat package
    0095  for i=1:length(list_fct)
    0096     dir_fct=which(list_fct{i});% path to fct
    0097     if isempty(dir_fct)
    0098         icount=icount+1;
    0099         errormsg{icount}=[list_fct{i} ' not found'];% test for function not found
    0100     else
    0101        [pth,name,ext]=fileparts(dir_fct);
    0102        if ~isequal(pathuvmat,pth)
    0103            icount=icount+1;
    0104            errormsg{icount}=[dir_fct ' overrides the package UVMAT'];% bad path for the function
    0105        end
    0106        datfile=dir(dir_fct);
    0107        date_str=datfile.date;%string of the date of last modification
    0108        datnum(i)=0;%default
    0109        char_code=double(date_str);% code of the date characters
    0110        special_char=(char_code>127); %non standard Ascii character (e.g. date in french)
    0111        if isempty(find(special_char))% standard Ascii character
    0112           datnum(i)=datenum(date_str);
    0113        end
    0114    end
    0115 end
    0116 errormsg=errormsg';
    0117 date_str=datestr(max(datnum));