Skip to content
Snippets Groups Projects
Commit ec3c40f0 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

add mhd for aug and gdat_plot spectrogram for mhd

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@5210 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 6f2f197a
No related branches found
No related tags found
No related merge requests found
......@@ -135,9 +135,17 @@ switch lower(data_request)
mapping.expression = [{'FPG'},{'k'}];
case 'mhd'
mapping.timedim = 1;
mapping.label = 'n=1,2, etc';
mapping.method = 'switchcase';
mapping.expression = '';
mapping.label = 'Odd and Even n';
mapping.method = 'expression';
mapping.expression = ['params_eff = gdat_data.gdat_params;params_eff.data_request={''MOD'',''OddN''}; ' ...
'gdat_tmp=gdat_aug(shot,params_eff);gdat_tmp.data=reshape(gdat_tmp.data,length(gdat_tmp.data),1 );' ...
'gdat_tmp.dim{1}=gdat_tmp.t;gdat_tmp.dim{2}=[1 2];gdat_tmp.x=gdat_tmp.dim{2};' ...
'gdat_tmp.n_odd.data = gdat_tmp.data;gdat_tmp.n_odd.data_request=params_eff.data_request;' ...
'params_eff.data_request={''MOD'',''EvenN''};' ...
'gdat_tmp2=gdat_aug(shot,params_eff);gdat_tmp.data(:,2)=reshape(gdat_tmp2.data,length(gdat_tmp2.data),1);' ...
'gdat_tmp.n_even.data = gdat_tmp2.data;gdat_tmp.n_even.data_request=params_eff.data_request;gdat_tmp.label={''n\_odd'',''n\_even''};' ...
'gdat_tmp.full_path=''MOD/Odd in data and .n_odd; .n_even'';' ...
'gdat_tmp.gdat_request=''mhd'';gdat_tmp.gdat_params.data_request=gdat_tmp.gdat_request;'];
case 'ne'
mapping.timedim = 2;
mapping.method = 'switchcase';
......
......@@ -79,6 +79,17 @@ if prod(isfield(gdat_data,{'data','t'})) && ~isempty(gdat_data.data) && ~isempty
% special case, add legend instead of ylabel
delete(hylabel);
legend(gdat_data.label,2);
% add spectrogram per signal
for i=1:size(gdat_data.data,2)
nfft=1024;
tmhdm=mean(reshape(gdat_data.t(1:nfft*fix(length(gdat_data.t)/nfft)),nfft,fix(length(gdat_data.t)/nfft)));
[B,F,T]=specgram(gdat_data.data(:,i),nfft,1/mean(diff(gdat_data.t)),hanning(nfft),nfft/2);
figure
imagesc(T+tmhdm(1),F/1e3,20*log10(abs(B)));axis xy;colormap jet;
ylabel('freq')
xlabel(gdat_data.dimunits{1})
title(gdat_data.label{i})
end
end
else
disp('cannot plot gdat_data, has empty data or t field')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment