-
Olivier Sauter authored
git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@12244 d63d8f72-b253-0410-a779-e742ad2e26cf
Olivier Sauter authoredgit-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@12244 d63d8f72-b253-0410-a779-e742ad2e26cf
get_profiles.m 5.50 KiB
function [profile_struct,varargout] = get_profiles(shot,data_request_in,varargin);
%
% data_request_in: 1 or several of the optional keywords related to the machine options for profiles
% for example: 'te_thomson', or {'te_thomson','te_ece'}, or {'ne_thomson','te_thomson'}
% (case insensitive)
%
% varargin in pairs:
% 'equil',equil_source: equilibrium source: EQI(default), EQH, etc for AUG or LIUQE1 (default), LIUQE2, etc for TCV
% 'machine', machine_name: 'TCV', 'AUG' (default is the default in gdat, thus local machine)
%
% output profile_struct is an array of structure for each requested keyword:
%
% profile_struct{i}.data, .t, .error_bar, .label, .shot, .keyword, .provenance, .comment, .q (q profile)
% profile_struct{i}.grid.rhotornorm, .rhopolnorm, .rhovolnorm, .rovera, .psi, .phi, .vol, .provenance
%
% profile_struct = get_profiles; % returns the list of possible keywords in profile_struct{i}.keyword
%
error_status = -1;
% default output structure
i_init=1;
profile_struct{i_init}.data = [];
profile_struct{i_init}.t = [];
profile_struct{i_init}.error_bar = [];
profile_struct{i_init}.label = [];
profile_struct{i_init}.shot = [];
profile_struct{i_init}.keyword = [];
profile_struct{i_init}.provenance = [];
profile_struct{i_init}.comment = [];
profile_struct{i_init}.q = [];
profile_struct{i_init}.grid.rhotornorm = [];
profile_struct{i_init}.grid.rhopolnorm = [];
profile_struct{i_init}.grid.rhovolnorm = [];
profile_struct{i_init}.grid.rovera = [];
profile_struct{i_init}.grid.psi = [];
profile_struct{i_init}.grid.phi = [];
profile_struct{i_init}.grid.vol = [];
profile_struct{i_init}.grid.provenance = [];
% default param
get_profiles_params.machine = [];
get_profiles_params.equil = [];
get_profiles_params.nverbose = [];
get_profiles_params.help.machine = 'machine to get data, aug or tcv at this stage';
get_profiles_params.help.equil = 'equilibrium source, use default of gdat as default';
get_profiles_params.help.nverbose = ...
'level of information written during the call to get_profiles, default=1, up to warnings but no details';
profile_struct{i_init}.profiles_params = get_profiles_params;
% defaults:
shot_eff = [];
if exist('shot') && ~isempty(shot); shot_eff = shot; end
data_request_eff = [];
if exist('data_request_in') && ~isempty(data_request_in)
if ischar(data_request_in)
data_request_eff{1} = data_request_in;
else
data_request_eff = data_request_in;
end
if ~iscell(data_request_eff)
disp('problem with data_request_in, expects string or cell of strings')
error_status=-2;
return
end
end
% get default machine
aa=gdat;
get_profiles_params.machine = aa.gdat_params.machine;
get_profiles_params.equil = aa.gdat_params.equil;