Commit f273fb4c authored by Lore, Jeremy's avatar Lore, Jeremy
Browse files

update some d3d routines

parent a551d231
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -3,16 +3,24 @@ clearvars;
% Channels 1:8 are on shelf, increasing in radius
% 9:19 are inner div, moving down center stack then out in radius

SAVE_IT = 0;
tWinMS = [3200,4000];
% elmWin = [0.0,1.0];
elmWin = [0.3,0.7];
crangeElmPlot = 2;  % Colorbar control for ELM cycle plot: 1 = [0,1], else tight to elmWin set above
elmThreshNorm = 0.1;
elmTimeNoRepeatMS = 1;
signalNamePlot = 'heatflux';  % Just used to make figures
% signalNamePlot = 'heatflux';  % Just used to make figures
signalNamePlot = 'jsat';  % Just used to make figures
% signalNamePlot = 'dens';  % Just used to make figures
% gfile_name = 'C:\Users\jjl\Dropbox (ORNL)\DIII-D\Qprl experiment\power13mw\g174310.03500_153';

fileNameLP = 'C:\Users\jjl\Dropbox (ORNL)\DIII-D\Qprl experiment\1743XX\LP_174306.mat';
elmFile = 'C:\Users\jjl\Dropbox (ORNL)\DIII-D\Qprl experiment\1743XX\fs_174306_2000_5000.mat';

% fileNameLP = 'C:\Users\jjl\Dropbox (ORNL)\DIII-D\Qprl experiment\1743XX\LP_174310.mat';
% elmFile = 'C:\Users\jjl\Dropbox (ORNL)\DIII-D\Qprl experiment\1743XX\fs_174310_2000_5000.mat';

[filepath,name,ext] = fileparts(fileNameLP);
outfile = fullfile(filepath,[name,'_processed',ext]);

@@ -47,7 +55,7 @@ for i = 1:length(LP.Shelf.chan)
end
plot(LP.Profiles.Shelf.dLSepOut,medflt1d_jl(LP.Profiles.Shelf.(signalNamePlot),100))
% plot(LP.ProfilesELMFiltered.Shelf.dLSepOut,LP.ProfilesELMFiltered.Shelf.(signalNamePlot),'ko')
plot(LP.ProfilesELMFiltered.Shelf.dLSepOut,medflt1d_jl(LP.ProfilesELMFiltered.Shelf.(signalNamePlot),100),'k')
plot(LP.ProfilesELMFiltered.Shelf.dLSepOut,medflt1d_jl(LP.ProfilesELMFiltered.Shelf.(signalNamePlot),100),'k','linew',2)



@@ -71,6 +79,7 @@ xlabel('dL_{sep} Outer')
ylabel(signalNamePlot)
title('Shelf')
colormap(colorflipper(num_col,'plasma'));
set(gca,'clim',crange)


figure; hold on; box on; grid on; set(gcf,'color','w');
@@ -82,10 +91,11 @@ for i = 1:length(LP.Inner.chan)
    ylabel(signalNamePlot)
    title('Inner')
end
plot(LP.ProfilesELMFiltered.Inner.dLSepIn,medflt1d_jl(LP.ProfilesELMFiltered.Inner.(signalNamePlot),100),'k')
plot(LP.ProfilesELMFiltered.Inner.dLSepIn,medflt1d_jl(LP.ProfilesELMFiltered.Inner.(signalNamePlot),100),'k','linew',2)

if SAVE_IT
save(outfile,'LP');

end

function LP = filterLPElms(LP,Spikes,elmWin)

+12 −6
Original line number Diff line number Diff line
@@ -19,17 +19,22 @@ g = readg_g3d(gfile_name);
%         fname ='C:\Work\DIII-D\APS 2016\2dts_data\dts_fitted1d_osp_multishot_156871156872156873156874_remapto156855at4527msEFIT04_fuelD_ioncharge1_gamma7p539_see0p000_weightedfits.dat';        
% end
run_path = 'C:\Users\jjl\Dropbox (ORNL)\DIII-D\Qprl experiment\1743XX\';

fname = fullfile(run_path,'dts_fitted1d_osp_174306_2000to5000msEFIT03_remapto3500msEFIT03_fuelD_ioncharge1_gamma7p539_see0p000_weightedfits.dat');
outfile = fullfile(run_path,'dts_osp_174306.mat');

% fname = fullfile(run_path,'dts_fitted1d_osp_174310_3000to4800msEFIT03_remapto174306at3500msEFIT03_fuelD_ioncharge1_gamma7p539_see0p000_weightedfits.dat');
% outfile = fullfile(run_path,'dts_osp_174310.mat');


ts2d = read_2dts_dat_file(fname);

WRITE_IT = 1;
WRITE_IT = 0;

plot_log = 0;

minval_Te = 0.4;
maxval_Te = 100;
minval_Te = 0.5;
maxval_Te = 200;

minval_ne = 0.02;  % e 20
maxval_ne = 1;
@@ -41,7 +46,9 @@ PLOT_TE =1;
PLOT_NE = 1;
PLOT_Q = 1;

colorMapName = 'parula';
% colorMapName = 'parula';
colorMapName = 'plasma';
% colorMapName = 'rainbow';

% ichan_use = 0;  %0:7
ichan_use = 0:7;  %0:7
@@ -197,7 +204,6 @@ if WRITE_IT
        
        if ichan_use == 0
                        
            
            fname_out = fullfile(pathstr,strcat('Te_2DTS_1D_chan0_targ_',fname_out_part,'.dat'));
            fprintf('Writing Te data to file: %s\n',fname_out)
            fid = fopen(fname_out,'w');