0001 function data_out = compass2luke(shotnum)
0002
0003
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
0012
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)]);
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
0036
0037
0038
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
0045
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
0062
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
0072
0073
0074
0075
0076
0077 end
0078