From 85b59b7926ee51c8bc050199b8e3bc956d416fef Mon Sep 17 00:00:00 2001 From: Luke Simons <luke.simons@epfl.ch> Date: Wed, 23 Apr 2025 13:37:58 +0200 Subject: [PATCH] Changed handling of COCOS transformation in tcv_get_ids_nbi to use gdat cocos_out convention --- matlab/TCV_IMAS/tcv2ids.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/matlab/TCV_IMAS/tcv2ids.m b/matlab/TCV_IMAS/tcv2ids.m index aa881ef..a78490f 100644 --- a/matlab/TCV_IMAS/tcv2ids.m +++ b/matlab/TCV_IMAS/tcv2ids.m @@ -29,6 +29,12 @@ function [ids_from_tcv,varargout] = tcv2ids(shot,varargin); % varargout{1}: return also the ids in array of structure with the names, to allow easy use of plotallids % +imas_version_number=str2num(getenv('IMAS_VERSION')); +cocos_out_default=11; +if imas_version_number(1) >= 4 + cocos_out_default=17; +end + % initialize input parser p = inputParser; % no required inputs here so one can call with empty args and get defaults parameters @@ -37,7 +43,7 @@ ids_names = tcv_available_ids; p.addOptional('shot', [], @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer p.addOptional('ids_names', ids_names, @(x) isempty(x) || iscell(x) ); % char or cell array p.addOptional('error_bar', 'delta', @(x) isempty(x) || ischar(x) ); % char or cell array -p.addOptional('cocos_out', 11, @(x) isempty(x) || isnumeric(x) ); % char +p.addOptional('cocos_out', cocos_out_default, @(x) isempty(x) || isnumeric(x) ); % char p.addOptional('ipsign_out', 0, @(x) isempty(x) || (isscalar(x) && (x==0 || x==-1 || x==+1)) ); p.addOptional('b0sign_out', 0, @(x) isempty(x) || (isscalar(x) && (x==0 || x==-1 || x==+1)) ); p.addOptional('nverbose', 1, @(x) isempty(x) || isnumeric(x) ); -- GitLab