diff --git a/crpptbx/AUG/aug_help_parameters.m b/crpptbx/AUG/aug_help_parameters.m index 33acd39c327547ee36585a3ffd24e3dd8a5e7438..b38507f0e6f8cd6b93c152454b469a81ee7f1cd1 100644 --- a/crpptbx/AUG/aug_help_parameters.m +++ b/crpptbx/AUG/aug_help_parameters.m @@ -39,7 +39,7 @@ help_struct_all.cocos = ['cocos value desired in output, uses eqdsk_cocos_transf help_struct_all.fit = '0, no fit profiles, 1 (default) if fit profiles desired as well, relevant for _rho profiles. See also fit_type'; help_struct_all.fit_type = 'type of fits ''std'' (default) uses diagnostic error bars, ''pedestal'', uses manual error bars with smaller values outside 0.8'; help_struct_all.fit_nb_rho_points = 'nb of points for the radial mesh over which the fits are evaluated for the fitted profiles, it uses an equidistant mesh at this stage'; -help_struct_all.source = 'sxr: ''G'' (default, with ssx), camera name ''J'', ''G'', ...[[F-M], case insensitive;; cxrs: ''CEZ'' (default), ''CMZ'''; +help_struct_all.source = 'sxr: ''G'' (default, with ssx), camera name ''J'', ''G'', ...[[F-M], case insensitive;; cxrs: ''CEZ'' (default), ''CMZ'';; raptor: ''observer'', ''predictive'' (or ''obs'', ''pre'') to restrict the ouput to these signals'; help_struct_all.camera = ['[] (default, all), [i1 i2 ...] chord nbs ([1 3 5] if only chords 1, 3 and 5 are desired), ''central'' uses J_049']; help_struct_all.freq = '''slow'', default (means ssx, 500kHz), lower sampling; ''fast'' full samples 2MHz; integer value nn for downsampling every nn''th points'; %help_struct_all. = ''; diff --git a/crpptbx/AUG/aug_requests_mapping.m b/crpptbx/AUG/aug_requests_mapping.m index c234dae40f1539af968a111e72aa858f262096fb..db44b8604356072f50d2cbdb32d8137fe9d56956 100644 --- a/crpptbx/AUG/aug_requests_mapping.m +++ b/crpptbx/AUG/aug_requests_mapping.m @@ -135,10 +135,9 @@ switch lower(data_request) mapping.method = 'signal'; mapping.expression = [{'TTH'},{'H/L-facs'},{'AUGD'}]; mapping.method = 'expression'; - mapping.expression = ['params_eff = gdat_data.gdat_params;params_eff.data_request=[{''TTH''},{''Wmhd''},{''AUGD''}];' ... - 'gdat_tmp=gdat_aug(shot,params_eff);ij=find(~isnan(gdat_tmp.data)); gdat_tmp.data_raw=gdat_tmp.data;' ... - 'tmp_data=interpos(gdat_tmp.t(ij),gdat_tmp.data(ij),gdat_tmp.t,-1e5);' ... - 'gdat_tmp.data = max(tmp_data,0.);']; + mapping.expression = ['params_eff = gdat_data.gdat_params;params_eff.data_request=[{''TTH''},{''H/L-facs''},{''AUGD''}];params_eff.source=''TTH'';' ... + 'gdat_tmp=gdat_aug(shot,params_eff);S = sf2ps(''TTH'',shot,''scal_par'');gdat_tmp.dimunits{1}=cellstr(S.items(end).value'');' ... + 'gdat_tmp.data = min(gdat_tmp.data,10.);']; case 'ioh' mapping.timedim = 1; mapping.label = 'I ohmic transformer'; @@ -237,8 +236,8 @@ switch lower(data_request) 'gdat_tmp2=gdat_aug(shot,params_eff);ij=find(gdat_tmp2.data==0);gdat_tmp2.data(ij)=NaN;' ... 'tmp_data2=interp1(gdat_tmp2.t,gdat_tmp2.data,gdat_tmp.t,[],NaN);' ... 'gdat_tmp.data = gdat_tmp.data./(tmp_data2+1e-5);']; - case 'ni' - mapping.method = 'switchcase'; % especially since might have option fit, etc +% $$$ case 'ni' +% $$$ mapping.method = 'switchcase'; % especially since might have option fit, etc case 'pellet' mapping.timedim = 1; mapping.label = 'line integrated el. density'; @@ -275,18 +274,23 @@ switch lower(data_request) mapping.label = 'q_{95}'; mapping.method = 'signal'; mapping.expression = [{'FPG'},{'q95'},{'AUGD'}]; - case 'q_edge' - mapping.timedim = 1; - mapping.label = 'q_{edge}}'; - mapping.method = 'expression'; - mapping.method = 'switchcase'; - mapping.expression = [{'FPG'},{'q95'},{'AUGD'}]; - mapping.expression = []; +% $$$ case 'q_edge' % should use q_rho and then take q_edge since does not make sense for diverted shots and mainly diverted shots... +% $$$ mapping.timedim = 1; +% $$$ mapping.label = 'q_{edge}}'; +% $$$ mapping.method = 'expression'; +% $$$ mapping.method = 'switchcase'; +% $$$ mapping.expression = [{'FPG'},{'q95'},{'AUGD'}]; +% $$$ mapping.expression = []; case 'q_rho' mapping.timedim = 2; mapping.gdat_timedim = 2; mapping.label = 'q'; mapping.method = 'switchcase'; + case 'raptor' + mapping.timedim = 2; + mapping.gdat_timedim = 2; + mapping.label = 'Raptor signals'; + mapping.method = 'switchcase'; case 'rgeom' mapping.label = 'Rgeom'; mapping.timedim = 1; @@ -345,9 +349,9 @@ switch lower(data_request) mapping.timedim = 2; mapping.label = 'Te'; mapping.method = 'switchcase'; - case 'ti' - mapping.label = 'Ti'; - mapping.method = 'switchcase'; +% $$$ case 'ti' % case to be set +% $$$ mapping.label = 'Ti'; +% $$$ mapping.method = 'switchcase'; case 'vloop' mapping.label = 'Vloop'; mapping.timedim = 1; @@ -377,11 +381,11 @@ switch lower(data_request) 'gdat_tmp=gdat_aug(shot,params_eff);ij=find(~isnan(gdat_tmp.data)); gdat_tmp.data_raw=gdat_tmp.data;' ... 'tmp_data=interpos(gdat_tmp.t(ij),gdat_tmp.data(ij),gdat_tmp.t,-1e5);' ... 'gdat_tmp.data = max(tmp_data,0.);']; - case 'zeff' - mapping.label = 'zeff from cxrs'; - mapping.timedim = 1; - mapping.method = 'signal'; - mapping.expression = [{'ZES'},{'Zeff'},{'AUGD'}]; +% $$$ case 'zeff' % ZES obsolete, use cxrs +% $$$ mapping.label = 'zeff from cxrs'; +% $$$ mapping.timedim = 1; +% $$$ mapping.method = 'signal'; +% $$$ mapping.expression = [{'ZES'},{'Zeff'},{'AUGD'}]; case 'zgeom' mapping.label = 'Zgeom'; mapping.timedim = 1; diff --git a/crpptbx/AUG/gdat_aug.m b/crpptbx/AUG/gdat_aug.m index 2b37df269a4b15015328037987db14c8cbe0d710..70bc4e542b4dfcc3e4c062027b74346cccd893c3 100644 --- a/crpptbx/AUG/gdat_aug.m +++ b/crpptbx/AUG/gdat_aug.m @@ -1802,6 +1802,112 @@ elseif strcmp(mapping_for_aug.method,'switchcase') gdat_data.data_fullpath = [DIAG '/PFL extract ' data_request_eff]; end + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + case {'raptor'} + sources_avail = {'observer','predictive'}; + for i=1:length(sources_avail) + gdat_data.(sources_avail{i}).data = []; + gdat_data.(sources_avail{i}).units = []; + gdat_data.(sources_avail{i}).dim=[]; + gdat_data.(sources_avail{i}).dimunits=[]; + gdat_data.(sources_avail{i}).t=[]; + gdat_data.(sources_avail{i}).x=[]; + gdat_data.(sources_avail{i}).data_fullpath=[]; + gdat_data.(sources_avail{i}).label=[]; + end + rap_signals={'ECE_f','Hmode','Ip','P_LH','Phib','beta','cs','exflag','g_f','it','li3','ne_f','res','tcomp','ECEm', ... + 'F','Vp','chie','dk_k','dpsi','dte','g1','g23or','g2','g3','iota','jbs','jec','jnb','jpar','ne','ni', ... + 'p','paux','pbrem','pec','pei','pnbe','poh','prad','psi','q','rhtECE','sdk_k','shear','signeo','sxk_k', ... + 'te','ti','upl','xk_k','ze'}; + + rap_desc_signals={'rts:Dia/RAPTOR/ECEflag.val','rts:Dia/RAPTOR/Hmode.val','rts:Dia/RAPTOR/Ip.val','rts:Dia/RAPTOR/P_LH.val',... + 'rts:Dia/RAPTOR/Phib.val','rts:Dia/RAPTOR/beta.val','rts:Dia/RAPTOR/conf_state.val', ... + 'rts:Dia/RAPTOR/exitflag.val','rts:Dia/RAPTOR/gflag.val','rts:Dia/RAPTOR/it.val', ... + 'rts:Dia/RAPTOR/li3.val','rts:Dia/RAPTOR/neflag.val','rts:Dia/RAPTOR/res.val', ... + 'rts:Dia/RAPTOR/dtcomp.val','rts:Dia/RAPTOR/ECEmask.val','rts:Dia/RAPTOR/F.val', ... + 'rts:Dia/RAPTOR/Vp.val','rts:Dia/RAPTOR/chie.val','rts:Dia/RAPTOR/dk_k.val', ... + 'rts:Dia/RAPTOR/dpsi.val','rts:Dia/RAPTOR/dte.val','rts:Dia/RAPTOR/g1.val', ... + 'rts:Dia/RAPTOR/g23or.val','rts:Dia/RAPTOR/g2.val','rts:Dia/RAPTOR/g3.val', ... + 'rts:Dia/RAPTOR/iota.val','rts:Dia/RAPTOR/jbs.val','rts:Dia/RAPTOR/jec.val', ... + 'rts:Dia/RAPTOR/jnb.val','rts:Dia/RAPTOR/jpar.val','rts:Dia/RAPTOR/ne.val', ... + 'rts:Dia/RAPTOR/ni.val','rts:Dia/RAPTOR/p.val','rts:Dia/RAPTOR/paux.val', ... + 'rts:Dia/RAPTOR/pbrem.val','rts:Dia/RAPTOR/pec.val','rts:Dia/RAPTOR/pei.val', ... + 'rts:Dia/RAPTOR/pnbe.val','rts:Dia/RAPTOR/poh.val','rts:Dia/RAPTOR/prad.val', ... + 'rts:Dia/RAPTOR/psi.val','rts:Dia/RAPTOR/q.val','rts:Dia/RAPTOR/rhotorECE.val', ... + 'rts:Dia/RAPTOR/sdk_k.val','rts:Dia/RAPTOR/shear.val','rts:Dia/RAPTOR/signeo.val', ... + 'rts:Dia/RAPTOR/sxk_k.val','rts:Dia/RAPTOR/te.val','rts:Dia/RAPTOR/ti.val', ... + 'rts:Dia/RAPTOR/upl.val','rts:Dia/RAPTOR/xk_k.val','rts:Dia/RAPTOR/ze.val'}; + + if ~isfield(gdat_data.gdat_params,'source') || isempty(gdat_data.gdat_params.source) + gdat_data.gdat_params.source = sources_avail; + elseif ~iscell(gdat_data.gdat_params.source) + if ischar(gdat_data.gdat_params.source) + gdat_data.gdat_params.source = lower(gdat_data.gdat_params.source); + if strcmp(gdat_data.gdat_params.source{1}(1),'o'); gdat_data.gdat_params.source = 'observer'; end + if strcmp(gdat_data.gdat_params.source(1),'p'); gdat_data.gdat_params.source = 'predictive'; end + if ~any(strmatch(gdat_data.gdat_params.source,lower(sources_avail))) + if (gdat_params.nverbose>=1) + warning(['source= ' gdat_data.gdat_params.source ' is not part of the available sources: ' sprintf('''%s'' ',sources_avail{:})]); + end + return + else + gdat_data.gdat_params.source = {gdat_data.gdat_params.source}; + end + else + if (gdat_params.nverbose>=1); warning([' source parameter not compatible with: ' sprintf('''%s'' ',sources_avail{:})]); end + return + end + else + for i=1:length(gdat_data.gdat_params.source) + gdat_data.gdat_params.source{i} = lower(gdat_data.gdat_params.source{i}); + if strcmp(gdat_data.gdat_params.source{i}(1),'o'); gdat_data.gdat_params.source{i} = 'observer'; end + if strcmp(gdat_data.gdat_params.source{i}(1),'p'); gdat_data.gdat_params.source{i} = 'predictive'; end + if ~any(strmatch(gdat_data.gdat_params.source{i},lower(sources_avail))) + if gdat_data.gdat_params.nverbose>=1 + warning(['source = ' gdat_data.gdat_params.source{i} ' not expected with data_request= ' data_request_eff]) + end + end + end + end + + for i=1:length(gdat_data.gdat_params.source) + it_def=0; + for j=1:length(rap_signals) + gdat_params_prev = gdat_data.gdat_params; gdat_params_eff = gdat_params_prev; + gdat_params_eff.data_request = {'RAP',[rap_signals{j} '_' gdat_data.gdat_params.source{i}(1)],gdat_params_eff.exp_name}; + abcd = gdat_aug(gdat_data.shot,gdat_params_eff); + gdat_data.(gdat_data.gdat_params.source{i}).(rap_signals{j}) = abcd; + if strcmp(rap_signals{j},'q') && ~isempty(abcd.data) + % promote q at top level of gdat_data.(gdat_data.gdat_params.source{i}) + gdat_data.(gdat_data.gdat_params.source{i}).data = abcd.data; + gdat_data.(gdat_data.gdat_params.source{i}).t = abcd.t; + gdat_data.(gdat_data.gdat_params.source{i}).x = abcd.x; + gdat_data.(gdat_data.gdat_params.source{i}).units = ['q RAPTOR_' gdat_data.gdat_params.source{i}(1:3) ' various rho']; + gdat_data.(gdat_data.gdat_params.source{i}).dim = abcd.dim; + gdat_data.(gdat_data.gdat_params.source{i}).dimunits = abcd.dimunits; + gdat_data.(gdat_data.gdat_params.source{i}).dimunits{1} = 'various rhotor'; + gdat_data.(gdat_data.gdat_params.source{i}).data_fullpath = abcd.data_fullpath; + gdat_data.(gdat_data.gdat_params.source{i}).label = ['q RAPTOR_' gdat_data.gdat_params.source{i}(1:3) ' various rho']; + end + end + end + % + % promote somethin at top level of gdat_data? + % + gdat_data.data_fullpath = {'RAP','signals_o in observer _p in predictive, one signal(q) copied at top',gdat_data.gdat_params.exp_name}; + % promote predictive promoted signal if non-empty, otherwise observer one + if ~isempty(gdat_data.predictive.data) + source_promoted = 'predictive'; + else + source_promoted = 'observer'; + end + gdat_data.data = gdat_data.(source_promoted).data; + gdat_data.x = gdat_data.(source_promoted).x; + gdat_data.t = gdat_data.(source_promoted).t; + gdat_data.units = gdat_data.(source_promoted).units; + gdat_data.dim = gdat_data.(source_promoted).dim; + gdat_data.dimunits = gdat_data.(source_promoted).dimunits; + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% case {'rhotor', 'rhotor_edge', 'rhotor_norm', 'rhovol', 'volume_rho'} if strcmp(upper(gdat_data.gdat_params.equil),'FPG')