From fcb147fc1a8a11275209bc94fa6708df611a388b Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Tue, 16 Feb 2016 09:42:10 +0000
Subject: [PATCH] fix sxr default connect to aug20

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@5460 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 crpptbx/AUG/gdat_aug.m | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/crpptbx/AUG/gdat_aug.m b/crpptbx/AUG/gdat_aug.m
index 5b772e88..cb5469d6 100644
--- a/crpptbx/AUG/gdat_aug.m
+++ b/crpptbx/AUG/gdat_aug.m
@@ -1519,11 +1519,15 @@ elseif strcmp(mapping_for_aug.method,'switchcase')
     if ~isfield(gdat_data.gdat_params,'time_interval')
       gdat_data.gdat_params.time_interval = [];
     end
-    [aa,bb]=unix(['ssh ' 'sxaug22.aug.ipp.mpg.de WhichSX ' num2str(shot) ' ' ...
+    [aa,bb]=unix(['ssh ' 'sxaug20.aug.ipp.mpg.de WhichSX ' num2str(shot) ' ' ...
 		  upper(gdat_data.gdat_params.source)]);
     chords_ok_diags=regexpi(bb,'(?<chord>[A-Z]_[0-9]+)\saddress:\s[0-9]+\sDiag:\s(?<diag>[A-Z]+)','names');
-    for i=1:length(chords_ok_diags)
-      chords_ok_nb(i) =  str2num(chords_ok_diags(i).chord(3:end));
+    if isempty(chords_ok_diags)
+      chords_ok_nb = [];
+    else
+      for i=1:length(chords_ok_diags)
+	chords_ok_nb(i) =  str2num(chords_ok_diags(i).chord(3:end));
+      end
     end
     if isempty(gdat_data.gdat_params.camera);
       gdat_data.gdat_params.camera = chords_ok_nb;
-- 
GitLab