diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m index 4925e0a7ef2131a9694d0d939238ea07c1432cd2..b6bd9e2fb51aae944c37abd53dfbe5b3cbadb74e 100644 --- a/matlab/TCV/gdat_tcv.m +++ b/matlab/TCV/gdat_tcv.m @@ -310,9 +310,12 @@ if liuqe_version_eff==2 || liuqe_version_eff==3 substr_liuqe_tcv_eq = num2str(liuqe_version_eff); end +mapping_for_tcv = tcv_requests_mapping(data_request_eff,shot); +gdat_data.label = mapping_for_tcv.label; % special treatment for model shot=-1 or preparation shot >=100'000 begstr = ''; -if ~isempty(shot) && (shot==-1 || (shot>=100000 && shot < 200000) || liuqe_version==-1 ) +if (iscell(mapping_for_tcv.expression) || isempty(strfind(mapping_for_tcv.expression,'\rtc::'))) && ... + ~isempty(shot) && (shot==-1 || (shot>=100000 && shot < 200000) || liuqe_version==-1 ) % requires FBTE liuqe_version_eff = -1; begstr = 'tcv_eq( "'; @@ -333,22 +336,21 @@ end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Specifications on how to get the data provided in tcv_requests_mapping -mapping_for_tcv = tcv_requests_mapping(data_request_eff,shot); -gdat_data.label = mapping_for_tcv.label; ishot=NaN; if do_mdsopen_mdsclose % mdsdefaultserver tcv1.epfl.ch; % should be in tcv general path, but set-it in the meantime... -%%% if liuqe_version_eff==-1 - if shot==-1 || liuqe_version_eff==-1 - ishot = mdsopen('pcs', shot); - else - if length(data_request_eff)>7 && strcmp(lower(data_request_eff(1:6)),'\rtc::') - ishot = mdsopen('rtc',shot); % sub-tree + %%% if liuqe_version_eff==-1 + if ~iscell(mapping_for_tcv.expression) && any(strfind(mapping_for_tcv.expression,'\rtc::')) + mdsdisconnect; + ishot = mdsopen('rtc',shot); % sub-tree + if any(strfind(data_request_eff,'\rtc::')) data_request_eff = data_request_eff(7:end); - mapping_for_tcv.expression = data_request_eff; - else - ishot = mdsopen(shot); % if ishot equal to shot, then mdsclose at the end end + mapping_for_tcv.expression = mapping_for_tcv.expression(7:end); + elseif shot==-1 || liuqe_version_eff==-1 + ishot = mdsopen('pcs', shot); + else + ishot = mdsopen(shot); % if ishot equal to shot, then mdsclose at the end end if isempty(ishot) || ishot~=shot if gdat_params.nverbose>=1; warning(['cannot open shot= ' num2str(shot)]); end diff --git a/matlab/TCV/tcv_requests_mapping.m b/matlab/TCV/tcv_requests_mapping.m index 53398c803c3df34efd41521ff1ac41bf7d077d31..8c03b9525fc8fda31e96f54871f21ef5a77bba13 100644 --- a/matlab/TCV/tcv_requests_mapping.m +++ b/matlab/TCV/tcv_requests_mapping.m @@ -132,6 +132,10 @@ switch lower(data_request) mapping.timedim = 0; mapping.method = 'switchcase'; % could use function make_eqdsk directly? mapping.expression = ''; + case 'expcode' + mapping.timedim = 0; + mapping.method = 'tdi'; + mapping.expression = '\rtc::node03.params.cfg_file'; case {'gas', 'gas_flux', 'gas_request', 'gas_feedforward'} mapping.timedim = 1; mapping.label = 'gas flux';