compass2luke

PURPOSE ^

SYNOPSIS ^

function data_out = compass2luke(shotnum)

DESCRIPTION ^

Read data in COMPASS database.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data_out = compass2luke(shotnum)
0002 %
0003 %Read data in COMPASS database.
0004 %
0005 cdb = cdb_client();
0006 disp('Start of reading signals from CDB')
0007 
0008 data_out.I_plasma = cdb.get_signal(['I_plasma:',num2str(shotnum)]);
0009 data_out.U_loop = cdb.get_signal(['U_loop_02:',num2str(shotnum)]);
0010 %
0011 % EFIT DATA (see the definitions on the COMPASS website
0012 % https://www.tok.ipp.cas.cz/webcdb/data_sources/EFIT)
0013 %
0014 data_out.efit.triangularity_lower_lcfs = cdb.get_signal(['triangularity_lower_lcfs/EFIT:',num2str(shotnum)]);
0015 data_out.efit.li = cdb.get_signal(['li/EFIT:',num2str(shotnum)]);% internal inductance
0016 data_out.efit.Ip = cdb.get_signal(['Ip/EFIT:',num2str(shotnum)]); 
0017 data_out.efit.q = cdb.get_signal(['q/EFIT:',num2str(shotnum)]); 
0018 %
0019 data_out.efit.psi_RZ = cdb.get_signal(['psi_RZ/EFIT:',num2str(shotnum)]);
0020 data_out.efit.psi_n = cdb.get_signal(['psi_n/EFIT:',num2str(shotnum)]);
0021 data_out.efit.psi_mag_axis = cdb.get_signal(['psi_mag_axis/EFIT:',num2str(shotnum)]); 
0022 data_out.efit.psi_lcfs = cdb.get_signal(['psi_lcfs/EFIT:',num2str(shotnum)]);
0023 %
0024 data_out.efit.R_mag_axis = cdb.get_signal(['R_mag_axis/EFIT:',num2str(shotnum)]);
0025 data_out.efit.Z_mag_axis = cdb.get_signal(['Z_mag_axis/EFIT:',num2str(shotnum)]); 
0026 data_out.efit.R_geom_axis = cdb.get_signal(['R_geom_axis/EFIT:',num2str(shotnum)]); 
0027 data_out.efit.Z_geom_axis = cdb.get_signal(['Z_geom_axis/EFIT:',num2str(shotnum)]); 
0028 %
0029 data_out.efit.B_vac_R_geom = cdb.get_signal(['B_vac_R_geom/EFIT:',num2str(shotnum)]); 
0030 data_out.efit.RBphi = cdb.get_signal(['RBphi/EFIT:',num2str(shotnum)]); 
0031 data_out.efit.FFprime = cdb.get_signal(['FFprime/EFIT:',num2str(shotnum)]); 
0032 data_out.efit.pprime_static = cdb.get_signal(['pprime_static/EFIT:',num2str(shotnum)]); 
0033 data_out.efit.p_stat = cdb.get_signal(['p_stat/EFIT:',num2str(shotnum)]); 
0034 %
0035 % NOT MEASURED
0036 % signal = cdb.get_signal('ion_temperature:7529');
0037 %
0038 % THOMSON SCATTERING DATA
0039 %
0040 try 
0041     data_out.ne = cdb.get_signal(['ne/THOMSON:',num2str(shotnum)]);
0042     data_out.te = cdb.get_signal(['Te/THOMSON:',num2str(shotnum)]);
0043 
0044 %         disp(['number of NaNs: ',num2str([length( find(isnan(data_out.ne.data))), length( find(isnan(data_out.te.data)))])]);
0045 %         disp(num2str(size(data_out.ne.data)))
0046 
0047     for it=1:length(data_out.ne.time_axis.data)
0048         indnan=isnan(data_out.ne.data(it,:));
0049 
0050         data_out.ne.data(it, indnan) = interp1 ( data_out.ne.axis1.data (~indnan), data_out.ne.data(it,~indnan),  ...
0051         data_out.ne.axis1.data(indnan)  );
0052 
0053         data_out.te.data(it, indnan) = interp1 ( data_out.te.axis1.data (~indnan), data_out.te.data(it,~indnan), ...
0054             data_out.te.axis1.data(indnan)  );                                        
0055 
0056         indnan=isnan(data_out.ne.data(it,:));
0057         data_out.ne.data(it,indnan) = min(data_out.ne.data(it,:));
0058         data_out.te.data(it,indnan) = min(data_out.te.data(it,:));
0059     end
0060 
0061 %         disp(num2str(size(data_out.ne.data)))
0062 %         disp(num2str(data_out.ne.data));
0063     disp(['Number of NaNs in THOMSON data: ',num2str([length( find(isnan(data_out.ne.data))), length( find(isnan(data_out.te.data)))])]);
0064 
0065 catch 
0066     disp('THOMSON data not available')
0067 end     
0068 %
0069 disp('End of reading signals from CDB')        
0070 %
0071 % plot(signal.time_axis.data,-signal.data)
0072 %     ti = 125;
0073 %     contour(signal.axis1.data(ti,:),signal.axis2.data(ti,:), reshape(signal.data(ti,:,:), [33 33] ),50 );
0074 %     xlabel('R [m]')
0075 %     ylabel('Z [m]')
0076 %
0077 end
0078

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.