Skip to content
Snippets Groups Projects
Commit 9622b295 authored by Antoine Merle's avatar Antoine Merle
Browse files

Single function to have list of available IDSs on TCV.

parent 7f63665b
No related branches found
No related tags found
1 merge request!64add new ids available, thomson_scattering and summary, in various global functions
Pipeline #41652 passed
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
% %
ids_list_all=ids_list; ids_list_all=ids_list;
% ids_list_to_generate = {'core_profiles', 'core_sources', 'equilibrium', 'magnetics', 'pf_active', 'pf_passive', 'tf','wall', ... % ids_list_to_generate = tcv_available_ids;
% 'thomson_scattering', 'summary'};
ids_list_to_generate = ids_list_all; ids_list_to_generate = ids_list_all;
for i=1:length(ids_list_to_generate) for i=1:length(ids_list_to_generate)
......
...@@ -88,9 +88,8 @@ try ...@@ -88,9 +88,8 @@ try
ids_full_list = IDS_list; ids_full_list = IDS_list;
end end
catch catch
ids_full_list = {'equilibrium', 'magnetics', 'tf', 'pf_active','wall','core_profiles','ec_launchers','nbi','pf_passive', ... ids_full_list = tcv_available_ids;
'thomson_scattering', 'summary'}; warning(['IDS_list not available, quick fix introducing list of ids available for TCV: ' fprintf('%s ',ids_full_list{:}) char(10)]);
warning(['IDS_list not available, quick fix introducing list of ids ready for TCV: ' fprintf('%s ',ids_full_list{:}) char(10)]);
end end
ids_names_notok = setdiff(ids_names,ids_full_list); ids_names_notok = setdiff(ids_names,ids_full_list);
if ~isempty(ids_names_notok) if ~isempty(ids_names_notok)
......
...@@ -11,7 +11,7 @@ function [ids_from_tcv,varargout] = tcv2ids(shot,varargin); ...@@ -11,7 +11,7 @@ function [ids_from_tcv,varargout] = tcv2ids(shot,varargin);
% mdsconnect('localhost:5555') % mdsconnect('localhost:5555')
% %
% varargin: 'ids_names': cell, idss to load, by default all defined so far (if empty or empty string or not given) % varargin: 'ids_names': cell, idss to load, by default all defined so far (if empty or empty string or not given)
% {'equilibrium', 'magnetics', 'pf_active','wall','core_profiles','ec_launchers','nbi'} or a subset % see tcv_available_ids for the list of IDSs available for TCV
% 'error_bar': type (string) % 'error_bar': type (string)
% empty or 'delta' (default): meaning difference in upper is set (standard error_bar % empty or 'delta' (default): meaning difference in upper is set (standard error_bar
% 'added': errorbar is added: upper=data+delta and lower=data-delta % 'added': errorbar is added: upper=data+delta and lower=data-delta
...@@ -32,14 +32,13 @@ function [ids_from_tcv,varargout] = tcv2ids(shot,varargin); ...@@ -32,14 +32,13 @@ function [ids_from_tcv,varargout] = tcv2ids(shot,varargin);
p = inputParser; p = inputParser;
% no required inputs here so one can call with empty args and get defaults parameters % no required inputs here so one can call with empty args and get defaults parameters
% effectively required inputs should have defaults as empty % effectively required inputs should have defaults as empty
ids_names = {'equilibrium', 'magnetics', 'pf_active','wall', 'tf','core_profiles','ec_launchers','nbi', 'thomson_scattering', ... ids_names = tcv_available_ids;
'summary'};
p.addOptional('shot', [], @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer 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('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('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', 11, @(x) isempty(x) || isnumeric(x) ); % char
p.addOptional('ipsign_out', 0, @(x) isempty(x) || (x==0 | x==-1 | x==+1) ); % 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) || (x==0 | x==-1 | x==+1) ); % char 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) ); p.addOptional('nverbose', 1, @(x) isempty(x) || isnumeric(x) );
p.addOptional('time_out', [], @(x) isempty(x) || isnumeric(x) ); p.addOptional('time_out', [], @(x) isempty(x) || isnumeric(x) );
p.addOptional('trialindx', [], @(x) isempty(x) || isnumeric(x) ); p.addOptional('trialindx', [], @(x) isempty(x) || isnumeric(x) );
......
...@@ -9,8 +9,7 @@ function [ids_from_tcv,varargout] = tcv2ids2database(shot,run_out,varargin); ...@@ -9,8 +9,7 @@ function [ids_from_tcv,varargout] = tcv2ids2database(shot,run_out,varargin);
% %
% varargin: 'occurence': occurence value % varargin: 'occurence': occurence value
% varargin: 'ids_names': cell, ids to load, by default all defined so far (if empty or empty string or not given) % varargin: 'ids_names': cell, ids to load, by default all defined so far (if empty or empty string or not given)
% {'equilibrium', 'magnetics', 'tf', 'pf_active','wall','core_profiles','ec_launchers','nbi', 'thomson_scattering', ... % see tcv_available_ids for the list of IDSs available for TCV
% 'summary'} or a subset
% varargin: 'error_bar': type (string) % varargin: 'error_bar': type (string)
% 'delta' or empty (default): meaning difference in upper is set (standard error_bar % 'delta' or empty (default): meaning difference in upper is set (standard error_bar
% 'added': errorbar is added: upper=data+delta and lower=data-delta % 'added': errorbar is added: upper=data+delta and lower=data-delta
...@@ -49,8 +48,7 @@ p = inputParser; ...@@ -49,8 +48,7 @@ p = inputParser;
p.addOptional('shot', [], @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer p.addOptional('shot', [], @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer
p.addOptional('run_out', [], @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer p.addOptional('run_out', [], @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer
p.addOptional('occurence', 0, @(x) isempty(x) || (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer p.addOptional('occurence', 0, @(x) isempty(x) || (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer
ids_names = {'equilibrium', 'magnetics', 'pf_active','wall', 'tf','core_profiles','ec_launchers','nbi', 'thomson_scattering', ... ids_names = tcv_available_ids;
'summary'};
p.addOptional('ids_names', ids_names, @(x) isempty(x) || iscell(x)); % char or cell array 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('error_bar', 'delta', @(x) isempty(x) || ischar(x) ); % char or cell array
p.addOptional('tree_user', getenv('USER'), @(x) isempty(x) || ischar(x) ); % char p.addOptional('tree_user', getenv('USER'), @(x) isempty(x) || ischar(x) ); % char
......
function list = tcv_available_ids()
list = {'equilibrium', 'magnetics', 'tf', 'pf_active','wall','core_profiles','ec_launchers','nbi','pf_passive', ...
'thomson_scattering', 'summary'};
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment