- Timestamp:
- Jun 13, 2012, 5:03:06 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_file_series.m
r450 r453 7 7 % iview: line in the table corresponding to a given file series 8 8 % fileindex: file index within the file series, 9 % i1_series (iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j10 % i1_series (iview,fileindex) expresses the same indices as a 1D array in file indices9 % i1_series{iview}(ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j 10 % i1_series{iview}(fileindex) expresses the same indices as a 1D array in file indices 11 11 12 12 % INPUT: … … 50 50 r(1).mode=''; 51 51 end 52 [i1_series _iview,i2_series_iview,j1_series_iview,j2_series_iview]=find_file_indices(ref_i,ref_j,str2num(r.num1),str2num(r.num2),r.mode);52 [i1_series{iview},i2_series{iview},j1_series{iview},j2_series{iview}]=find_file_indices(ref_i,ref_j,str2num(r.num1),str2num(r.num2),r.mode); 53 53 %case of pairs (.nc files) 54 54 i2=[];j1=[];j2=[]; 55 for ifile=1:numel(i1_series _iview)56 i1=i1_series _iview(ifile);57 if ~isempty(i2_series _iview)58 i2=i2_series _iview(ifile);55 for ifile=1:numel(i1_series{iview}) 56 i1=i1_series{iview}(ifile); 57 if ~isempty(i2_series{iview}) 58 i2=i2_series{iview}(ifile); 59 59 end 60 if ~isempty(j1_series _iview)61 j1=j1_series _iview(ifile);60 if ~isempty(j1_series{iview}) 61 j1=j1_series{iview}(ifile); 62 62 end 63 if ~isempty(j2_series _iview)64 j2=j2_series _iview(ifile);63 if ~isempty(j2_series{iview}) 64 j2=j2_series{iview}(ifile); 65 65 end 66 66 filecell{iview,ifile}=fullfile_uvmat(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5},InputTable{iview,4}... 67 67 ,i1,i2,j1,j2); 68 68 end 69 i1_series(iview,:,:)=i1_series_iview;70 i2_series(iview,:,:)=i2_series_iview;71 j1_series(iview,:,:)=j1_series_iview;72 j2_series(iview,:,:)=j2_series_iview;73 69 end 74 70 -
trunk/src/series.m
r450 r453 1259 1259 set(handles.RUN, 'Enable','Off') 1260 1260 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 1261 [h_fun,Series, errormsg]=prepare_jobs(handles);1261 [h_fun,Series,filexml,errormsg]=prepare_jobs(handles); 1262 1262 if ~isempty(errormsg) 1263 1263 msgbox_uvmat('ERROR',errormsg) 1264 1264 else 1265 Series.Specific=h_fun(Series,0); 1266 t=struct2xml(Series); 1267 t=set(t,1,'name','Series'); 1268 save(t,filexml); 1265 1269 h_fun(Series); 1266 1270 end … … 1283 1287 set(handles.BATCH, 'Enable','Off') 1284 1288 set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784]) 1285 [h_fun,Series, errormsg]=prepare_jobs(handles);1289 [h_fun,Series,filexml,errormsg]=prepare_jobs(handles); 1286 1290 if ~isempty(errormsg) 1287 1291 msgbox_uvmat('ERROR',errormsg) 1288 1292 return 1289 1293 end 1294 % update the xml file after interactive input with the function 1295 Series.Specific=h_fun(Series,0); 1296 t=struct2xml(Series); 1297 t=set(t,1,'name','Series'); 1298 save(t,filexml); 1290 1299 path_series=fileparts(which('series')); 1291 1300 filename_xml=fullfile(Series.OutputDir,[Series.OutputRootFile '.xml']); … … 1296 1305 return 1297 1306 end 1307 fctpath=get(handles.ActionPath,'String'); 1298 1308 text_matlabscript=[... 1299 1309 '#!/bin/bash \n'... … … 1301 1311 'matlab -nodisplay -nosplash -nojvm <<END_MATLAB \n'... 1302 1312 'cd(''' path_series '''); \n'... 1313 'addpath(''' fctpath '''); \n'... 1303 1314 '' Series.Action '( ''' filename_xml '''); \n'... 1304 1315 'exit \n'... … … 1323 1334 %------------------------------------------------------------------------ 1324 1335 % --- Main lauch command, called by RUN and BATCH 1325 function [h_fun,Series, errormsg]=prepare_jobs(handles)1336 function [h_fun,Series,filexml,errormsg]=prepare_jobs(handles) 1326 1337 %------------------------------------------------------------------------ 1327 1338 errormsg=''; … … 1688 1699 delete(hget_field)%delete opened versions of get_field 1689 1700 end 1690 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(read_GUI(handles.series));1701 filecell=get_file_series(read_GUI(handles.series)); 1691 1702 if exist(filecell{1,1},'file') 1692 1703 get_field(filecell{1,1}) -
trunk/src/struct2xml.m
r450 r453 48 48 [t,new_uid]=add(t,uid,'element',key); 49 49 [t]=add(t,new_uid,'chardata',val); 50 elseif isnumeric(val) 50 elseif isnumeric(val)||islogical(val) 51 51 siz=size(val); 52 52 if length(siz)<=2 %do not translate matrices with more than 2 indices -
trunk/src/xml2struct.m
r450 r453 39 39 case 'cell' 40 40 for ilist=1:numel(ss) 41 if ~isempty(str2num(ss{ilist})) 41 42 out(ilist,:)=str2num(ss{ilist}); 43 end 42 44 end 43 45 otherwise
Note: See TracChangeset
for help on using the changeset viewer.