Skip to content
Snippets Groups Projects

add h89p gas_valve and add automatic shots in legend with gdat_plot

Merged Olivier Sauter requested to merge add_gasvalve_h89p into master
3 files
+ 67
10
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 41
3
@@ -1287,7 +1287,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
@@ -1287,7 +1287,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
'plot_eqdsk, write_eqdsk, read_eqdsk can be used'];
'plot_eqdsk, write_eqdsk, read_eqdsk can be used'];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case {'gas', 'gas_flux', 'gas_request', 'gas_feedforward'}
case {'gas', 'gas_flux', 'gas_request', 'gas_feedforward','gas_valve'}
params_eff = gdat_data.gdat_params;
params_eff = gdat_data.gdat_params;
params_eff.data_request = '\diagz::flux_gaz:piezo_1:flux';
params_eff.data_request = '\diagz::flux_gaz:piezo_1:flux';
gasflux = gdat_tcv(gdat_data.shot,params_eff);
gasflux = gdat_tcv(gdat_data.shot,params_eff);
@@ -1318,11 +1318,49 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
@@ -1318,11 +1318,49 @@ elseif strcmp(mapping_for_tcv.method,'switchcase')
gdat_data.data = gdat_data.gas_feedforward_volt.data;
gdat_data.data = gdat_data.gas_feedforward_volt.data;
gdat_data.units = gdat_data.gas_feedforward_volt.units;
gdat_data.units = gdat_data.gas_feedforward_volt.units;
gdat_data.t = gdat_data.gas_feedforward_volt.t;
gdat_data.t = gdat_data.gas_feedforward_volt.t;
 
case {'gas_valve'}
 
if ~isfield(params_eff,'source') || isempty(params_eff.source)
 
params_eff.source = {{1,'D2'}, {3,'N2'}};
 
end
 
if iscell(params_eff.source) && numel(params_eff.source)>0 && numel(params_eff.source{1})>1
 
gdat_data.units = '';
 
for i=1:numel(params_eff.source)
 
try
 
[aat,aad] = get_gas_flux(shot,params_eff.source{i}{1},params_eff.source{i}{2});
 
gdat_data.gas_valve(i).t = aat;
 
gdat_data.gas_valve(i).data = aad;
 
gdat_data.gas_valve(i).valve_nb = params_eff.source{i}{1};
 
gdat_data.gas_valve(i).gas_type = params_eff.source{i}{2};
 
gdat_data.gas_valve(i).units = 'Molecules/s';
 
if ~strcmp(gdat_data.gas_valve(i).gas_type(end),'2'); gdat_data.gas_valve(i).units = 'atoms/s'; end
 
gdat_data.data(:,i) = gdat_data.gas_valve(i).data;
 
gdat_data.t = gdat_data.gas_valve(i).t;
 
gdat_data.dim{1}(i) = gdat_data.gas_valve(i).valve_nb;
 
gdat_data.units{i} = gdat_data.gas_valve(i).units;
 
gdat_data.label = [gdat_data.label ',' gdat_data.gas_valve(i).gas_type];
 
if i==1
 
gdat_data.dim{2} = gdat_data.t;
 
gdat_data.dimunits{1} = 'valve nb';
 
gdat_data.dimunits{2} = 's';
 
gdat_data.mapping_for.tcv.gdat_timedim = 2;
 
gdat_data.mapping_for.tcv.timedim = 2;
 
end
 
catch ME
 
gdat_data.gas_valve(i).t = [];
 
gdat_data.gas_valve(i).data = [];
 
gdat_data.gas_valve(i).valve_nb = params_eff.source{i}{1};
 
gdat_data.gas_valve(i).gas_type = params_eff.source{i}{2};
 
gdat_data.gas_valve(i).units = '';
 
end
 
end
 
end
otherwise
otherwise
error('gas option not defined')
error('gas option not defined')
end
end
gdat_data.dim{1} = gdat_data.t;
if ~strcmp(data_request_eff,'gas_valve')
gdat_data.dimunits{1} = 's';
gdat_data.dim{1} = gdat_data.t;
 
gdat_data.dimunits{1} = 's';
 
end
if isfield(gdat_data.gdat_params,'time_out') && ~isempty(gdat_data.gdat_params.time_out)
if isfield(gdat_data.gdat_params,'time_out') && ~isempty(gdat_data.gdat_params.time_out)
[gdat_data] = gdat2time_out(gdat_data,1);
[gdat_data] = gdat2time_out(gdat_data,1);
elseif ~isfield(gdat_data.gdat_params,'time_out')
elseif ~isfield(gdat_data.gdat_params,'time_out')
Loading