From e60bd03d207b437e734f60e013740dee0fab80db Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Fri, 1 Feb 2019 09:47:03 +0000
Subject: [PATCH] add idsok type output optional

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@11387 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 crpptbx/TCV_IMAS/tcv2ids.m | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/crpptbx/TCV_IMAS/tcv2ids.m b/crpptbx/TCV_IMAS/tcv2ids.m
index 1b5451d7..00f7b7ca 100644
--- a/crpptbx/TCV_IMAS/tcv2ids.m
+++ b/crpptbx/TCV_IMAS/tcv2ids.m
@@ -13,6 +13,8 @@ function [ids_saved,varargout] = tcv2ids(shot,run,varargin);
 % varargin{1}: ids to load, by default all defined so far
 %             {'equilibrium', 'magnetics', 'pf_active','wall'} or a subset
 %
+% varargout{1}: return also the ids in array of structure with the names, to allow easy use of plotallids
+%
 
 % initialize input parser
 p = inputParser;
@@ -99,4 +101,10 @@ end
 %% Close the file
 imas_close(idx)
 
-
+if nargout>=2
+  for i=1:length(params_tcv2ids.ids_names)
+    ids_to_get = params_tcv2ids.ids_names{i};
+    varargout{1}.ids{i} = ids_saved.(ids_to_get);
+    varargout{1}.idsname{i} = ids_to_get;
+  end
+end
-- 
GitLab