Commit d89b6686 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

add further traces

parent f742e6aa
Loading
Loading
Loading
Loading
Loading
+22 −15
Changes for matlab/D3D/d3d_requests_mapping.m: 22 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -70,11 +70,6 @@ switch lower(data_request)
  mapping.timedim = 1;
  mapping.gdat_timedim = 2;
  mapping.method = 'switchcase';
 case {'cxrs', 'cxrs_rho'}
  mapping.timedim = 2;
  mapping.label = 'cxrs';
  mapping.method = 'switchcase';
  mapping.expression = '';
 case 'delta'
  mapping.timedim = 1;
  mapping.label = 'delta';
@@ -194,9 +189,6 @@ switch lower(data_request)
                    'gdat_tmp.gdat_request=''' data_request ''';' ...
                    'gdat_tmp.data_smooth=interpos(gdat_tmp.t,gdat_tmp.data,-3e7);' ...
                    'gdat_tmp.data_smooth=max(0.,gdat_tmp.data_smooth);'];
 case 'ne'
  mapping.timedim = 2;
  mapping.method = 'switchcase';
 case {'neint'}
  mapping.timedim = 1;
  mapping.label = 'line integrated el. density';
@@ -219,7 +211,7 @@ switch lower(data_request)
  mapping.label = 'NEBAR\_R0';
  mapping.method = 'signal';
  mapping.expression = [{'efit01'},{'\NEBAR_R0'}];
 case 'ne_rho'
 case {'ne', 'ne_rho'}
  mapping.timedim = 2;
  mapping.label = 'ne';
  mapping.method = 'switchcase';
@@ -252,6 +244,15 @@ switch lower(data_request)
                    'tmp_data2=interp1(gdat_tmp2.t,gdat_tmp2.data,gdat_tmp.t,[],NaN);' ...
                    'gdat_tmp.data = gdat_tmp.data*1e6./(tmp_data2+1e-5);' ...
                    'gdat_tmp.units='''';gdat_tmp.dimunits{1}=''s'';'];
 case {'f2b', 'pcf2b'}
  mapping.label = {'pcf2b','f2b'}';
  mapping.timedim = 1;
  mapping.method = 'expression';
  mapping.expression = ['params_eff = gdat_data.gdat_params;params_eff.data_request=[{''d3d''},{''ptdata("pcf2b")''}];' ...
                    'gdat_tmp=gdat_d3d(shot,params_eff);params_eff = gdat_data.gdat_params;' ...
                    'params_eff.data_request=[{''d3d''},{''ptdata("f2b")''}];gdat_tmp2=gdat_d3d(shot,params_eff);' ...
		    'gdat_tmp.data(:,2) = interp1(gdat_tmp2.t,gdat_tmp2.data,gdat_tmp.t);' ...
                    'gdat_tmp.gdat_request=''' data_request ''';'];
 case 'pgyro'
  mapping.timedim = 1;
  mapping.label = 'EC gyros';
@@ -290,6 +291,11 @@ switch lower(data_request)
  mapping.label = 'q_0';
  mapping.method = 'signal';
  mapping.expression = [{'EFIT01'},{'\q0'}];
 case 'qmin'
  mapping.timedim = 1;
  mapping.label = 'q_min';
  mapping.method = 'signal';
  mapping.expression = [{'EFIT01'},{'\qmin'}];
 case 'q95'
  mapping.timedim = 1;
  mapping.label = 'q_{95}';
@@ -305,6 +311,11 @@ switch lower(data_request)
  mapping.gdat_timedim = 2;
  mapping.label = 'q';
  mapping.method = 'switchcase';
 case {'rot', 'cerqrot'}
  mapping.timedim = 2;
  mapping.label = 'cerqrot';
  mapping.method = 'switchcase';
  mapping.expression = '';
 case 'r0'
  mapping.timedim = 1;
  mapping.label = 'R_0';
@@ -346,7 +357,7 @@ switch lower(data_request)
  mapping.timedim = 2;
  mapping.label = 'rhovol\_norm';
  mapping.method = 'switchcase';
 case 'rmag'
 case {'rmag', 'r_mag', 'r_axis'}
  mapping.label = 'R\_magaxis';
  mapping.timedim = 1;
  mapping.method = 'signal';
@@ -360,11 +371,7 @@ switch lower(data_request)
  mapping.timedim = 1;
  mapping.method = 'signal';
  mapping.expression = [{'TOT'},{'tau_tot'},{'D3DD'}];
 case 'te'
  mapping.timedim = 2;
  mapping.label = 'Te';
  mapping.method = 'switchcase';
 case 'te_rho'
 case {'te', 'te_rho'}
  mapping.timedim = 2;
  mapping.label = 'Te';
  mapping.method = 'switchcase';
+97 −20
Changes for matlab/D3D/gdat_d3d.m: 97 added lines, 20 removed lines.
Original line number Diff line number Diff line
@@ -788,37 +788,45 @@ elseif strcmp(mapping_for_d3d.method,'switchcase')
   case {'ne','te'}
    exp_name_eff = gdat_data.gdat_params.exp_name;
    % ne or Te from Thomson data on raw z mesh vs (z,t)
    nodenameeff = [upper(data_request_eff(1)) 'e_c'];
    node_child_nameeff = [upper(data_request_eff(1)) 'e_core'];
    [a,error_status]=rdaD3D_eff(shot,'VTA',nodenameeff,exp_name_eff);
    if isempty(a.data) || isempty(a.t) || error_status>0
    if strcmp(data_request_eff,'te')
      node_leaf = 'TEMP';
    else
      node_leaf = 'DENSITY';
    end
    % core
    nodenameeff = ['TS.BLESSED.CORE:' node_leaf];
    a = gdat_d3d(shot,{'electrons',nodenameeff});
    if isempty(a.data) || isempty(a.t)
      if gdat_params.nverbose>=3;
	a
	disp(['with data_request= ' data_request_eff])
      end
      return
    end
    gdat_data.(lower(node_child_nameeff)).data = a.data;
    gdat_data.(lower(node_child_nameeff)).t = a.t;
    gdat_data.t = a.t;
    gdat_data.x = a.x;
    gdat_data.gdat_params.tree = a.gdat_params.tree;
    gdat_data.gdat_params.equil = a.gdat_params.equil;
    if any(strcmp(fieldnames(a),'units'))
      gdat_data.units=a.units;
    end
    [alow,e]=rdaD3D_eff(shot,'VTA',[upper(data_request_eff(1)) 'elow_c'],exp_name_eff);
    [aup,e]=rdaD3D_eff(shot,'VTA',[upper(data_request_eff(1)) 'eupp_c'],exp_name_eff);
    gdat_data.(lower(node_child_nameeff)).error_bar = max(aup.value-gdat_data.(lower(node_child_nameeff)).data,gdat_data.(lower(node_child_nameeff)).data-alow.value);
    [a,error_status]=rdaD3D_eff(shot,'VTA','R_core',exp_name_eff);
    gdat_data.(lower(node_child_nameeff)).r = repmat(a.data,size(gdat_data.(lower(node_child_nameeff)).data,1),1);
    [a,error_status]=rdaD3D_eff(shot,'VTA','Z_core',exp_name_eff);
    gdat_data.(lower(node_child_nameeff)).z = repmat(a.data',1,size(gdat_data.(lower(node_child_nameeff)).data,2));
    gdat_data.dimunits=[{'Z [m]'} ; {'time [s]'}];
    gdat_data.data_fullpath=[data_request_eff ' from VTA/' upper(data_request_eff(1)) 'e_c and ' upper(data_request_eff(1)) 'e_e'];
    nb_core = size(gdat_data.(lower(node_child_nameeff)).z,1);
    gdat_data.data = [];
    gdat_data.data(1:nb_core,:) = gdat_data.(lower(node_child_nameeff)).data(1:nb_core,:);
    gdat_data.dim=[{gdat_data.(lower(node_child_nameeff)).z};{gdat_data.(lower(node_child_nameeff)).t}];
    gdat_data.error_bar(1:nb_core,:) = gdat_data.(lower(node_child_nameeff)).error_bar(1:nb_core,:);
    gdat_data.core.data = a.data';
    gdat_data.core.t = a.t;
    gdat_data.core.x = a.x;
% $$$     gdat_data.(lower(node_child_nameeff)).error_bar = max(aup.value-gdat_data.(lower(node_child_nameeff)).data,gdat_data.(lower(node_child_nameeff)).data-alow.value);

% $$$     [a,error_status]=rdaD3D_eff(shot,'VTA','R_core',exp_name_eff);
% $$$     gdat_data.(lower(node_child_nameeff)).r = repmat(a.data,size(gdat_data.(lower(node_child_nameeff)).data,1),1);
% $$$     [a,error_status]=rdaD3D_eff(shot,'VTA','Z_core',exp_name_eff);
    gdat_data.z = gdat_data.x;
    gdat_data.data_fullpath=[data_request_eff 'from ' nodenameeff];
    nb_core = numel(gdat_data.x);
    gdat_data.data = a.data'; % to get time as 2nd dim
    % gdat_data.data(1:nb_core,:) = gdat_data.data(1:nb_core,:);
    gdat_data.dim=[{gdat_data.z};{gdat_data.t}];
    gdat_data.dimunits=[{'Z [m]'}; {'time [s]'}];
% $$$     gdat_data.error_bar(1:nb_core,:) = gdat_data.error_bar(1:nb_core,:);
    return
    % add edge part
    nodenameeff_e = [upper(data_request_eff(1)) 'e_e'];
    node_child_nameeff_e = [upper(data_request_eff(1)) 'e_edge'];
@@ -1472,6 +1480,75 @@ elseif strcmp(mapping_for_d3d.method,'switchcase')
      gdat_data.data_fullpath = [DIAG '/PFL extract ' data_request_eff];
    end

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   case {'rot', 'cerqrot'}
    nth_points = 13;
    if isfield(gdat_data.gdat_params,'nth_points') && ~isempty(gdat_data.gdat_params.nth_points)
      nth_points = gdat_data.gdat_params.nth_points;
    else
      gdat_data.gdat_params.nth_points = nth_points;
    end
    channels = -1;
    if isfield(gdat_data.gdat_params,'channels') && ~isempty(gdat_data.gdat_params.channels)
      channels = gdat_data.gdat_params.channels;
    end
    diag_name = 'cerqrot';
    if nth_points>=10
      match_rz_to_time = 1;
    else
      match_rz_to_time = 0;
    end
    if isfield(gdat_data.gdat_params,'match_rz_to_time') && ~isempty(gdat_data.gdat_params.match_rz_to_time)
      match_rz_to_time = gdat_data.gdat_params.match_rz_to_time;
    else
      gdat_data.gdat_params.match_rz_to_time = match_rz_to_time;
    end
    time_interval = [-Inf +Inf];
    if isfield(gdat_data.gdat_params,'time_interval') && ~isempty(gdat_data.gdat_params.time_interval)
      time_interval = gdat_data.gdat_params.time_interval;
    else
      gdat_data.gdat_params.time_interval = time_interval;
    end
    %
    if channels(1)<=0
      channels = [1:24];
    end
    chanelles=sort(channels);
    gdat_data.dim{1} = channels;
    gdat_data.gdat_params.channels = channels;
    max_points = 0;
    for i=channels
      aall{i} = gdat_d3d(shot,['\cerqrott' num2str(i)]);
      if isnumeric(aall{i}.data) 
        gdat_data.channels_ok(i) = 1;
        if numel(aall{i}.data) > max_points
          max_points = numel(aall{i}.data);
          gdat_data.t = aall{i}.t;
        end
      else
        gdat_data.channels_ok(i) = 0;
      end
    end
    gdat_data.dim{2} = gdat_data.t;
    gdat_data.data = NaN(max(channels),max_points);
    for i=channels
      if gdat_data.channels_ok(i)
        if nth_points>1
          ieff = [1:nth_points:numel(aall{i}.data)];
          iteff = iround_os(gdat_data.t,aall{i}.t(ieff));
          gdat_data.data(i,iteff) = interp1(aall{i}.t,aall{i}.data,gdat_data.t(iteff));
        else
          iteff = iround_os(gdat_data.t,aall{i}.t);
          gdat_data.data(i,iteff) = interp1(aall{i}.t,aall{i}.data,gdat_data.t(iteff));
        end
      end
    end
    gdat_data.x = gdat_data.dim{1};
    gdat_data.dimunits=[{'channels'} ; {'time [s]'}];
    %if any(strcmp(fieldnames(a),'units')); gdat_data.units=a.units; end
    gdat_data.data_fullpath = [diag_name '\tcerqrot' num2str(channels(1)) '...' num2str(channels(end))];
    gdat_data.allchannels = aall;
	
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   case {'rhotor', 'rhotor_edge', 'rhotor_norm', 'rhovol', 'volume_rho'}
    if strcmp(upper(gdat_data.gdat_params.equil),'FPG')