source: trunk/src/find_imadoc.m @ 501

Last change on this file since 501 was 469, checked in by sommeria, 9 years ago

several bugs corrected
introductyion of functions find_imadoc and read_multimadoc which simplifiy the functions under series

File size: 1.2 KB
Line 
1% 'find_imadoc': find the ImaDoc xml file associated with a given input file
2% take into account the old conventions
3%-----------------------------------------------------------------------
4% function XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt)
5%
6% OUTPUT:
7% XmlFileName: name of the xml file, ='' if none is found
8%
9% INPUT:
10% RootPath,SubDir,RootFile,FileExt, as given from the input file name by fileparts_uvmat
11function XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt)
12SubDirBase=regexprep(SubDir,'\..*','');%take the root part of SubDir, before the first dot '.'
13XmlFileName=[fullfile(RootPath,SubDirBase) '.xml'];%new convention: xml at the level of the image folder
14if ~exist(XmlFileName,'file')
15    if strcmp(FileExt,'.nc')
16        basexml=fullfile(RootPath,RootFile) ; % old convention: xml inside the image folder, case of civ files
17    else
18        basexml=fullfile(RootPath,SubDir,RootFile) ; % old convention: xml inside the image folder, case of images
19    end
20    XmlFileName=[basexml '.xml'];
21    if ~exist(XmlFileName,'file')
22        XmlFileName=[basexml '.civ']; % very old convention: .civ file
23        if ~exist(XmlFileName,'file')
24            XmlFileName='';
25        end
26    end
27end
Note: See TracBrowser for help on using the repository browser.