Commit 31f79451 authored by ulrich_y's avatar ulrich_y
Browse files

PEP8 compliance

parent c3d6b5a2
Pipeline #1214 canceled with stages
in 2 minutes and 3 seconds
......@@ -9,7 +9,7 @@ lo = scaleset(mergefks(sigma('mp2mp0')), alpha**2*conv)
fig, nloNoVP = mergefkswithplot([
[sigma('mp2mpF')],
[sigma('mp2mpR15'), sigma('mp2mpR35')]
], scale=alpha**3*conv, xlim=[-3,0])
], scale=alpha**3*conv, xlim=[-3, 0])
fig.savefig('plots/xi-nlo.pdf')
......@@ -31,7 +31,7 @@ nlo = scaleset(mergefks(
nnlo = scaleset(mergefks(
sigma('mp2mpFF'), sigma('mp2mpAF', obs='1'),
sigma('mp2mpRF15'), sigma('mp2mpRF35'),
sigma('mp2mpAR15', obs='1'),sigma('mp2mpAR35', obs='1'),
sigma('mp2mpAR15', obs='1'), sigma('mp2mpAR35', obs='1'),
sigma('mp2mpRR1516'), sigma('mp2mpRR3536'),
anyxiF=sigma('mp2mpAA', obs='1'),
anyxiNF=sigma('mp2mpNF', obs='1')
......@@ -46,20 +46,22 @@ nnloNF = scaleset(mergefks(
), alpha**4*conv)
#####################################################################}}}
## Print numbers{{{
print("run time %f days" % ((lo['time'] + nlo['time'] + nnlo['time']) / 3600. / 24.))
print("run time %f days" % (
(lo['time'] + nlo['time'] + nnlo['time']) / 3600. / 24.)
)
print("\\sigma^(0) = " + printnumber(lo['value']))
print("\\sigma^(1) = +" + printnumber(nlo['value']))
print("\\sigma^(2) = " + printnumber(nnlo['value']))
print("\\sigma^(2) = " + printnumber(nnlo['value']))
#####################################################################}}}
## Make pictures{{{
### $\theta_e${{{
fig, (ax1, ax2, ax3) = kplot(
{
'lo': mergebins( lo['thetae'],4),
'nlo': mergebins( nlo['thetae'],4),
'nnlo': mergebins(nnlo['thetae'],4),
'nlo2': mergebins(nloNoVP ['thetae'],4),
'nnlo2':mergebins(nnloNoVP['thetae'],4)
'lo': mergebins(lo['thetae'], 4),
'nlo': mergebins(nlo['thetae'], 4),
'nnlo': mergebins(nnlo['thetae'], 4),
'nlo2': mergebins(nloNoVP['thetae'], 4),
'nnlo2': mergebins(nnloNoVP['thetae'], 4)
},
labelx="$\\theta_e\,/\,{\\rm deg}$",
labelsigma="$\\D\\sigma/\\D\\theta_e\ /\ {\\rm\\upmu b}$",
......@@ -78,11 +80,11 @@ fig.savefig('plots/thetae.pdf')
### $Q_e^2$ and $Q_p^2${{{
fig, (ax1, ax2, ax3) = kplot(
{
'lo': mergebins( lo['qsqP'][10:189],4),
'nlo': mergebins( nlo['qsqP'][10:189],4),
'nnlo': mergebins(nnlo['qsqP'][10:189],4),
'nlo2': mergebins( nlo['qsqE'][10:189],4),
'nnlo2':mergebins(nnlo['qsqE'][10:189],4),
'lo': mergebins(lo['qsqP'][10:189], 4),
'nlo': mergebins(nlo['qsqP'][10:189], 4),
'nnlo': mergebins(nnlo['qsqP'][10:189], 4),
'nlo2': mergebins(nlo['qsqE'][10:189], 4),
'nnlo2': mergebins(nnlo['qsqE'][10:189], 4),
},
labelx="$|t|\,/\,{\\rm MeV}^2$",
......@@ -94,10 +96,10 @@ fig, (ax1, ax2, ax3) = kplot(
},
legendopts={'what': 'u', 'loc': 'upper right'}
)
ax2.set_ylim(-0.07,0.07)
ax3.set_ylim(-0.0042,0.0042)
ax2.set_ylim(-0.07, 0.07)
ax3.set_ylim(-0.0042, 0.0042)
updateaxis(ax3, fig,2)
updateaxis(ax3, fig, 2)
fig.savefig('plots/qsq.pdf')
###########################################################}}}
#####################################################################}}}
......@@ -31,7 +31,7 @@ nlo = scaleset(mergefks(
nnlo = scaleset(mergefks(
sigma('mp2mpFF'), sigma('mp2mpAF'),
sigma('mp2mpRF15'), sigma('mp2mpRF35'),
sigma('mp2mpAR15'),sigma('mp2mpAR35'),
sigma('mp2mpAR15'), sigma('mp2mpAR35'),
sigma('mp2mpRR1516'), sigma('mp2mpRR3536'),
anyxiF=sigma('mp2mpAA'),
anyxiNF=sigma('mp2mpNF')
......@@ -58,47 +58,51 @@ fig, (ax1, ax2, ax3) = kplot(
legendopts={'what': 'u', 'loc': 'upper right'}
)
ylim(0.99995-1, 1.0002-1)
pymule.plot.mpl_axes_aligner.yaxes(ax2, ax3,y1=0.)
pymule.plot.mpl_axes_aligner.yaxes(ax2, ax3, y1=0.)
fig.savefig('plots/thetamu.pdf')
###########################################################}}}
### bands{{{
def sanitise(x):
x[x[:,1]==0,1] = -10
x[x[:, 1] == 0, 1] = -10
return x
bands = ['EmuB1', 'EmuB2', 'EmuB3', 'EmuB4']
bandxs = [addplots(lo[k], addplots(nlo[k], nnlo[k])) for k in bands]
bandk1 = [sanitise(divideplots(nlo[k], lo[k])) for k in bands]
bandk2 = [sanitise(divideplots(nnlo[k], addplots(lo[k], nlo[k]))) for k in bands]
bandk2 = [
sanitise(divideplots(nnlo[k], addplots(lo[k], nlo[k])))
for k in bands
]
fig, (ax1, ax2, ax3) = threepanel(
labelx="$E_\\mu^{\\rm kin}\,/\,{\\rm MeV}$",
upleft=bandxs, labupleft="$\\D\\sigma/\\D E_\\mu^{\\rm kin}\,/\,{\\rm \\upmu b}$",
upleft=bandxs,
labupleft="$\\D\\sigma/\\D E_\\mu^{\\rm kin}\,/\,{\\rm \\upmu b}$",
middleleft=bandk1, labmiddleleft="$\\delta K^{(1)}$",
downleft=bandk2, labdownleft="$\\delta K^{(2)}$",
colupleft =[orderscheme['nnlo'], 'paleturquoise', 'olivedrab', 'gold'],
colupleft=[orderscheme['nnlo'], 'paleturquoise', 'olivedrab', 'gold'],
colmiddleleft=[orderscheme['nnlo'], 'paleturquoise', 'olivedrab', 'gold'],
coldownleft =[orderscheme['nnlo'], 'paleturquoise', 'olivedrab', 'gold']
coldownleft=[orderscheme['nnlo'], 'paleturquoise', 'olivedrab', 'gold']
)
ax1.set_yscale('log')
ax2.set_ylim(0.982-1,1.016-1)
ax3.set_ylim(0.999-1,1.018-1)
ax2.set_ylim(0.982-1, 1.016-1)
ax3.set_ylim(0.999-1, 1.018-1)
thbounds = np.array([
[
0.3875697, # about 22 degrees -> 126 MeV
0.7708983 # about 44 degrees -> 117 MeV
],[
0.8054385, # about 46 degrees -> 116 MeV
1.0939359 # about 63 degrees -> 107 MeV
],[
1.124739 , # about 64 degrees -> 106 MeV
1.403278 # about 80 degrees -> 97 MeV
],[
1.435036 , # about 82 degrees -> 96 MeV
1.739436 # about 99 degrees -> 87 MeV
0.3875697, # about 22 degrees -> 126 MeV
0.7708983 # about 44 degrees -> 117 MeV
], [
0.8054385, # about 46 degrees -> 116 MeV
1.0939359 # about 63 degrees -> 107 MeV
], [
1.124739, # about 64 degrees -> 106 MeV
1.403278 # about 80 degrees -> 97 MeV
], [
1.435036, # about 82 degrees -> 96 MeV
1.739436 # about 99 degrees -> 87 MeV
]
])
ax2.legend([
......
......@@ -12,11 +12,13 @@ lo = scaleset(mergefks(sigma('em2em0')), alpha**2*conv)
nloNoVP = scaleset(mergefks(
sigma('em2emFEE'), sigma('em2emFEM'), sigma('em2emFMM'),
sigma('em2emREE15'), sigma('em2emREE35'), sigma('em2emREM'), sigma('em2emRMM')
sigma('em2emREE15'), sigma('em2emREE35'),
sigma('em2emREM'), sigma('em2emRMM')
), alpha**3*conv)
nlo = scaleset(mergefks(
sigma('em2emFEE'), sigma('em2emFEM'), sigma('em2emFMM'),
sigma('em2emREE15'), sigma('em2emREE35'), sigma('em2emREM'), sigma('em2emRMM'),
sigma('em2emREE15'), sigma('em2emREE35'),
sigma('em2emREM'), sigma('em2emRMM'),
anyxi=sigma('em2emA', obs='2')
), alpha**3*conv)
......@@ -41,12 +43,16 @@ nnlo = scaleset(mergefks(
setup(obs='1')
nlocutNoVP = scaleset(mergefks(
sigma('em2emFEE', obs='0'), sigma('em2emFEM', obs='0'), sigma('em2emFMM', obs='0'),
sigma('em2emREE15'), sigma('em2emREE35'), sigma('em2emREM'), sigma('em2emRMM')
sigma('em2emFEE', obs='0'),
sigma('em2emFEM', obs='0'), sigma('em2emFMM', obs='0'),
sigma('em2emREE15'), sigma('em2emREE35'),
sigma('em2emREM'), sigma('em2emRMM')
), alpha**3*conv)
nlocut = scaleset(mergefks(
sigma('em2emFEE', obs='0'), sigma('em2emFEM', obs='0'), sigma('em2emFMM', obs='0'),
sigma('em2emREE15'), sigma('em2emREE35'), sigma('em2emREM'), sigma('em2emRMM'),
sigma('em2emFEE', obs='0'),
sigma('em2emFEM', obs='0'), sigma('em2emFMM', obs='0'),
sigma('em2emREE15'), sigma('em2emREE35'),
sigma('em2emREM'), sigma('em2emRMM'),
anyxi=sigma('em2emA', obs='2')
), alpha**3*conv)
......@@ -65,7 +71,13 @@ nnlocut = scaleset(mergefks(
), alpha**4*conv)
#####################################################################}}}
## Print numbers{{{
print("run time %f days" % ((lo['time'] + nlo['time'] + nnlo['time'] + nlocut['time'] + nnlocut['time']) / 3600. / 24.))
print(
"run time %f days" % (
(
lo['time'] + nlo['time'] + nnlo['time']
+ nlocut['time'] + nnlocut['time']
) / 3600. / 24.)
)
print(tabulate([
['\\sigma^(0)', printnumber(lo['value']), "", "", ""],
......@@ -82,26 +94,32 @@ print(tabulate([
"+"+printnumber(nnlo['value']),
"+"+printnumber(nnlocut['value']),
printnumber(dividenumbers(nnlo['value'], plusnumbers(lo['value'], nlo['value']))),
printnumber(dividenumbers(nnlocut['value'], plusnumbers(lo['value'], nlocut['value'])))
printnumber(dividenumbers(
nnlo['value'], plusnumbers(lo['value'], nlo['value'])
)),
printnumber(dividenumbers(
nnlocut['value'], plusnumbers(lo['value'], nlocut['value'])
))
],
[
'\\sigma_2',
printnumber(plusnumbers(lo['value'], nlo['value'], nnlo['value'])),
printnumber(plusnumbers(lo['value'], nlocut['value'], nnlocut['value']))
printnumber(plusnumbers(
lo['value'], nlocut['value'], nnlocut['value']
))
]
], headers=['','S1', 'S2', 'S1k', 'S2k']))
], headers=['', 'S1', 'S2', 'S1k', 'S2k']))
#####################################################################}}}
## Make pictures{{{
### $\theta_e${{{
#### w/o cut{{{
fig, (ax1, ax2, ax3) = kplot(
{
'lo': mergebins(scaleplot(lo['thetae'] , 1e-3)[:221],4),
'nlo': mergebins(scaleplot(nlo['thetae'] , 1e-3)[:221],4),
'nnlo': mergebins(scaleplot(nnlo['thetae'], 1e-3)[:221],4),
'nlo2': mergebins(scaleplot(nloNoVP['thetae'] , 1e-3)[:221],4),
'nnlo2':mergebins(scaleplot(nnloNoVP['thetae'], 1e-3)[:221],4)
'lo': mergebins(scaleplot(lo['thetae'], 1e-3)[:221], 4),
'nlo': mergebins(scaleplot(nlo['thetae'], 1e-3)[:221], 4),
'nnlo': mergebins(scaleplot(nnlo['thetae'], 1e-3)[:221], 4),
'nlo2': mergebins(scaleplot(nloNoVP['thetae'], 1e-3)[:221], 4),
'nnlo2': mergebins(scaleplot(nnloNoVP['thetae'], 1e-3)[:221], 4)
},
labelx="$\\theta_e\,/\,{\\rm mrad}$",
labelsigma="$\\D\\sigma/\\D\\theta_e\ /\ {\\rm\\upmu b}$",
......@@ -121,11 +139,11 @@ fig.savefig('plots/theta-e-no-cut.pdf')
#### w/ cut{{{
fig, (ax1, ax2, ax3) = kplot(
{
'lo': mergebins(scaleplot(lo ['thetae'], 1e-3)[:221],4),
'nlo': mergebins(scaleplot(nlocut ['thetae'], 1e-3)[:221],4),
'nnlo': mergebins(scaleplot(nnlocut['thetae'], 1e-3)[:221],4),
'nlo2': mergebins(scaleplot(nlocutNoVP['thetae'] , 1e-3)[:221],4),
'nnlo2':mergebins(scaleplot(nnlocutNoVP['thetae'], 1e-3)[:221],4)
'lo': mergebins(scaleplot(lo['thetae'], 1e-3)[:221], 4),
'nlo': mergebins(scaleplot(nlocut['thetae'], 1e-3)[:221], 4),
'nnlo': mergebins(scaleplot(nnlocut['thetae'], 1e-3)[:221], 4),
'nlo2': mergebins(scaleplot(nlocutNoVP['thetae'], 1e-3)[:221], 4),
'nnlo2': mergebins(scaleplot(nnlocutNoVP['thetae'], 1e-3)[:221], 4)
},
labelx="$\\theta_e\,/\,{\\rm mrad}$",
labelsigma="$\\D\\sigma/\\D\\theta_e\ /\ {\\rm\\upmu b}$",
......@@ -146,9 +164,9 @@ fig.savefig('plots/theta-e-yes-cut.pdf')
#### w/o cut{{{
fig, (ax1, ax2, ax3) = kplot(
{
'lo': mergebins(scaleplot(lo ['tmm'][15:296], 1e+6),8),
'nlo': mergebins(scaleplot(nlo ['tmm'][15:296], 1e+6),8),
'nnlo': mergebins(scaleplot(nnlo['tmm'][15:296], 1e+6),8)
'lo': mergebins(scaleplot(lo['tmm'][15:296], 1e+6), 8),
'nlo': mergebins(scaleplot(nlo['tmm'][15:296], 1e+6), 8),
'nnlo': mergebins(scaleplot(nnlo['tmm'][15:296], 1e+6), 8)
},
labelx="$t_{\\mu}\,/\,{\\rm GeV}^2$",
labelsigma="$\\D\\sigma/\\D t_{\\mu}\ /\ {\\rm\\upmu b}$",
......@@ -160,17 +178,17 @@ fig, (ax1, ax2, ax3) = kplot(
legendopts={'what': 'u', 'loc': 'lower right'}
)
ax1.set_yscale('log')
ax2.set_ylim(0.95-1,1.02-1)
ax3.set_ylim(0.999-1,1.0005-1)
ax2.set_ylim(0.95-1, 1.02-1)
ax3.set_ylim(0.999-1, 1.0005-1)
pymule.mpl_axes_aligner.yaxes(ax2, ax3, 0)
fig.savefig('plots/tmm-no-cut.pdf')
#################################################}}}
#### w/ cut{{{
fig, (ax1, ax2, ax3) = kplot(
{
'lo': mergebins(scaleplot(lo ['tmm'][16:242], 1e-3),8),
'nlo': mergebins(scaleplot(nlocut ['tmm'][16:242], 1e-3),8),
'nnlo': mergebins(scaleplot(nnlocut['tmm'][16:242], 1e-3),8)
'lo': mergebins(scaleplot(lo['tmm'][16:242], 1e-3), 8),
'nlo': mergebins(scaleplot(nlocut['tmm'][16:242], 1e-3), 8),
'nnlo': mergebins(scaleplot(nnlocut['tmm'][16:242], 1e-3), 8)
},
labelx="$t_{\\mu}\,/\,{\\rm GeV}^2$",
labelsigma="$\\D\\sigma/\\D t_{\\mu}\ /\ {\\rm\\upmu b}$",
......@@ -182,8 +200,8 @@ fig, (ax1, ax2, ax3) = kplot(
legendopts={'what': 'u', 'loc': 'lower right'}
)
ax1.set_yscale('log')
ax3.set_ylim(0.9994-1,1.0005-1)
pymule.mpl_axes_aligner.yaxes(ax2, ax3,0)
ax3.set_ylim(0.9994-1, 1.0005-1)
pymule.mpl_axes_aligner.yaxes(ax2, ax3, 0)
fig.savefig('plots/tmm-yes-cut.pdf')
#################################################}}}
###########################################################}}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment