From 72788add75bc0856f2e4092e17d2264834507f32 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Mon, 8 Apr 2002 21:15:34 +0000
Subject: [PATCH] auto set default machine

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@1866 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 gdat.m | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdat.m b/gdat.m
index 883c7143..72238b86 100644
--- a/gdat.m
+++ b/gdat.m
@@ -51,7 +51,7 @@ function [trace,error,varargout] = gdat(shot,data_type,varargin)
 % optional arguments valid for all values of data_type (not passed on to loadMACHINEdata function):
 %
 % varargin{1}:  0 => no plot (default), 1 => plot 
-% varargin{2}:  machine name 'JET', 'TCV' (default)
+% varargin{2}:  machine name 'JET' , 'TCV' (default: JET or TCV, depending on where implemented)
 %
 % Additional input arguments for specific traces (passed on to loadMACHINEdata function)
 %
@@ -109,6 +109,8 @@ end
 doplot=0;
 if (nargineff>=3 & ~isempty(varargin{1})); doplot=varargin{1}; end
 machine='TCV';
+a=which('gdat');
+if ~isempty(findstr('osauter',a)); machine='JET'; end
 if (nargineff>=4 & ~isempty(varargin{2})); machine=varargin{2}; end
 
 % load data from specified machine
-- 
GitLab