Home > reduc > support > getMainDir.m

getMainDir

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

function [maindir subdir] = getMainDir(d, field)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 function maindir = getMainDir(d, field)

  gets the main directory of this data reduction

  sjcm

   MAS -- 22-May-2012:  Modified so that 'src' can be a full directory.
   Backwards compatible.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [maindir subdir] = getMainDir(d, field)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 % function maindir = getMainDir(d, field)
0005 %
0006 %  gets the main directory of this data reduction
0007 %
0008 %  sjcm
0009 %
0010 %   MAS -- 22-May-2012:  Modified so that 'src' can be a full directory.
0011 %   Backwards compatible.
0012 %
0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0014 
0015 %eval(sprintf('load %s/%s/reduc/maindir_%s.mat',home,installeddir,field));
0016 
0017 if strcmp(field(1),'/') || strcmp(field(1),'~')
0018     slashlist = find(field == '/');
0019     if slashlist(end) < length(field)
0020         parent_dir = field(1:slashlist(end)-1);
0021         field_dir = field(slashlist(end)+1:end);
0022     else
0023         parent_dir = field(1:slashlist(end-1)-1);
0024         field_dir = field(slashlist(end-1)+1:slashlist(end)-1);
0025     end
0026     
0027     eval(sprintf('load %s/maindir_%s.mat maindir subdir',parent_dir,field_dir));
0028 else
0029     [home,installeddir]=where_am_i();
0030 
0031     eval(sprintf('load %s/%s/reduc/maindir_%s.mat maindir subdir',home,installeddir,field));
0032 end
0033 
0034 
0035 return;
0036 
0037 
0038 
0039 
0040 
0041 
0042

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005