Newer
Older

Olivier Sauter
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function mapping = imas_requests_mapping(data_request,shot)
%
% Information pre-defined for gdat_imas, you can add cases here to match official cases in gdat_imas, allowing backward compatibility
%
% give the shot number in case data origin depends on the shot number, allows to adapt easily
%
% Defaults
mapping = struct(...
'label', '', ...
'method', '', ...
'expression','', ...
'timedim', -1, ... % dim which is the time is the database, to copy in .t, the other dims are in .x (-1 means last dimension)
'gdat_timedim',[], ... % if need to reshape data and dim orders to have timedim as gdat_timedim (shifting time to gdat_timedim)
'min', -inf, ...
'max', inf);
% Note that gdat_timedim is set to timedim at end of this function if empty
% gdat_timedim should have effective index of the time dimension in gdat
if ~exist('data_request') || isempty(data_request)
return
end
% default label: data_request keyword itself
mapping.label = data_request;
%
% label is used for plotting
switch lower(data_request)
case 'ids'
mapping.timedim = 1;
mapping.label = 'ids ala imas';
mapping.method = 'switchcase';
otherwise
mapping.label = data_request;
mapping.method = 'switchcase';
mapping.expression = data_request;
end
if isempty(mapping.gdat_timedim)
mapping.gdat_timedim = mapping.timedim;
end