0001 function [flag,LH_out] = load_LH_tsbase_yp(shotnum,certif,shotime,tmin,tmax,basestr);
0002
0003
0004
0005
0006
0007
0008 method = 'spline';
0009 flag = 1;
0010
0011 if strcmp(basestr,'TS'),
0012
0013 shotnum = str2num(shotnum) + certif/10;
0014
0015
0016
0017
0018 [LH_in.Plh_C2,LH_in.t_Plh_C2] = tsbase(shotnum,'GPHYB%1');
0019 [LH_in.Plh_C3,LH_in.t_Plh_C3] = tsbase(shotnum,'GPHYB%2');
0020 [LH_in.phaselh_C2,LH_in.t_phaselh_C2] = tsbase(shotnum,'GPHASHYB%1');
0021 [LH_in.phaselh_C3,LH_in.t_phaselh_C3] = tsbase(shotnum,'GPHASHYB%2');
0022
0023
0024
0025 if ~isempty(LH_in.Plh_C2),
0026 Plh_C2_tmin = interp_tprof_time_fxdrg(LH_in.t_Plh_C2,LH_in.Plh_C2,tmin,method);
0027 Plh_C2_tmax = interp_tprof_time_fxdrg(LH_in.t_Plh_C2,LH_in.Plh_C2,tmax,method);
0028 dt_Plh_C2 = [tmin;LH_in.t_Plh_C2(find((LH_in.t_Plh_C2 > tmin).*(LH_in.t_Plh_C2 < tmax)));tmax];
0029 LH_out.Plh_C2 = mean([Plh_C2_tmin;LH_in.Plh_C2(find((LH_in.t_Plh_C2 > tmin).*(LH_in.t_Plh_C2 < tmax)),:);Plh_C2_tmax]);
0030
0031 phaselh_C2_tmin = interp_tprof_time_fxdrg(LH_in.t_phaselh_C2,LH_in.phaselh_C2,tmin,method);
0032 phaselh_C2_tmax = interp_tprof_time_fxdrg(LH_in.t_phaselh_C2,LH_in.phaselh_C2,tmax,method);
0033 dt_phaselh_C2 = [tmin;LH_in.t_phaselh_C2(find((LH_in.t_phaselh_C2 > tmin).*(LH_in.t_phaselh_C2 < tmax)));tmax];
0034 LH_out.phaselh_C2 = mean([phaselh_C2_tmin;LH_in.phaselh_C2(find((LH_in.t_phaselh_C2 > tmin).*(LH_in.t_phaselh_C2 < tmax)),:);phaselh_C2_tmax]);
0035 LH_out.npar_C2 = 1.83 + LH_out.phaselh_C2/200;
0036
0037 Plh_C3_tmin = interp_tprof_time_fxdrg(LH_in.t_Plh_C3,LH_in.Plh_C3,tmin,method);
0038 Plh_C3_tmax = interp_tprof_time_fxdrg(LH_in.t_Plh_C3,LH_in.Plh_C3,tmax,method);
0039 dt_Plh_C3 = [tmin;LH_in.t_Plh_C3(find((LH_in.t_Plh_C3 > tmin).*(LH_in.t_Plh_C3 < tmax)));tmax];
0040 LH_out.Plh_C3 = mean([Plh_C3_tmin;LH_in.t_Plh_C3(find((LH_in.Plh_C3 > tmin).*(LH_in.t_Plh_C3 < tmax)),:);Plh_C3_tmax]);
0041
0042 phaselh_C3_tmin = interp_tprof_time_fxdrg(LH_in.t_phaselh_C3,LH_in.phaselh_C3,tmin,method);
0043 phaselh_C3_tmax = interp_tprof_time_fxdrg(LH_in.t_phaselh_C3,LH_in.phaselh_C3,tmax,method);
0044 dt_phaselh_C3 = [tmin;LH_in.t_phaselh_C3(find((LH_in.t_phaselh_C3 > tmin).*(LH_in.t_phaselh_C3 < tmax)));tmax];
0045 LH_out.phaselh_C3 = mean([phaselh_C3_tmin;LH_in.phaselh_C3(find((LH_in.t_phaselh_C3 > tmin).*(LH_in.t_phaselh_C3 < tmax)),:);phaselh_C3_tmax]);
0046 LH_out.npar_C3 = 2.03 + (LH_out.phaselh_C3 + 90)/310;
0047 else
0048 LH_out.Plh_C2 = '';
0049 LH_out.phaselh_C2 = '';
0050 LH_out.npar_C2 = '';
0051 LH_out.Plh_C3 = '';
0052 LH_out.phaselh_C3 = '';
0053 LH_out.npar_C3 = '';
0054 flag = 0;
0055 end
0056 else
0057 disp('Not yet implemented for this machine.')
0058 return
0059 end
0060