Commit 623440df authored by Olivier Sauter's avatar Olivier Sauter
Browse files

fix some rad_bulk

parent 8ed579b4
Pipeline #45642 passed with stage
in 3 minutes and 4 seconds
......@@ -1382,6 +1382,8 @@ elseif strcmp(mapping_for_jet.method,'switchcase')
try
rad=gdat_jet(shot,params_eff);
catch
rad.data = [];
rad.dim = [];
end
if ~isempty(rad.data) && ~isempty(rad.dim)
for i=1:length(fields_to_copy)
......@@ -1429,12 +1431,26 @@ elseif strcmp(mapping_for_jet.method,'switchcase')
params_eff.data_request = {'ppf','bolo','tobu'};
rad_bulk2=gdat_jet(shot,params_eff);
gdat_data.rad_bulk_u = rad_bulk2.data;
gdat_data.rad_bulk_t = rad_bulk1.t;
if numel(rad_bulk1.data) == numel(rad_bulk2.data)
if ~isempty(rad_bulk1.t) || isempty(rad_bulk2.t)
gdat_data.rad_bulk_t = rad_bulk1.t;
else
gdat_data.rad_bulk_t = rad_bulk2.t;
end
if isempty(gdat_data.rad_bulk_t)
gdat_data.rad_bulk_avg = [];
elseif numel(rad_bulk1.data) == numel(rad_bulk2.data)
gdat_data.rad_bulk_avg = 0.5.*(rad_bulk1.data+rad_bulk2.data);
else
abc=interpos(rad_bulk2.t,rad_bulk2.data,gdat_data.rad_bulk_t,-0.1);
gdat_data.rad_bulk_avg = 0.5.*(rad_bulk1.data+abc);
if isempty(rad_bulk1.data)
abc=interpos(rad_bulk2.t,rad_bulk2.data,gdat_data.rad_bulk_t,-0.1);
gdat_data.rad_bulk_avg = abc;
elseif isempty(rad_bulk2.data)
abc=interpos(rad_bulk1.t,rad_bulk1.data,gdat_data.rad_bulk_t,-0.1);
gdat_data.rad_bulk_avg = abc;
else
abc=interpos(rad_bulk2.t,rad_bulk2.data,gdat_data.rad_bulk_t,-0.1);
gdat_data.rad_bulk_avg = 0.5.*(rad_bulk1.data+abc);
end
end
end
gdat_data.t = rad.t;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment