diff --git a/crpptbx/AUG/aug_requests_mapping.m b/crpptbx/AUG/aug_requests_mapping.m index 28f2a130a03585b7e1f716f6dc7c93d01da78623..bbb93eb0d1ebcdb936b2b9978f8a9711e3c54423 100644 --- a/crpptbx/AUG/aug_requests_mapping.m +++ b/crpptbx/AUG/aug_requests_mapping.m @@ -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'; diff --git a/crpptbx/gdat_plot.m b/crpptbx/gdat_plot.m index 5a4b41105294a062a465c1c36a2811351428c69d..8aabf51b7d1048434adcb0a663145ea4ff954971 100644 --- a/crpptbx/gdat_plot.m +++ b/crpptbx/gdat_plot.m @@ -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')