diff --git a/crpptbx/TCV/loadTCVdata.m b/crpptbx/TCV/loadTCVdata.m index 0d6b423258d54e711ad279a5dd33f5f6819b8fce..95954baedf909f08987bda41045e7bbc89bfe9f0 100644 --- a/crpptbx/TCV/loadTCVdata.m +++ b/crpptbx/TCV/loadTCVdata.m @@ -804,16 +804,38 @@ switch TCVkeywrdcase{index} case {'nerhozshift','terhozshift'} % ne or Te from Thomson data on rho=sqrt(psi_normalised) mesh: (rho,t) % allow for z shift of equil - if nargin>=2 & ~isempty(varargin{1}) + if nargin>=3 & ~isempty(varargin{1}) zshift=varargin{1}; else zshift=0.; end mdsopen(shot); + time=mdsdata('\results::thomson:times'); if strcmp(TCVkeywrdcase{index},'nerhozshift') nodenameeff='\results::thomson:ne'; tracetdi=tdi(nodenameeff); tracestd=tdi('\results::thomson:ne:error_bar'); + if shot>=23801 + tracefirrat=tdi('\results::thomson.profiles.auto:fir_thom_rat'); %time base not same!! + if isempty(tracefirrat.data) || ischar(tracefirrat.data) + disp('problem with \results::thomson.profiles.auto:fir_thom_rat: empty') + end + else + tracefirrat=tdi('\results::thomson:fir_thom_rat'); + if isempty(tracefirrat.data) || ischar(tracefirrat.data) + disp('problem with \results::thomson.profiles.auto:fir_thom_rat: empty') + tracefirrat.dim{1}=[]; + else + tracefirrat.dim{1}=time; + end + end + if ~isempty(tracefirrat.data) || ischar(tracefirrat.data) + tracefirrat_data=NaN*ones(size(tracetdi.dim{1})); + itim=iround(time,tracefirrat.dim{1}); + tracefirrat_data(itim)=tracefirrat.data; + else + tracefirrat_data=NaN; + end else nodenameeff='\results::thomson:te'; tracetdi=tdi(nodenameeff); @@ -821,9 +843,13 @@ switch TCVkeywrdcase{index} end trace.data=tracetdi.data'; % Thomson data as (t,z) trace.std=tracestd.data'; + if strcmp(TCVkeywrdcase{index},'nerhozshift') + trace.firrat=tracefirrat_data; + trace.data_abs=trace.data*diag(tracefirrat_data); + trace.std_abs=trace.std*diag(tracefirrat_data); + end trace.name=[num2str(shot) ';' nodenameeff]; % add correct dimensions - time=mdsdata('\results::thomson:times'); % construct rho mesh if strcmp(endstr,'_-1') error(['in ' TCVkeywrdcase{index} ' endstr should not be ' endstr]);