Skip to content
Snippets Groups Projects
Commit 0e441a28 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

add ids ec_antennas

parent 58094818
No related branches found
No related tags found
1 merge request!16Imas codecamp develop
......@@ -76,7 +76,7 @@ ids_names=fieldnames(ids2put);
try
ids_full_list = IDS_list;
catch
ids_full_list = {'equilibrium', 'magnetics', 'tf', 'pf_active','wall','core_profiles'};
ids_full_list = {'equilibrium', 'magnetics', 'tf', 'pf_active','wall','core_profiles','ec_antennas','nbi'};
warning(['IDS_list not available, quick fix introducing list of ids ready for TCV: ' fprintf('%s ',ids_full_list{:}) char(10)]);
end
ids_names_notok = setdiff(ids_names,ids_full_list);
......@@ -100,9 +100,9 @@ try
end
if shot_is_new
idx = imas_create_env('ids',shot,run,0,0,params_ids2database.tree_user,params_ids2database.tree_tokamak, ...
params_ids2database.tree_majorversion); %
params_ids2database.tree_majorversion); %
else
idx = imas_open_env('ids',shot,run,params_ids2database.tree_user,params_ids2database.tree_tokamak,params_ids2database.tree_majorversion); %
idx = imas_open_env('ids',shot,run,params_ids2database.tree_user,params_ids2database.tree_tokamak,params_ids2database.tree_majorversion); %
end
%% Put the field
......@@ -114,7 +114,7 @@ try
ids_put(idx,[ids_to_get '/' num2str(occurence)],ids2put.(ids_to_get));
end
end
%% Close the file
imas_close(idx)
catch ME
......
......@@ -26,7 +26,7 @@ p = inputParser;
% no required inputs here so one can call with empty args and get defaults parameters
% effectively required inputs should have defaults as empty
p.addOptional('shot', [], @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer
p.addOptional('ids_names', {'equilibrium', 'magnetics', 'pf_active','wall', 'tf','core_profiles'}, @(x) isempty(x) | iscell(x) ); % char or cell array
p.addOptional('ids_names', {'equilibrium', 'magnetics', 'pf_active','wall', 'tf','core_profiles','ec_antennas'}, @(x) isempty(x) | iscell(x) ); % char or cell array
p.addOptional('error_bar', 'delta', @(x) isempty(x) | ischar(x) ); % char or cell array
p.parse;
defaults_tcv2ids = p.Results; % to keep track of defaults
......
function [ids_from_tcv,varargout] = tcv2ids2database(shot,run_out,varargin);
%
%
% [ids_from_tcv,varargout] = tcv2ids2database(shot,run_out,varargin)
%
%
% script to get TCV data as ids and then write them on the database
%
% Uses function tcv2ids and ids2database
......@@ -9,7 +9,7 @@ function [ids_from_tcv,varargout] = tcv2ids2database(shot,run_out,varargin);
%
% 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)
% {'equilibrium', 'magnetics', 'tf', 'pf_active','wall','core_profiles'} or a subset
% {'equilibrium', 'magnetics', 'tf', 'pf_active','wall','core_profiles','ec_antennas','nbi'} or a subset
% varargin: 'error_bar': type (string)
% 'delta' or empty (default): meaning difference in upper is set (standard error_bar
% 'added': errorbar is added: upper=data+delta and lower=data-delta
......@@ -42,7 +42,7 @@ p = inputParser;
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('occurence', 0, @(x) (isnumeric(x) && isscalar(x) && (x == round(x)))); % integer
p.addOptional('ids_names', {'equilibrium', 'magnetics', 'pf_active','wall', 'tf','core_profiles'}, @(x) isempty(x) | iscell(x)); % char or cell array
p.addOptional('ids_names', {'equilibrium', 'magnetics', 'pf_active','wall', 'tf','core_profiles','ec_antennas'}, @(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('tree_user', getenv('USER'), @(x) isempty(x) | ischar(x) ); % char
p.addOptional('tree_tokamak', 'tcv', @(x) isempty(x) | ischar(x) ); % char
......@@ -115,3 +115,5 @@ ids_from_tcv.ids_put_status = ids_put_status;
% tic;[TTTp,idsp]=evalc('ids_get(expIdx, ''pf_active'')');toc
% tic;[TTTt,idst]=evalc('ids_get(expIdx, ''tf'')');toc
% tic;[TTTw,idsw]=evalc('ids_get(expIdx, ''wall'')');toc
% tic;[TTTw,idsw]=evalc('ids_get(expIdx, ''ec_antennas'')');toc
% tic;[TTTw,idsw]=evalc('ids_get(expIdx, ''nbi'')');toc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment