Open main menu

Changes

Matplotlib DPL94 R1rho R2eff

926 bytes added, 23:26, 14 March 2014
# Interpolate graph settings
#num_points=1000, extend=500.0
num_points=100
extend=500.0extend=5005000.0
################
spin_lock_nu1_new[ei][mi][oi].append(point)
# Intersert field 0
#spin_lock_nu1_new[ei][mi][oi][0] = 0.10
# Convert to a numpy array.
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff'] = []
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff_err'] = []
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff_bc'] = []
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff_inter'] = []
theta = theta_spin_dic[param_key]
cdp.mydic[exp_type][frq][offset]['theta'].append(theta)
w_eff = w_eff_spin_dic[param_key] cdp.mydic[exp_type][frq][offset]['w_eff'].append(w_eff_spin_dic[param_key]w_eff)
# Y val
R1_rho_err = cdp.myspin.r2eff_err[param_key]
cdp.mydic[exp_type][frq][offset]['R1_rho_err'].append(R1_rho_err)
R1_rho_bc = cdp.myspin.r2eff_bc[param_key] cdp.mydic[exp_type][frq][offset]['R1_rho_bc'].append(cdp.myspin.r2eff_bc[param_key]R1_rho_bc)
# Y2 val
R1_rho_R2eff = (R1_rho - R1*cos(theta)*cos(theta)) / (sin(theta) * sin(theta))
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff'].append(R1_rho_R2eff)
 
R1_rho_R2eff_err = (R1_rho_err - R1_err*cos(theta)*cos(theta)) / (sin(theta) * sin(theta))
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff_err'].append(R1_rho_R2eff_err)
 
R1_rho_R2eff_bc = (R1_rho_bc - R1*cos(theta)*cos(theta)) / (sin(theta) * sin(theta))
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff_bc'].append(R1_rho_R2eff_bc)
## Loop over the new dispersion points.
for di in range(len(cdp.myspin.back_calc[ei][0][mi][oi])):
point = spin_lock_nu1_new[ei][mi][oi][di]
print point
param_key = return_param_key_from_data(exp_type=exp_type, frq=frq, offset=offset, point=point)
theta = theta_spin_dic_inter[param_key]
cdp.mydic[exp_type][frq][offset]['theta_inter'].append(theta)
w_eff = w_eff_spin_dic_inter[param_key] cdp.mydic[exp_type][frq][offset]['w_eff_inter'].append(w_eff_spin_dic_inter[param_key]w_eff)
# Y val
R1_rho_R2eff = (R1_rho - R1*cos(theta)*cos(theta)) / (sin(theta) * sin(theta))
cdp.mydic[exp_type][frq][offset]['R1_rho_R2eff_inter'].append(R1_rho_R2eff)
 
if oi == 0:
print exp_type, frq, offset, point, theta, w_eff
####### PLOT ####
# Plot 2: R1_rho_R2eff as function of w_eff
plt.figure(2)
w_eff2_inter = [x*x for x in val_dics['w_eff_inter']]
w_eff2 = [x*x for x in val_dics['w_eff']]
#line, = plt.plot(w_eff2_inter, val_dics['R1_rho_R2eff_inter'], '-', label=graphlabel_inter)
#plt.errorbar(w_eff2, val_dics['R1_rho_R2eff'], yerr=val_dics['R1_rho_R2eff_err'], fmt='o', label=graphlabel, color=line.get_color())
#plt.plot(w_eff2, val_dics['R1_rho_R2eff_bc'], 'D', label=graphlabel_bc, color=line.get_color())
line, = plt.plot(val_dics['w_eff_inter'], val_dics['R1_rho_R2eff_inter'], '-', label=graphlabel_inter)
plt.errorbar(val_dics['w_eff'], val_dics['R1_rho_R2eff'], yerr=val_dics['R1_rho_R2eff_err'], fmt='o', label=graphlabel, color=line.get_color())
#plt.plot(x_w_eff_modval_dics['w_eff'], val_dics['R1_rho_R2effR1_rho_R2eff_bc'], 'oD', label=graphlabelgraphlabel_bc, color=line.get_color())
# Plot 3: R1_rho as function of as function of disp_point, the Spin-lock field strength
plt.grid(True)
plt.ylim([0,16])
#plt.xlim([0,20000*20000])
plt.xlim([0,20000])
plt.title("%s \n %s as function of %s"%(spin_inte, ylabel_R1_rho_R2eff, xlabel_w_eff))