pro efd_despun_na2 ;;;UV両系を使ってスピンを戻したのちに平均ver May 8, 2020 ; ;; Level-1-prime data をロード (東北工大は東北大よりロード) erg_load_pwe_efd_shoji_kodai, mode='pot',/get_support_data ;; スピン位相(0-360度) erg_pwe_efd_spinphase_na get_data,'spinphase',data=spin_data,dlim=dlim ;; 電位差とポテンシャル [V] (ant長で割ってない) dif_data, 'erg_pwe_efd_l1p_Vu1_waveform_8HZ', 'erg_pwe_efd_l1p_Vu2_waveform_8HZ', newname='E_u_d' dif_data, 'erg_pwe_efd_l1p_Vv1_waveform_8HZ', 'erg_pwe_efd_l1p_Vv2_waveform_8HZ', newname='E_v_d' get_data,'E_u_d',data=volt_u_data,dlim=dlim get_data,'E_v_d',data=volt_v_data,dlim=dlim n_spin=n_elements(spin_data.x) despun_voltx=fltarr(n_spin) despun_volty=fltarr(n_spin) avrg_volt_x=fltarr(n_spin) avrg_volt_y=fltarr(n_spin) fit_curve_u=fltarr(n_spin) fit_curve_v=fltarr(n_spin) sin_spn=fltarr(n_spin) cos_spn=fltarr(n_spin) for i=0ul,n_spin,1 do begin judg=spin_data.y[i+1]-spin_data.y[i] if judg le 0 then begin start_buffer=i+1 break endif endfor ;; print, "start_buffer=", start_buffer for j=start_buffer, n_spin-2,1 do begin judg=spin_data.y[j+1]-spin_data.y[j] if judg le 0 then begin end_buffer=j ;; print, "start_buffer=", start_buffer, " end_buffer=", end_buffer ;;;; average ;;;;;;;;;;;;;;;; kosu = 0 a0u = 0.0 a0v = 0.0 for k=start_buffer,end_buffer do begin a0u=a0u+volt_u_data.y[k] a0v=a0v+volt_v_data.y[k] kosu = kosu +1 endfor ;;k a0u = a0u/kosu a0v = a0v/kosu for k=start_buffer,end_buffer do begin angrad = (spin_data.y[k]+21.9) * !pi/180.0 cos_spn[k] = cos(angrad) sin_spn[k] = sin(angrad) du = volt_u_data.y[k] - a0u dv = volt_v_data.y[k] - a0v despun_voltx[k] = du * cos_spn[k] - dv * sin_spn[k] despun_volty[k] = du * sin_spn[k] + dv * cos_spn[k] endfor ;;k ;; average of despun dV: this is the natural signal a1x = 0.0 a1y = 0.0 for k=start_buffer,end_buffer do begin a1x=a1x+despun_voltx[k] a1y=a1y+despun_volty[k] endfor ;;k a1x = a1x/kosu a1y = a1y/kosu ;; average of despun dV: this is the natural signal avrg_volt_x[start_buffer:end_buffer] = a1x avrg_volt_y[start_buffer:end_buffer] = a1y ;;; emulate spin data ;;;; for k= start_buffer,end_buffer do begin fit_curve_u[k]= a1x * cos_spn[k] + a1y * sin_spn[k] + a0u fit_curve_v[k]= -a1x * sin_spn[k] + a1y * cos_spn[k] + a0v endfor ;; to be copared with E_u_d and E_u_v start_buffer = end_buffer+1 endif endfor ;;j store_data,'despun_E_x_d',data={x:volt_u_data.x,y:despun_voltx} store_data,'av_despun_x', data={x:volt_u_data.x,y:avrg_volt_x} options,'av_despun_x',colors='red',thick=1 store_data,'despun_Exd',data=['despun_E_x_d','av_despun_x'] store_data,'despun_E_y_d',data={x:volt_u_data.x,y:despun_volty} store_data,'av_despun_y', data={x:volt_u_data.x,y:avrg_volt_y} options,'av_despun_y',colors='blue',thick=1 store_data,'despun_Eyd',data=['despun_E_y_d','av_despun_y'] store_data,'sinecurve_of_Eud',data={x:volt_u_data.x,y:fit_curve_u} options,'sinecurve_of_Eud',colors='red',thick=1 store_data,'Eud_and_emu',data=['E_u_d','sinecurve_of_Eud'] store_data,'sinecurve_of_Evd',data={x:volt_v_data.x,y:fit_curve_v} options,'sinecurve_of_Evd',colors='blue',thick=1 store_data,'Evd_and_emu',data=['E_v_d','sinecurve_of_Evd'] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; add_data, 'erg_pwe_efd_l1p_Vu1_waveform_8HZ', 'erg_pwe_efd_l1p_Vu2_waveform_8HZ', newname='scpot_u' add_data, 'erg_pwe_efd_l1p_Vv1_waveform_8HZ', 'erg_pwe_efd_l1p_Vv2_waveform_8HZ', newname='scpot_v' add_data, 'scpot_u','scpot_v', newname='scpot' calc, '"scpot"="scpot"/4' dif_data,'scpot','erg_pwe_efd_l1p_Vu1_waveform_8HZ',newname='u1pot' dif_data,'scpot','erg_pwe_efd_l1p_Vu2_waveform_8HZ',newname='u2pot' dif_data,'scpot','erg_pwe_efd_l1p_Vv1_waveform_8HZ',newname='v1pot' dif_data,'scpot','erg_pwe_efd_l1p_Vv2_waveform_8HZ',newname='v2pot' erg_pwe_efd_probespinphase_na ;; 各プローブのスピン位相とスピン面内磁場方向 set_erg_var_label tplot_options,'region',[0.1,0,1,1] tplot_options, 'xticklen', 0.08 ;;dV with average curves red:u,or x, blue:v or y and potentials of each probes u1pot,u2pot tplot,['Eud_and_emu','u1pot','u2pot','u1ant_and_mag','Evd_and_emu','v1pot','v2pot','v1ant_and_mag','despun_Exd','despun_Eyd','scpot','mag_dsi_th'] ;;with average curves red:u,or x, blue:v or y ;;tplot,['Eud_and_emu','Evd_and_emu','u1ant_and_mag','despun_Exd','despun_Eyd','scpot'] ;; no average curves ; tplot,['E_u_d','E_v_d','u1ant_and_mag','despun_E_x_d','despun_E_y_d','scpot'] ;; only average curves ; tplot,['sinecurve_of_Eud','sinecurve_of_Evd','u1ant_and_mag','av_despun_x','av_despun_y','scpot'] options,'scpot','databar',{yval:[0]} tplot_apply_databar options,'mag_dsi_th','databar',{yval:[0]} tplot_apply_databar end