def update(Q,qT,angle,height): params=gen_params() params['T_t']=qT params['Q']=Q _zh=np.linspace(0.1,1,50) _xb=np.linspace(0.1,1,50) xb,zh=np.meshgrid(_xb, _zh) params['x_bj']=xb params['z_h']=zh yh=evaluate(rat.get_yh,params) camera = dict( up=dict(x=0, y=0, z=1), center=dict(x=0, y=0, z=0), eye=dict(x=2.5*np.cos(angle*np.pi/180), y=2.5*np.sin(angle*np.pi/180), z=height)) trace= go.Surface(y=tuple(xb),x=tuple(zh),z=tuple(yh),) layout = go.Layout( title="" , autosize=False, width=700, height=700, scene=dict( aspectmode='cube', camera=camera, yaxis=dict(title='x<sub>Bj</sub>'), xaxis=dict(title='z<sub>h</sub>'), zaxis=dict(title='y<sub>h</sub>' ),)) data=[trace] fig = go.Figure(data=data, layout=layout) return fig
def update(Ri, Q, qT, xi, zeta, Mki, Mkf, dkT, kiT, angle, height): params = gen_params() params['xi'] = xi params['zeta'] = zeta params['M_ki'] = Mki params['M_kf'] = Mkf params['T_t'] = qT params['delta_k_t'] = dkT params['k_i_t'] = kiT params['Q'] = Q _xb = np.linspace(xi, 1, 50) _zh = np.linspace(zeta, 1, 50) xb, zh = np.meshgrid(_xb, _zh) params['x_bj'] = xb params['z_h'] = zh if Ri == 'R1': R = evaluate(rat.get_R1, params) if Ri == 'R2': R = evaluate(rat.get_R2, params) if Ri == 'R3': R = evaluate(rat.get_R3, params) if Ri == 'R1prime': R = evaluate(rat.get_R4, params) R = np.abs(R) R[R > 1] = 1 camera = dict(up=dict(x=0, y=0, z=1), center=dict(x=0, y=0, z=0), eye=dict(x=2.5 * np.cos(angle * np.pi / 180), y=2.5 * np.sin(angle * np.pi / 180), z=height)) trace = go.Surface( y=tuple(xb), x=tuple(zh), z=tuple(R), ) layout = go.Layout(title="", autosize=False, width=700, height=700, scene=dict( aspectmode='cube', camera=camera, yaxis=dict(title='x<sub>Bj</sub>', range=(0, 1)), xaxis=dict(title='z<sub>h</sub>', range=(0, 1)), zaxis=dict(title=Ri, range=(0, 1)), )) data = [trace] fig = go.Figure(data=data, layout=layout) return fig
def update(Ri,qT,xbjmin,xbjmax,zh,xi,zeta,M,Mki,Mkf,dkT,kiT): params=gen_params() params['M']=M params['z_h']=zh params['xi']=xi params['zeta']=zeta params['T_t']=qT params['delta_k_t']=dkT params['M_ki']=Mki params['M_kf']=Mkf params['k_i_t']=kiT _xb=np.linspace(xbjmin,xbjmax,100) _Q =np.linspace(0.8,2.0,100) xb,Q=np.meshgrid(_xb,_Q) params['Q']=Q params['x_bj']=xb if Ri=='R1': R=evaluate(rat.get_R1,params) if Ri=='R2': R=evaluate(rat.get_R2,params) if Ri=='R3': R=evaluate(rat.get_R3,params) if Ri=='R1prime': R=evaluate(rat.get_R4,params) R=np.abs(R) R[R>1]=1 data = [go.Heatmap(x=_xb,y=_Q,z=R,colorscale='Jet'),] layout = go.Layout( width = 800, height = 500, xaxis = dict( #nticks = 10, #domain = [0, 0.45], title = 'x<sub>Bj' ), yaxis = dict( #scaleanchor = "x", #domain = [0, 0.45], title = "Q [GeV]" ), showlegend= False ) fig = go.Figure(data=data, layout=layout) return fig
def update(zh, qT, W2max): params = gen_params() params['T_t'] = qT params['z_h'] = zh _Q = np.linspace(0.5, 2.5, 100) _xb = np.linspace(0.1, 0.8, 100) xb, Q = np.meshgrid(_xb, _Q) params['Q'] = Q params['x_bj'] = xb W2 = evaluate(rat.get_W2, params) W2[W2 < 0] = np.nan W2[W2 > W2max] = np.nan data = [ go.Heatmap(x=_xb, y=_Q, z=W2, colorscale='Jet'), ] layout = go.Layout( width=800, height=500, xaxis=dict( #nticks = 10, #domain = [0, 0.45], title="x<sub>Bj"), yaxis=dict( #scaleanchor = "x", #domain = [0, 0.45], title="Q [GeV]"), showlegend=False) fig = go.Figure(data=data, layout=layout) return fig
def update(had, qua, M, x, Q, yHmin, yHmax, xi, zeta, Mki, Mkf, dkT, kiT): params = gen_params() params['M'] = M params['xi'] = xi params['zeta'] = zeta #params['T_t']=qT params['delta_k_t'] = dkT params['M_ki'] = Mki params['M_kf'] = Mkf params['k_i_t'] = kiT params['Q'] = Q params['x_bj'] = x if had == 'pion': params['M_h'] = 0.139 elif had == 'kaon': params['M_h'] = 0.497 Mh = params['M_h'] xN = evaluate(rat.get_xN, params) #etamin=evaluate(rat.get_etamin,params) #etamax=evaluate(rat.get_etamax,params) #yP=np.log(Q/xN/M) #yH=np.linspace(etamin,etamax,100) #dy=yP-yH #Htmax=[] #for eta in yH: # params['eta']=eta # Htmax.append(evaluate(rat.get_Htmax,params)) #Htmax=np.array(Htmax) #zh=(xN*np.sqrt(Mh**2+Htmax**2)*M/(Q**2-xN**2*M**2))*2*np.cosh(dy) #qtmax=Htmax/zh #line1 = go.Scatter( # x = yH, # y = np.zeros(yH.size), # name = '', # line = dict( # color = ('rgb(22, 96, 167)'), # width = 4, # dash = 'solid')) #line2 = go.Scatter( # x = yH, # y = qtmax/Q, # name = 'High Q', # line = dict( # color = ('rgb(22, 96, 167)'), # width = 4, # dash = 'dot'), # fill='tonexty') _yH = np.linspace(yHmin, yHmax, 50) _qT = np.linspace(0, 2, 50) yH, qT = np.meshgrid(_yH, _qT) yP = np.log(Q / xN / M) pf = xN * M / (Q**2 - xN**2 * M**2) * 2 * np.cosh(yP - yH) zh = np.sqrt(pf**2 * Mh**2 / (1 - pf**2 * qT**2)) params['z_h'] = zh if qua == 'R1': R = np.abs(evaluate(rat.get_R1, params)) elif qua == 'R2': R = np.abs(evaluate(rat.get_R2, params)) elif qua == 'R3': R = np.abs(evaluate(rat.get_R3, params)) elif qua == 'R1prime': R = np.abs(evaluate(rat.get_R4, params)) R[R > 1] = np.nan data = [go.Heatmap(x=_yH, y=_qT, z=R, colorscale='Jet')] #[line1,line2,R1] layout = go.Layout(width=800, height=500, xaxis=dict(title="y<sub>h</sub>", range=(None, yP)), yaxis=dict(title="q<sub>T</sub>/Q", range=(0, 2)), showlegend=True) fig = go.Figure(data=data, layout=layout) return fig
def update(exp, had, qua, M, W2cut, xmax, qT, zh, xi, zeta, Mki, Mkf, dkT, kiT): #return exp#'%f'%M params = gen_params() params['M'] = M params['z_h'] = zh params['xi'] = xi params['zeta'] = zeta params['T_t'] = qT params['delta_k_t'] = dkT params['M_ki'] = Mki params['M_kf'] = Mkf params['k_i_t'] = kiT if exp == 'JLab': s = M**2 + 2 * 11 * M elif exp == 'HERMES': s = M**2 + 2 * 27.6 * M elif exp == 'COMPASS': s = M**2 + 2 * 160 * M if had == 'pion': params['M_h'] = 0.139 elif had == 'kaon': params['M_h'] = 0.497 Q2min = 1. xmin = Q2min / (s - M) _xb = np.linspace(xmin, xmax, 50) Q2max = xmax * (s - M**2) _Q = np.linspace(Q2min, Q2max, 100)**0.5 #print(Q2min,Q2max) xb, Q = np.meshgrid(_xb, _Q) params['Q'] = Q params['x_bj'] = xb if qua == 'R1': R = np.abs(evaluate(rat.get_R1, params)) elif qua == 'R2': R = np.abs(evaluate(rat.get_R2, params)) elif qua == 'R3': R = np.abs(evaluate(rat.get_R3, params)) elif qua == 'R1prime': R = np.abs(evaluate(rat.get_R4, params)) elif qua == 'xN/xb': R = evaluate(rat.get_xN, params) / xb elif qua == 'zN/zh': R = evaluate(rat.get_zN, params) / zh R[R > 1] = np.nan R[Q**2 > xb * (s - M)] = np.nan R[W2cut > (M**2 + Q**2 / xb - Q**2)] = np.nan #print(R) data = [ go.Heatmap(x=_xb, y=_Q, z=R, colorscale='Jet'), ] layout = go.Layout( width=800, height=500, xaxis=dict( #nticks = 10, #domain = [0, 0.45], title="x<sub>Bj"), yaxis=dict( #scaleanchor = "x", #domain = [0, 0.45], title="Q [GeV]"), showlegend=False) fig = go.Figure(data=data, layout=layout) return fig
def update(exp, M, W2cut, xmax, Q): params = gen_params() params['M'] = M if exp == 'JLab': s = M**2 + 2 * 11 * M elif exp == 'HERMES': s = M**2 + 2 * 27.6 * M elif exp == 'COMPASS': s = M**2 + 2 * 160 * M Q2min = 1. xmin = Q2min / (s - M) xb = np.linspace(xmin, xmax, 50) Q2_low = xb / (1 - xb) * (W2cut - M**2) Q2_high = xb * (s - M**2) params['x_bj'] = xb params['Q'] = Q2_low**0.5 xN_low = evaluate(rat.get_xN, params) params['Q'] = Q2_high**0.5 xN_high = evaluate(rat.get_xN, params) line1 = go.Scatter(x=xb, y=xN_low / xb, name='Low Q', line=dict(color=('rgb(22, 96, 167)'), width=4, dash='solid')) line2 = go.Scatter(x=xb, y=xN_high / xb, name='High Q', line=dict(color=('rgb(22, 96, 167)'), width=4, dash='dot'), fill='tonexty') xmin = Q**2 / (s - M) _xmax = Q**2 / (W2cut - M**2 + Q**2) xb = np.linspace(xmin, min(_xmax, xmax), 50) params['x_bj'] = xb params['Q'] = Q xN = evaluate(rat.get_xN, params) line3 = go.Scatter(x=xb, y=xN / xb, name='Q', line=dict( color=('rgb(205, 12, 24)'), width=4, )) data = [line1, line2, line3] layout = go.Layout(width=800, height=500, xaxis=dict(title="x<sub>Bj"), yaxis=dict(title="x<sub>N</sub>/x<sub>Bj</sub>", range=(0.9, 1)), showlegend=True) fig = go.Figure(data=data, layout=layout) return fig
def update(exp,had,qT,W2cut,xmax,x,Q): params=gen_params() M=0.938 if exp=='JLab': s = M**2 + 2*11*M elif exp=='HERMES': s = M**2 + 2*27.6*M elif exp=='COMPASS': s = M**2 + 2*160*M if had=='pion': params['M_h']=0.139 elif had=='kaon': params['M_h']=0.497 params['T_t']=qT zh=np.linspace(0.1,0.8,50) Q2min=1. xmin=Q2min/(s-M) xb=np.linspace(xmin,xmax,50) Q2_low = xb/(1-xb)*(W2cut-M**2) Q2_high = xb*(s-M**2) params['x_bj']=xb zN_up=[] zN_do=[] for _zh in zh: params['z_h']=_zh params['Q']=Q2_low**0.5 zN_vals=evaluate(rat.get_zN,params) params['Q']=Q2_high**0.5 zN_vals=np.append(zN_vals,evaluate(rat.get_zN,params)) zN_do.append(np.amin(zN_vals)) zN_up.append(np.amax(zN_vals)) zN_up=np.array(zN_up) zN_do=np.array(zN_do) line1 = go.Scatter( x = zh, y = zN_do/zh, name = 'Low Q', line = dict( color = ('rgb(22, 96, 167)'), width = 4, dash = 'solid')) line2 = go.Scatter( x = zh, y = zN_up/zh, name = 'High Q', line = dict( color = ('rgb(22, 96, 167)'), width = 4, dash = 'dot'), fill='tonexty') params['z_h']=zh params['Q']=Q zN=evaluate(rat.get_zN,params) line3 = go.Scatter( x = zh, y = zN/zh, name = 'Q', line = dict( color = ('rgb(205, 12, 24)'), width = 4,)) data = [line1,line2,line3] layout = go.Layout( width = 800, height = 500, xaxis = dict(title = "z<sub>h"), yaxis = dict(title = "z<sub>N</sub>/z<sub>h</sub>",range=(0.8,1)), showlegend= True ) fig = go.Figure(data=data, layout=layout) return fig