Changeset 668 for trunk/src/series/merge_proj.m
- Timestamp:
- Jul 15, 2013, 2:50:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/merge_proj.m
r642 r668 111 111 for iview=1:NbView 112 112 if ~exist(filecell{iview,1}','file') 113 disp l_uvmat('ERROR',['the first input file ' filecell{iview,1} ' does not exist'],checkrun)113 disp_uvmat('ERROR',['the first input file ' filecell{iview,1} ' does not exist'],checkrun) 114 114 return 115 115 end … … 129 129 diff_time=max(max(diff(time))); 130 130 if diff_time>0 131 disp l_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)],checkrun)131 disp_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)],checkrun) 132 132 end 133 133 end … … 150 150 FileExtOut='.nc';% write result as .nc files for netcdf inputs 151 151 else 152 disp l_uvmat('ERROR',['invalid file type input ' FileType{1}],checkrun)152 disp_uvmat('ERROR',['invalid file type input ' FileType{1}],checkrun) 153 153 return 154 154 end 155 155 for iview=1:NbView 156 156 if ~isequal(CheckImage{iview},CheckImage{1})||~isequal(CheckNc{iview},CheckNc{1}) 157 disp l_uvmat('ERROR','input set of input series: need either netcdf either image series',checkrun)157 disp_uvmat('ERROR','input set of input series: need either netcdf either image series',checkrun) 158 158 return 159 159 end … … 162 162 163 163 %% mask (TODO: case of multilevels) 164 MaskData=cell(NbView,1); 164 165 if Param.CheckMask 165 MaskData=cell(NbView,1); 166 MaskSubDir=regexprep(Param.InputTable{iview,2},'\..*','');%take the root part of SubDir, before the first dot '.' 167 MaskName=fullfile(Param.InputTable{iview,1},[MaskSubDir '.mask'],'mask_1.png'); 168 if exist(MaskName,'file') 169 [MaskData{iview},tild,errormsg] = read_field(MaskName,'image'); 166 for iview=1:numel(Param.MaskTable) 167 % MaskData=cell(NbView,1); 168 % MaskSubDir=regexprep(Param.InputTable{iview,2},'\..*','');%take the root part of SubDir, before the first dot '.' 169 % MaskName=fullfile(Param.InputTable{iview,1},[MaskSubDir '.mask'],'mask_1.png'); 170 % if exist(MaskName,'file') 171 [MaskData{iview},tild,errormsg] = read_field(Param.MaskTable{iview},'image'); 170 172 if ~isempty(transform_fct) && nargin(transform_fct)>=2 171 MaskData{iview}=transform_fct(MaskData ,XmlData{iview});173 MaskData{iview}=transform_fct(MaskData{iview},XmlData{iview}); 172 174 end 173 175 end … … 301 303 GeometryCal.Tx_Ty_Tz=[T_x T_y 1]; 302 304 ImaDoc.GeometryCalib=GeometryCal; 303 % t=struct2xml(ImaDoc);304 % t=set(t,1,'name','ImaDoc');305 % save(t,[filebase_merge '.xml'])306 % display([filebase_merge '.xml saved'])307 305 else 308 306 MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end','nb_coord','nb_dim','dt','Time','civ'}; … … 351 349 352 350 %% group the variables (fields of 'Data') in cells of variables with the same dimensions 353 [Cell VarIndex,NbDim,VarTypeCell]=find_field_cells(Data{1});351 [CellInfo,NbDim,errormsg]=find_field_cells(Data{1}); 354 352 %LOOP ON GROUPS OF VARIABLES SHARING THE SAME DIMENSIONS 355 353 % CellVarIndex=cells of variable index arrays 356 for icell=1:length(Cell VarIndex)354 for icell=1:length(CellInfo) 357 355 if NbDim(icell)==1 358 continue 359 end 360 VarIndex=CellVarIndex{icell};% indices of the selected variables in the list FieldData.ListVarName 361 VarType=VarTypeCell{icell}; 362 ivar_X=VarType.coord_x; 363 ivar_Y=VarType.coord_y; 364 ivar_FF=VarType.errorflag; 356 continue% skip field cells which are of dim 1 357 end 358 VarIndex=CellInfo{icell}.VarIndex;% indices of the selected variables in the list FieldData.ListVarName 359 % VarType=VarTypeCell{icell}; 360 ivar_X=CellInfo{icell}.CoordIndex(1); 361 ivar_Y=CellInfo{icell}.CoordIndex(2); 362 % ivar_Y=VarType.coord_y; 363 ivar_FF=CellInfo{icell}.VarIndex_errorflag; 365 364 if isempty(ivar_X) 366 365 test_grid=1;%test for input data on regular grid (e.g. image)coordinates 367 366 else 368 367 if length(ivar_Y)~=1 369 disp l_uvmat('ERROR','y coordinate missing in proj_field.m',checkrun)368 disp_uvmat('ERROR','y coordinate missing in proj_field.m',checkrun) 370 369 return 371 370 end … … 373 372 end 374 373 %case of input fields with unstructured coordinates 375 if ~test_grid374 if isequal(CellInfo{icell}.CoordType,'scattered') 376 375 for ivar=VarIndex 377 376 VarName=MergeData.ListVarName{ivar};
Note: See TracChangeset
for help on using the changeset viewer.