function mapping = aug_requests_mapping(data_request)

% Defaults
mapping = struct(...
    'label', '', ...
    'method', '', ...
    'expression','', ...
    'timedim', -1, ...     % dim which is the time, to copy in .t, the other dims are in .x (-1 means last dimension)
    'new_timedim',0, ...  % if need to reshape data and dim orders to have timedim as new_timedim (shifting time to new_timedim)
    'min', -inf, ...
    'max', inf);

if ~exist('data_request') || isempty(data_request)
  return
end

% default label: data_request keyword itself
mapping.label = data_request;

% for AUG, following choices are set so far:
% method = 'tdi' and then expression is the string within tdi (usual case when there is a direct link to an existing signal)
%                with tdi, if expression cell array, call tdi(cell{1},cell{2},...)
% method = 'function', then expression is the funtion to call which should return the correct structure
% method = 'switchcase', then there will be a specific case within gdat_aug (usual case when not directly a signal)
%
% label is used for plotting
switch lower(data_request)
 case 'b0'
  mapping.label = 'B_0';
  mapping.method = 'switchcase';
  mapping.expression = '';
 case 'betan'
  mapping.label = '\beta_N';
  mapping.method = 'switchcase';
  mapping.expression = '';
 case 'betap'
  mapping.label = '\beta_p';
  mapping.method = 'tdi';
  mapping.expression = '\results::beta_pol';
 case 'cxrs'
  mapping.label = 'cxrs';
  mapping.method = 'switchcase';
  mapping.expression = '';
 case 'delta'
  mapping.method = 'tdi';
  mapping.expression = '\results::delta_edge';
  mapping.method = 'function';
  mapping.expression = ['tdi(''\results::q_psi'');'];
 case 'delta_top'
  mapping.label = 'delta\_top';
  mapping.method = 'tdi';
  mapping.expression = '\results::delta_ed_top';
 case 'delta_bottom'
  mapping.label = 'delta\_bottom';
  mapping.method = 'tdi';
  mapping.expression = '\results::delta_ed_bot';
 case 'ece'
  mapping.method = 'switchcase';
  mapping.expression = '';
 case 'eqdsk'
  mapping.method = 'switchcase'; % could use function make_eqdsk directly?
  mapping.expression = '';
 case 'halpha'
  mapping.label = 'Halpha';
  mapping.method = 'tdi';
  mapping.expression = '\base::pd:pd_011';
 case 'ioh'
  mapping.label = 'I ohmic transformer';
  mapping.method = 'tdi';
  mapping.expression = [{'\magnetics::ipol[*,$1]'} {'OH_001'}];
 case 'ip'
  mapping.label = 'Plasma current';
  mapping.method = 'tdi';
  mapping.expression = '\magnetics::iplasma:trapeze';
 case 'kappa'
  mapping.method = 'tdi';
  mapping.expression = '\results::kappa_edge';
 case 'mhd'
  mapping.label = 'n=1,2, etc';
  mapping.method = 'switchcase';
  mapping.expression = '';
 case 'ne'
  mapping.method = 'switchcase';
 case 'neint'
  mapping.label = 'line integrated el. density';
  mapping.method = 'tdi';
  mapping.expression = '\results::fir:lin_int_dens';
 case 'nel'
  mapping.label = 'line-averaged el. density';
  mapping.method = 'tdi';
  mapping.expression = '\results::fir:n_average';
 case 'nerho'
  mapping.label = 'ne';
  mapping.method = 'switchcase';
 case 'neterho'
  mapping.label = 'ne and Te';
  mapping.method = 'switchcase';
 case 'ni'
  mapping.method = 'switchcase'; % especially since might have option fit, etc
 case 'powers'
  mapping.label = 'various powers';
  mapping.method = 'switchcase';
 case 'q0'
  mapping.method = 'tdi';
  mapping.expression = '\results::q_zero';
 case 'q95'
  mapping.method = 'tdi';
  mapping.expression = '\results::q_95';
 case 'qedge'
  mapping.method = 'tdi';
  mapping.expression = '\results::q_edge';
 case 'qrho'
  mapping.label = 'q';
  mapping.method = 'switchcase';
 case 'rgeom'
  mapping.label = 'Rgeom';
  mapping.method = 'switchcase';
 case 'rhovol'
  mapping.label = 'rhovol\_norm';
  mapping.method = 'switchcase'; % from conf if exist otherwise computes it
 case 'rmag'
  mapping.label = 'R\_magaxis';
  mapping.method = 'tdi';
  mapping.expression = '\results::r_axis';
 case 'sxr'
  mapping.method = 'switchcase';
 case 'te'
  mapping.label = 'Te';
  mapping.method = 'switchcase';
 case 'terho'
  mapping.label = 'Te';
  mapping.method = 'switchcase';
 case 'ti'
  mapping.label = 'Ti';
  mapping.method = 'switchcase';
 case 'transp'
  mapping.label = 'transp output';
  mapping.method = 'switchcase';
 case 'vloop'
  mapping.label = '';
  mapping.method = 'tdi';
  mapping.expression = '';
 case 'vol'
  mapping.label = 'Volume';
  mapping.method = 'switchcase';
  % mapping.expression = '\results::psitbx:vol'; (if exists for liuqe2 and 3 as well)
 case 'zeff'
  mapping.label = 'zeff from Ip-Ibs';
  mapping.method = 'tdi';
  mapping.expression = '\results::ibs:z_eff';
 case 'zgeom'
  mapping.label = 'Zgeom';
  mapping.method = 'switchcase';
 case 'zmag'
  mapping.label = 'Zmagaxis';
  mapping.method = 'tdi';
  mapping.expression = '\results::z_axis';
% $$$  case ''
% $$$   mapping.label = '';
% $$$   mapping.method = 'tdi';
% $$$   mapping.expression = '';
 otherwise
  mapping.label = data_request;
  mapping.method = 'tdi'; % assume a full tracename is given, so just try with tdi (could check there are some ":", etc...)
  mapping.expression = data_request;
  
end


