diff --git a/TCV/loadTCVdata.m b/TCV/loadTCVdata.m index 2121424849a62b0bb7a1d53136cf3e828d028997..02d630ba57b05b15e1207f4ffb97d85dc84b263a 100644 --- a/TCV/loadTCVdata.m +++ b/TCV/loadTCVdata.m @@ -6,7 +6,7 @@ % data_type: type of the required data. Ex.: 'Ip', 'zmag', 'rmag','sxr', 'ece', 'sxR' % 'MPX' % optional: -% varargin{1}: channel status 1= unread yet, 0= read +% varargin{1}: channel status 1= unread yet, 0= read % varargin{2}: [i1 i2] : if not empty, assumes need many chords from i1 to i2 % varargin{3}: zmag for varargout{1} computation % @@ -17,7 +17,7 @@ % varargout{1}: intersection of the view lines with magnetic axis % % function needed: mds functions-xtomo_geometry-get_xtomo_data (Furno's routines) -% VsxrTCVradius +% get_mdsdata (Reimerdes's routine)VsxrTCVradius % list of data_type currently available: % 'Ip' = current % 'zmag' = vertical position of the center of the plasma (magnetic axis) @@ -74,8 +74,33 @@ else end disp(['loading' ' ' data_type ' from TCV shot #' num2str(shot)]); disp(['case ' TCVkeywrdcase{index}]) +status=ones(1,100); +nargineff=nargin; +if nargineff>=3 + if isstruct(varargin{1}) + zmag=varargin{1}; + elseif size(varargin{1},2)>2 + status=varargin{1}; + if nargineff>=4 + if isstruct(varargin{2}) + zmag=varargin{2}; + else + i1 =varargin{2}(1); + i2 =varargin{2}(2); + if nargineff==5, zmag=varargin{3}; end + end + end + else + i1 =varargin{1}(1); + i2 =varargin{1}(2); + if nargineff>=4, zmag=varargin{2}; end + end +end + switch TCVkeywrdcase{index} + + case 'simpletdi' % load TCV other data @@ -109,12 +134,10 @@ switch TCVkeywrdcase{index} % load TCV soft x-ray data % camera selection: 1-10. each camera has 20 channels icamera=[0 1 0 0 0 0 0 0 0 0]; %index of the camera to use - status=varargin{1}; if ~isempty(find(status(1:20*icamera*ones(10,1)) == 1)) [fans,vangle,xchord,ychord,aomega,angfact]=xtomo_geometry(1,icamera); % calculating intersection of the view lines with magnetic axis - if strcmp(data_type,'sxR') - zmag=varargin{3}; + if strcmp(data_type,'sxR') varargout={VsxrTCVradius(zmag.data,xchord,ychord)}; t_1=zmag.t(1); t_2=zmag.t(end); @@ -133,7 +156,6 @@ switch TCVkeywrdcase{index} case 'ece' % load TCV ECE data - status=varargin{2}; % Status=1 => Not Read Yet if ~isempty(find(status == 1)) [TE_ECE,TE_ECE_ERR,RHO,R,T,TE_THOM,TE_THOM_ERR,Fcentral,CAL]=ece_te ... @@ -152,9 +174,7 @@ switch TCVkeywrdcase{index} case 'MPX' % load TCV MPX data - status=varargin{1}; % Status=1 => Not Read Yet - zmag=varargin{3}; t_1=zmag.t(1); t_2=zmag.t(end); if ~isempty(find(status == 1))