Changeset 589


Ignore:
Timestamp:
Mar 16, 2013, 3:46:12 PM (11 years ago)
Author:
sommeria
Message:

various minor corrections made

Location:
trunk/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/browse_data.m

    r581 r589  
    169169
    170170
    171 %------------------------------------------------------------------------
    172 function MirrorDir_Callback(hObject, eventdata, handles)
    173 %------------------------------------------------------------------------   
    174 MirrorDir=get(handles.MirrorDir,'String');
    175 [tild,MirrorName]=fileparts(MirrorDir);
    176 s=xml2struct(fullfile(MirrorDir,[MirrorName '.xml']));
    177 set(handles.SourceDir,'String',s.SourceDir)
    178 SourceDir_Callback([],[], handles)
     171% %------------------------------------------------------------------------
     172% function MirrorDir_Callback(hObject, eventdata, handles)
     173% %------------------------------------------------------------------------   
     174% MirrorDir=get(handles.MirrorDir,'String');
     175% [tild,MirrorName]=fileparts(MirrorDir);
     176% s=xml2struct(fullfile(MirrorDir,[MirrorName '.xml']));
     177% set(handles.SourceDir,'String',s.SourceDir)
     178% SourceDir_Callback([],[], handles)
    179179
    180180
     
    212212 function ListExperiments_Callback(hObject, eventdata, handles)
    213213%------------------------------------------------------------------------
     214MirrorPath='';
     215CampaignPath=get(handles.SourceDir,'String');
    214216if strcmp(get(handles.MirrorDir,'Visible'),'on')
    215     CampaignPath=get(handles.MirrorDir,'String');
    216 else
    217     CampaignPath=get(handles.SourceDir,'String');
     217%     CampaignPath=get(handles.MirrorDir,'String');
     218    MirrorPath=get(handles.MirrorDir,'String');
     219else
     220%     CampaignPath=get(handles.SourceDir,'String');
    218221end
    219222% MirrorPath=get(handles.MirrorDir,'String');
     
    228231    testList=0;
    229232end
    230 scan_experiments(handles,ListExperiments,CampaignPath)
     233scan_experiments(handles,ListExperiments,CampaignPath,MirrorPath)
    231234
    232235
     
    242245        if ~isequal(hdir(ilist).name(1),'.')
    243246            DataSeries=fullfile(CampaignPath,ListExperiments{iexp},hdir(ilist).name);
    244             if exist('MirrorPath','var')
     247            if ~isempty(MirrorPath)
    245248                mirror=fullfile(MirrorPath,ListExperiments{iexp},hdir(ilist).name);
    246249                if ~exist(mirror)% create mirror if needed
    247                     system(['ln -s ' source ' ' mirror])
     250                    system(['ln -s ' DataSeries ' ' mirror])
    248251                end
    249252            end
  • trunk/src/check_files.m

    r588 r589  
    3232svn_info.status=[];
    3333list_fct={...
    34     'xmltree';...%function for editing xml files (toolbox outside uvmat)
    3534    'browse_data';...% function for scanning directories in a project/campaign
    3635    'browse_data.fig';...% GUI corresponding to dataview
     
    8584    'read_civdata';... reads new civ data from netcdf files
    8685    'read_field';...% read the fields from files in different formats (netcdf files, images, video)
    87 %     'read_get_field';... read the list of selected variables from the GUI get_field (TODO: use read_GUI)
    8886    'read_GUI';... %read a GUI and provide the data as a Matlab structure
    8987    'read_image';...%read images or video objects
     
    133131%% loop on the list of functions in the uvmat package
    134132icount=0;
     133if ~exist('@xmltree','dir')
     134    icount=icount+1;
     135    checkmsg{icount}='ERROR installation: toolbox xmltree missing';
     136end
    135137datnum=zeros(1,length(list_fct));
    136138for i=1:length(list_fct)
  • trunk/src/civ.m

    r582 r589  
    527527%show the reference image edit box if relevant (not needed for movies or in the absence of time information
    528528if numel(time)>=2 % if there are at least two time values to define dt
     529    if size(time,1)<MaxIndex_i;
     530        msgbox_uvmat('WARNING','maximum i index restricted by the timing of the xml file');
     531    elseif size(time,2)<MaxIndex_j
     532        msgbox_uvmat('WARNING','maximum j index restricted by the timing of the xml file');
     533    end
    529534    MaxIndex_i=min(size(time,1),MaxIndex_i);%possibly adjust the max index according to time data
    530535    MaxIndex_j=min(size(time,2),MaxIndex_j);
  • trunk/src/compile_functions.m

    r507 r589  
    66display('compiling civ_matlab...')
    77% commands to compile civ_matlab and eventually other functions
     8if ~exist('bin','dir')
     9    [success,errormsg]=mkdir('bin');
     10    if success~=1
     11        display(errormsg)
     12    end
     13end
    814mcc -m -R -nojvm -R -nodisplay civ_matlab.m
    915system('mv -f civ_matlab bin/');
  • trunk/src/fullfile_uvmat.m

    r372 r589  
    120120%     filename=fullfile(RootPath,RootFile);
    121121% end
    122 filename=[filename sep1 i1_str sep2 i2_str sep3 j1_str sep4 j2_str FileExt];
    123 
     122filename=[filename sep1 i1_str sep2 i2_str sep3 j1_str sep4 j2_str];
     123filename=[regexprep(filename,'_$','') FileExt];%suppress possible '_' at the end of the string and add the extension
    124124
    125125
  • trunk/src/proj_field.m

    r586 r589  
    621621                flagsel=ones(size(coord_x));
    622622            end
    623             if isequal(ProjMode,'projection') || isequal(ProjMode,'interp_tps')
     623            if isequal(ProjMode,'projection') %|| isequal(ProjMode,'interp_tps')
    624624                flagsel=flagsel & ((coord_y -yinf(ip))*(xinf(ip+1)-xinf(ip))>(coord_x-xinf(ip))*(yinf(ip+1)-yinf(ip))) ...
    625625                & ((coord_y -ysup(ip))*(xsup(ip+1)-xsup(ip))<(coord_x-xsup(ip))*(ysup(ip+1)-ysup(ip))) ...
     
    633633            for iselect=1:numel(VarIndex)-2*testU
    634634                VarName=FieldData.ListVarName{VarIndex(iselect)};
    635                 eval(['ProjVar{iselect}=FieldData.' VarName '(indsel);']);%scalar value
     635                ProjVar{iselect}=FieldData.(VarName)(indsel);%scalar value
    636636            end   
    637637            if testU
     
    11851185                        FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_warnflag});
    11861186                    end
     1187                    % interpolate and calculate field on the grid
    11871188                    [VarVal,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldData,CellInfo{icell}.FieldName,XI,YI);
     1189                   
    11881190                    if isfield(CellInfo{icell},'CheckSub') && CellInfo{icell}.CheckSub && ~isempty(vector_x_proj)
    11891191                        ProjData.(ProjData.ListVarName{vector_x_proj})=ProjData.(ProjData.ListVarName{vector_x_proj})-VarVal{1};
     
    18331835                        eval(['FieldData.' VarName '=FieldData.' VarName '(indsel);'])
    18341836                    end
    1835                     eval(['InterpFct=TriScatteredInterp(double(coord_X),double(coord_Y),double(coord_Z),double(FieldData.' VarName '))'])
    1836                     eval(['ProjData.' VarName '=InterpFct(X,Y,Z);'])
     1837                    % linear interpolation
     1838                    InterpFct=TriScatteredInterp(double(coord_X),double(coord_Y),double(coord_Z),double(FieldData.(VarName)));
     1839                    ProjData.(VarName)=InterpFct(X,Y,Z);
    18371840%                     eval(['varline=reshape(ProjData.' VarName ',1,length(coord_y_proj)*length(coord_x_proj));'])
    18381841%                     FFlag= isnan(varline); %detect undefined values NaN
  • trunk/src/set_object.m

    r586 r589  
    288288set(handles.num_RangeX_2,'Visible','off')
    289289set(handles.num_RangeY_1,'Visible','off')
    290 if isequal(ProjMode,'interp_lin')
     290if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps')
    291291    set(handles.num_RangeY_2,'Visible','off')
    292292else
  • trunk/src/uvmat.m

    r586 r589  
    917917        if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib)
    918918            if isfield(XmlData.GeometryCalib,'VolumeScan') && isequal(XmlData.GeometryCalib.VolumeScan,'y')
    919                 set (handles.num_NbSlice,'String','volume')
     919                set (handles.slices,'String','volume')
    920920            end
    921921            hgeometry_calib=findobj('tag','geometry_calib');
     
    996996           end
    997997           if isfield(GeometryCalib,'VolumeScan') && isequal(GeometryCalib.VolumeScan,'y')
    998                set(handles.num_NbSlice,'String','volume')
     998               set(handles.num_NbSlice,'Visible','off')
    999999           else
     1000               set(handles.num_NbSlice,'Visible','on')
    10001001               set(handles.num_NbSlice,'String',num2str(NbSlice))
    10011002           end
     
    11261127%------------------------------------------------------------------------
    11271128if get(handles.scan_i,'Value')==1
    1128     set(handles.scan_i,'BackgroundColor',[1 1 0])
     1129%     set(handles.scan_i,'BackgroundColor',[1 1 0])
    11291130    set(handles.scan_j,'Value',0)
    11301131else
    1131     set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
     1132%     set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
    11321133    set(handles.scan_j,'Value',1)
    11331134end
     
    11391140%------------------------------------------------------------------------
    11401141if get(handles.scan_j,'Value')==1
    1141     set(handles.scan_j,'BackgroundColor',[1 1 0])
     1142%     set(handles.scan_j,'BackgroundColor',[1 1 0])
    11421143    set(handles.scan_i,'Value',0)
    1143     set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
     1144%     set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
    11441145%     NomType=get(handles.NomType,'String');
    11451146%     switch NomType
     
    11501151%     end
    11511152else
    1152     set(handles.scan_j,'BackgroundColor',[0.831 0.816 0.784])
     1153%     set(handles.scan_j,'BackgroundColor',[0.831 0.816 0.784])
    11531154    set(handles.scan_i,'Value',1)
    1154     set(handles.scan_i,'BackgroundColor',[1 1 0])
     1155%     set(handles.scan_i,'BackgroundColor',[1 1 0])
    11551156    set(handles.CheckFixPair,'Visible','off')
    11561157end
     
    12221223function slices_Callback(hObject, eventdata, handles)
    12231224%------------------------------------------------------------------------
    1224 if get(handles.slices,'Value')==1
    1225     set(handles.slices,'BackgroundColor',[1 1 0])
    1226     set(handles.num_NbSlice,'Visible','on')
    1227     set(handles.z_text,'Visible','on')
    1228     set(handles.z_index,'Visible','on')
    1229     num_NbSlice_Callback(hObject, eventdata, handles)
    1230 else
    1231     set(handles.num_NbSlice,'Visible','off')
    1232     set(handles.slices,'BackgroundColor',[0.7 0.7 0.7])
    1233     set(handles.z_text,'Visible','off')
    1234     set(handles.z_index,'Visible','off')
    1235     set(handles.masklevel,'Value',1)
    1236     set(handles.masklevel,'String',{'1'})
     1225if strcmp(get(handles.slices,'String'),'slices')
     1226    if get(handles.slices,'Value')==1
     1227        set(handles.num_NbSlice,'Visible','on')
     1228        set(handles.z_text,'Visible','on')
     1229        set(handles.z_index,'Visible','on')
     1230        num_NbSlice_Callback(hObject, eventdata, handles)
     1231    else
     1232        set(handles.num_NbSlice,'Visible','off')
     1233        set(handles.z_text,'Visible','off')
     1234        set(handles.z_index,'Visible','off')
     1235        set(handles.masklevel,'Value',1)
     1236        set(handles.masklevel,'String',{'1'})
     1237    end
    12371238end
    12381239
     
    12401241function num_NbSlice_Callback(hObject, eventdata, handles)
    12411242%------------------------------------------------------------------------
     1243mode=get(handles.slices,'String');
    12421244nb_slice_str=get(handles.num_NbSlice,'String');
    1243 if isequal(nb_slice_str,'volume')
    1244     num=stra2num(get(handles.j1,'String'));
    1245     last_j=get(handles.last_j,'String');
    1246     nbslice=str2double(last_j{1});
     1245if strcmp(mode,'volume')
     1246    z=stra2num(get(handles.j1,'String'));
    12471247else
    12481248    num=str2double(get(handles.i1,'String'));
    12491249    nbslice=str2double(get(handles.num_NbSlice,'String'));
    1250 end
    1251 z=mod(num-1,nbslice)+1;
     1250    z=mod(num-1,nbslice)+1;
     1251end
    12521252set(handles.z_index,'String',num2str(z))
    12531253for ilist=1:nbslice
     
    13221322            if mdetect
    13231323                set(handles.num_NbSlice,'String',Name(i+1:ind_mask-1));
    1324                 set(handles.num_NbSlice,'BackgroundColor',[1 1 0])
     1324                 set(handles.num_NbSlice,'BackgroundColor',[1 1 0])
    13251325                set(handles.CheckMask,'UserData',Mask);
    13261326                set(handles.CheckMask,'BackgroundColor',[1 1 0])
     
    20432043end
    20442044%update the z position index
    2045 nbslice_str=get(handles.num_NbSlice,'String');
    2046 if isequal(nbslice_str,'volume')%NOT USED
     2045mode_slice=get(handles.slices,'String');
     2046if strcmp(mode_slice,'volume')
    20472047    z_index=num_j1;
    20482048    set(handles.z_index,'String',num2str(z_index))
    20492049else
    2050     nbslice=str2num(nbslice_str);
     2050    nbslice=str2num(get(handles.num_NbSlice,'String'));
    20512051    z_index=mod(num_i1-1,nbslice)+1;
    20522052    set(handles.z_index,'String',num2str(z_index))
     
    28842884%-------------------------------------------------------------------
    28852885if get(handles.CheckFixAspectRatio,'Value')
    2886     set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
     2886%     set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
    28872887    update_plot(handles);
    28882888else
    2889     set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
     2889%     set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
    28902890    update_plot(handles);
    28912891end
     
    28952895%-------------------------------------------------------------------
    28962896set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button
    2897 set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow
     2897% set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow
    28982898update_plot(handles);
    28992899%-------------------------------------------------------------------
     
    51655165% --- Executes on button press in CheckColorBar.
    51665166function CheckColorBar_Callback(hObject, eventdata, handles)
    5167 
  • trunk/src/write_plot_param.m

    r511 r589  
    1818        if Coordinates.CheckFixAspectRatio
    1919            set(handles.CheckFixAspectRatio,'Value',1)
    20             set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
    2120        else
    2221            set(handles.CheckFixAspectRatio,'Value',0)
    23             set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
     22 
    2423        end
    2524    end
Note: See TracChangeset for help on using the changeset viewer.