Home > cbassSouthFunctions > ACTFunctions > where_am_iSa_ACT.m

where_am_iSa_ACT

PURPOSE ^

The purpose of this function is to return

SYNOPSIS ^

function [home,installeddir] = where_am_iSa()

DESCRIPTION ^

 The purpose of this function is to return 
 the users home dir and the name of the installed dir (e.g. cbass_analysis)

 If you have installed somewhere non-standard e.g.  cbass_analysis_latest
 change the line below to reflect the fact.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [home,installeddir] = where_am_iSa()
0002 
0003 % The purpose of this function is to return
0004 % the users home dir and the name of the installed dir (e.g. cbass_analysis)
0005 %
0006 % If you have installed somewhere non-standard e.g.  cbass_analysis_latest
0007 % change the line below to reflect the fact.
0008 
0009 % First look for the environment variales.
0010 
0011 home = getenv('CBASS_HOME');
0012 installeddir = getenv('CBASSSA_INSTALLEDDIR');
0013 
0014 if(~length(installeddir)) 
0015   % No installed dir enviro variable found
0016   % set by hand here.
0017 % installeddir='cbass_analysisSa';
0018   installeddir='cbass_analysis';
0019 
0020   %disp(['Warn: No CBASS_INSTALLEDDIR environment variable found - will default to: ',installeddir]);
0021   end
0022 
0023 if (~length(home))
0024 
0025  % get the home dir the "manual" way...
0026 
0027 [r, home] = unix('printenv HOME');
0028 [r, hostname] = unix('printenv HOSTNAME');
0029 
0030 %if ~strcmp(home(1:5),'/home')
0031 %  %case where you get tcsh shell error
0032 %  startpt=find(home=='/');
0033 %  home=home(startpt(1):end-1);
0034 %
0035 %  clear startpt
0036 %else
0037 %  home=home(1:end-1);
0038 %end
0039 
0040 if ~strcmp(home(1:5),'/home')
0041   %case where you get tcsh shell error
0042    startpt=find(home=='/');
0043    home=home(startpt(1):end-1);
0044    clear startpt
0045 else
0046    home=home(1:end-1);
0047 end
0048 
0049 %Fix to work on the computer of Angela :-)
0050 if (~isempty(strfind(home,'taylora')))
0051     home = '/Volumes/Data/CBASS'
0052     addpath([home, '/cbass_analysis/angela']);
0053 elseif( strfind(home, 'cbassusr'))
0054 %Fix to work on falcon
0055   home = '/scratch/falcon_4/cbassusr/cbass';
0056 elseif(strfind(home, 'zuntz'))
0057   home = '/Users/zuntz/src/cbass';
0058 elseif(strfind(home,'mirfan'))
0059     home = '/scratch/falcon_4/mirfan/cbass';
0060 elseif(strfind(home,'cdickins') & strfind(hostname,'falcon'))
0061     home = '/scratch/falcon_4/cdickins/cbass';
0062 elseif(strfind(home,'cdickins') & strfind(hostname,'haggis'))
0063     home = '/scr/cdickins/cbass';
0064 elseif(strfind(home,'tjp') & strfind(hostname,'haggis'))
0065     home = '/home/tjp';
0066 elseif(strfind(home,'oliver'))
0067     home = '/Users/oliver';
0068 elseif(strfind(hostname,'elephant'))
0069   home = '/elephant';
0070 end
0071 %disp(['Warn: No CBASS_HOME environment variable found will default to: ',home]);
0072 
0073 
0074 
0075 end;
0076 
0077 %disp(['Using home =',home,' :  installed dir = ',installeddir]);
0078 
0079 return;

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