-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_GPD.py
44 lines (33 loc) · 16.7 KB
/
plot_GPD.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Herve Dutrieux - September 19, 2024
# Code to handle the dataset extracted from the terminal output and plot the GPDs
import matplotlib.pyplot as plt
def plot_data_from_PARTONS(x_grid, Hu, xi, mu2, ls="-"):
# Cleaning up the data
x_grid_clean = [float(d) for d in x_grid[1:].split(" [none], ")[:-1]]
Hu_tmp = Hu[1:-3].replace('u:', ',').replace('u(+):', ',').replace('u(-):', ',').replace(', , ', ' , ')
Hu_clean = [float(d) for d in Hu_tmp[2:].split(' , ')]
# Separating u, u+ and u-
u = Hu_clean[::3]
uPlus = Hu_clean[1::3]
uMinus = Hu_clean[2::3]
# Sorting the data
u = [x for _, x in sorted(zip(x_grid_clean, u))]
uPlus = [x for _, x in sorted(zip(x_grid_clean, uPlus))]
uMinus = [x for _, x in sorted(zip(x_grid_clean, uMinus))]
x_grid_clean.sort()
plt.plot(x_grid_clean, u, ls, color="C0", label=r"$H^u(x, \xi=$"+str(xi)+r"$, \mu^2 = $"+str(mu2)+r" GeV$^2$)")
plt.plot(x_grid_clean, uPlus, ls, color="C1", label=r"$H^{u(+)}(x, \xi=$"+str(xi)+r"$, \mu^2 = $"+str(mu2)+r" GeV$^2$)")
plt.plot(x_grid_clean, uMinus, ls, color="C2", label=r"$H^{u(-)}(x, \xi=$"+str(xi)+r"$, \mu^2 = $"+str(mu2)+r" GeV$^2$)")
plt.plot([xi, xi], [min(u), max(u)], "--", color="gray")
plt.xlabel(r"$x$")
plt.xscale("log")
plt.legend()
# GK model at scale 2 GeV2
x_grid = "[0.000403701725859656 [none], 0.00112332403297803 [none], 0.000335160265093885 [none], 0.000305385550883342 [none], 0.000278255940220713 [none], 0.000253536449397011 [none], 0.000231012970008316 [none], 0.000210490414451202 [none], 0.000191791026167249 [none], 0.000174752840000768 [none], 0.000159228279334109 [none], 0.000145082877849594 [none], 0.000132194114846603 [none], 0.000367837977182864 [none], 0.0385352859371053 [none], 0.000109749876549306 [none], 0.000443062145758388 [none], 0.000486260158006536 [none], 0.000533669923120631 [none], 0.000585702081805667 [none], 0.000642807311728433 [none], 0.000705480231071865 [none], 0.000774263682681127 [none], 0.000849753435908645 [none], 0.000932603346883221 [none], 0.00102353102189903 [none], 0.00343046928631492 [none], 0.00123284673944207 [none], 0.00135304777457981 [none], 0.00148496826225447 [none], 0.00162975083462064 [none], 0.00178864952905744 [none], 0.00196304065004027 [none], 0.00215443469003189 [none], 0.00236448941264541 [none], 0.00259502421139974 [none], 0.0028480358684358 [none], 0.00312571584968824 [none], 0.000120450354025878 [none], 0.00376493580679247 [none], 0.00413201240011534 [none], 0.00453487850812858 [none], 0.00497702356433211 [none], 0.00546227721768434 [none], 0.00599484250318941 [none], 0.00657933224657568 [none], 0.00722080901838547 [none], 0.00792482898353918 [none], 0.00869749002617784 [none], 0.00954548456661834 [none], 0.0104761575278967 [none], 0.0319926713779738 [none], 0.0126185688306602 [none], 0.0138488637139387 [none], 0.0151991108295293 [none], 0.0166810053720006 [none], 0.0183073828029537 [none], 0.0200923300256505 [none], 0.0220513073990305 [none], 0.0242012826479438 [none], 0.0265608778294669 [none], 0.0291505306282518 [none], 0.107226722201032 [none], 0.0351119173421513 [none], 0.0977009957299226 [none], 0.042292428743895 [none], 0.0464158883361278 [none], 0.0509413801481638 [none], 0.0559081018251223 [none], 0.0613590727341318 [none], 0.0673415065775082 [none], 0.0739072203352578 [none], 0.0811130830789687 [none], 0.0890215085445039 [none], 0.47508101621028 [none], 0.432876128108306 [none], 0.1176811952435 [none], 0.129154966501488 [none], 0.141747416292681 [none], 0.155567614393047 [none], 0.170735264747069 [none], 0.187381742286038 [none], 0.205651230834865 [none], 0.225701971963392 [none], 0.247707635599171 [none], 0.271858824273294 [none], 0.298364724028334 [none], 0.327454916287773 [none], 0.359381366380462 [none], 0.394420605943765 [none], 0.521400828799968 [none], 0.572236765935022 [none], 0.628029144183426 [none], 0.689261210434969 [none], 0.756463327554629 [none], 0.830217568131975 [none], 0.911162756115489 [none], 1 [none], 0.0114975699539774 [none], 0.0001 [none], ]"
Hu = "[u: 13.3384570896194 u(+): 9.71111552588914 u(-): 16.9657986533496, u: 21.8069043602925 u(+): 26.7311572388547 u(-): 16.8826514817303, u: 12.5179892901974 u(+): 8.06634285154166 u(-): 16.969635728853, u: 12.1611031232659 u(+): 7.35112535425775 u(-): 16.9710808922741, u: 11.8356959771194 u(+): 6.69911121281346 u(-): 16.9722807414254, u: 11.5390219941537 u(+): 6.10476707720504 u(-): 16.9732769111024, u: 11.2685676535287 u(+): 5.56303133507064 u(-): 16.9741039719867, u: 11.0220338291504 u(+): 5.06927702976724 u(-): 16.9747906285335, u: 10.7973188062976 u(+): 4.619276898657 u(-): 16.9753607139383, u: 10.5925023226012 u(+): 4.20917062871157 u(-): 16.9758340164907, u: 10.4058306572056 u(+): 3.83543434856462 u(-): 16.9762269658465, u: 10.2357027624232 u(+): 3.49485232191473 u(-): 16.9765532029317, u: 10.0806574118684 u(+): 3.18449077054603 u(-): 16.9768240531907, u: 12.9093514488038 u(+): 8.85080778741447 u(-): 16.967895110193, u: 9.89873719299274 u(+): 13.3111899877454 u(-): 6.48628439824005, u: 9.8105982235734 u(+): 2.64396083839469 u(-): 16.9772356087521, u: 13.808863944373 u(+): 10.654454244434 u(-): 16.9632736443121, u: 14.3244395590885 u(+): 11.6886465940387 u(-): 16.9602325241382, u: 14.8893800543022 u(+): 12.8221902440489 u(-): 16.9565698645556, u: 15.5082271388276 u(+): 14.0642955474207 u(-): 16.9521587302345, u: 16.1858820840838 u(+): 15.4249178635217 u(-): 16.9468463046459, u: 16.9276148878956 u(+): 16.9147811434809 u(-): 16.9404486323104, u: 17.7390662225642 u(+): 18.5453881434388 u(-): 16.9327443016895, u: 18.6262389236816 u(+): 20.3290109880777 u(-): 16.9234668592856, u: 19.59547467096 u(+): 22.278653635942 u(-): 16.912295705978, u: 20.6534100598811 u(+): 24.4079749392512 u(-): 16.8988451805111, u: 44.7143921217189 u(+): 73.3299561146482 u(-): 16.0988281287896, u: 23.0629287747264 u(+): 29.2627005292543 u(-): 16.8631570201986, u: 24.4284037819287 u(+): 32.0171158426501 u(-): 16.8396917212072, u: 25.9099669784552 u(+): 35.0084832312671 u(-): 16.8114507256432, u: 27.5136484706911 u(+): 38.2498290866557 u(-): 16.7774678547266, u: 29.2444240390715 u(+): 41.7522639547007 u(-): 16.7365841234422, u: 31.1056076850141 u(+): 45.523804856749 u(-): 16.6874105132792, u: 33.0980344714138 u(+): 49.5677847817495 u(-): 16.628284161078, u: 35.2189715421063 u(+): 53.8807259740636 u(-): 16.557217110149, u: 37.4606798236462 u(+): 58.4495228069701 u(-): 16.4718368403223, u: 39.8085316088755 u(+): 63.2477452095258 u(-): 16.3693180082252, u: 42.2385713831595 u(+): 68.2308374736338 u(-): 16.2463052926853, u: 9.93936132551256 u(+): 2.90167373146817 u(-): 16.9770489195569, u: 47.1831936357821 u(+): 78.4441775430753 u(-): 15.9222097284889, u: 49.5709068562871 u(+): 83.4308380608577 u(-): 15.7109756517164, u: 51.7763345236067 u(+): 88.0938967867559 u(-): 15.4587722604576, u: 53.6644259835041 u(+): 92.1705375143003 u(-): 15.1583144527079, u: 55.059173896556 u(+): 95.3169490810705 u(-): 14.8013987120415, u: 55.7374047647912 u(+): 97.0957601344389 u(-): 14.3790493951434, u: 55.4263969275124 u(+): 96.9708624555068 u(-): 13.8819313995181, u: 53.8119194545046 u(+): 94.3225296516448 u(-): 13.3013092573644, u: 50.5720814205628 u(+): 88.5129474527502 u(-): 12.6312153883754, u: 45.477471759459 u(+): 79.0811933644852 u(-): 11.8737501544328, u: 38.7016527285237 u(+): 66.3473264103848 u(-): 11.0559790466626, u: 32.5360441512728 u(+): 54.6880249059613 u(-): 10.3840633965843, u: 11.3133374612231 u(+): 15.7160214578431 u(-): 6.91065346460318, u: 25.6422028800907 u(+): 41.7265385315787 u(-): 9.5578672286026, u: 23.1810249759687 u(+): 37.1441922663847 u(-): 9.21785768555279, u: 21.098763804214 u(+): 33.2919852653337 u(-): 8.90554234309428, u: 19.3027571875436 u(+): 29.9913551362322 u(-): 8.61415923885501, u: 17.7329377720215 u(+): 27.126520556407 u(-): 8.33935498763606, u: 16.3473534090971 u(+): 24.6166169750971 u(-): 8.07808984309705, u: 15.115122806995 u(+): 22.4021328315259 u(-): 7.828112782464, u: 14.0125984746612 u(+): 20.4375191111864 u(-): 7.5876778381361, u: 13.0211036780734 u(+): 18.6868299003219 u(-): 7.35537745582496, u: 12.1255158312485 u(+): 17.1209932843606 u(-): 7.1300383781364, u: 5.01629742047763 u(+): 5.76118452029837 u(-): 4.27141032065689, u: 10.574063570423 u(+): 14.451791740483 u(-): 6.69633540036302, u: 5.34320890968529 u(+): 6.21042604783559 u(-): 4.475991771535, u: 9.27962883921339 u(+): 12.2794924421575 u(-): 6.27976523626925, u: 8.71000004811975 u(+): 11.3439093184823 u(-): 6.07609077775719, u: 8.18392560553047 u(+): 10.4932410320173 u(-): 5.87461017904364, u: 7.69615770165488 u(+): 9.71761476431113 u(-): 5.67470063899863, u: 7.24202077226652 u(+): 9.00827958481754 u(-): 5.4757619597155, u: 6.81732930822917 u(+): 8.35744515084972 u(-): 5.27721346560863, u: 6.41832326133426 u(+): 7.75815350023223 u(-): 5.07849302243628, u: 6.04161727124603 u(+): 7.20417650208597 u(-): 4.87905804040609, u: 5.68416103392168 u(+): 6.6899336123837 u(-): 4.67838845545965, u: 0.749250456004579 u(+): 0.761008846268785 u(-): 0.737492065740373, u: 0.955012289135609 u(+): 0.974271820583124 u(-): 0.935752757688094, u: 4.7012296828015 u(+): 5.33822840506479 u(-): 4.06423096053821, u: 4.39606610718325 u(+): 4.93803473276838 u(-): 3.85409748159811, u: 4.09912089408568 u(+): 4.55751575294839 u(-): 3.64072603522297, u: 3.80896398663158 u(+): 4.19400405491771 u(-): 3.42392391834546, u: 3.52442821067121 u(+): 3.84524437294772 u(-): 3.20361204839469, u: 3.24462134441137 u(+): 3.50939126331194 u(-): 2.9798514255108, u: 2.96894280909193 u(+): 3.18501182951505 u(-): 2.75287378866882, u: 2.69710454773756 u(+): 2.87109259160311 u(-): 2.52311650387201, u: 2.42915544166565 u(+): 2.56704944233751 u(-): 2.29126144099378, u: 2.16550827407728 u(+): 2.27273939520194 u(-): 2.05827715295261, u: 1.90696773791643 u(+): 1.98847247815515 u(-): 1.8254629976777, u: 1.65475722961533 u(+): 1.71502161183204 u(-): 1.59449284739861, u: 1.41054106006723 u(+): 1.4536275375725 u(-): 1.36745458256196, u: 1.17643707852474 u(+): 1.20599466512222 u(-): 1.14687949192727, u: 0.562475371316397 u(+): 0.569075139732913 u(-): 0.555875602899881, u: 0.398205572908159 u(+): 0.401518465982896 u(-): 0.394892679833422, u: 0.259904679450181 u(+): 0.261330224425616 u(-): 0.258479134474746, u: 0.150574589890112 u(+): 0.151064764575315 u(-): 0.150084415204909, u: 0.0721146028734646 u(+): 0.072232878498655 u(-): 0.0719963272482743, u: 0.0243358572312705 u(+): 0.0243508921711342 u(-): 0.0243208222914067, u: 0.00347561164687045 u(+): 0.00347602387369819 u(-): 0.00347519942004271, u: 0 u(+): 0 u(-): 0, u: 28.643101503207 u(+): 47.348698665355 u(-): 9.93750434105902, u: 9.69325875624097 u(+): 2.40912691026177 u(-): 16.9773906022202, ]"
plot_data_from_PARTONS(x_grid, Hu, 1e-2, 2)
# GK model at scale 20 GeV2
x_grid = "[0.000100 [none], 0.000110 [none], 0.000120 [none], 0.000132 [none], 0.000145 [none], 0.000159 [none], 0.000175 [none], 0.000192 [none], 0.000210 [none], 0.000231 [none], 0.000254 [none], 0.000278 [none], 0.000305 [none], 0.000335 [none], 0.000368 [none], 0.000404 [none], 0.000443 [none], 0.000486 [none], 0.000534 [none], 0.000586 [none], 0.000643 [none], 0.000705 [none], 0.000774 [none], 0.000850 [none], 0.000933 [none], 0.001024 [none], 0.001123 [none], 0.001233 [none], 0.001353 [none], 0.001485 [none], 0.001630 [none], 0.001789 [none], 0.001963 [none], 0.002154 [none], 0.002364 [none], 0.002595 [none], 0.002848 [none], 0.003126 [none], 0.003430 [none], 0.003765 [none], 0.004132 [none], 0.004535 [none], 0.004977 [none], 0.005462 [none], 0.005995 [none], 0.006579 [none], 0.007221 [none], 0.007925 [none], 0.008697 [none], 0.009545 [none], 0.010476 [none], 0.011498 [none], 0.012619 [none], 0.013849 [none], 0.015199 [none], 0.016681 [none], 0.018307 [none], 0.020092 [none], 0.022051 [none], 0.024201 [none], 0.026561 [none], 0.029151 [none], 0.031993 [none], 0.035112 [none], 0.038535 [none], 0.042292 [none], 0.046416 [none], 0.050941 [none], 0.055908 [none], 0.061359 [none], 0.067342 [none], 0.073907 [none], 0.081113 [none], 0.089022 [none], 0.097701 [none], 0.107227 [none], 0.117681 [none], 0.129155 [none], 0.141747 [none], 0.155568 [none], 0.170735 [none], 0.187382 [none], 0.205651 [none], 0.225702 [none], 0.247708 [none], 0.271859 [none], 0.298365 [none], 0.327455 [none], 0.359381 [none], 0.394421 [none], 0.432876 [none], 0.475081 [none], 0.521401 [none], 0.572237 [none], 0.628029 [none], 0.689261 [none], 0.756463 [none], 0.830218 [none], 0.911163 [none], 1.000000 [none], ]"
Hu = "[u: 12.210066 u(+): 2.903479 u(-): 21.516652, u: 12.351647 u(+): 3.186543 u(-): 21.516751, u: 12.506989 u(+): 3.497189 u(-): 21.516789, u: 12.677430 u(+): 3.838099 u(-): 21.516761, u: 12.864438 u(+): 4.212217 u(-): 21.516659, u: 13.069622 u(+): 4.622771 u(-): 21.516473, u: 13.294745 u(+): 5.073298 u(-): 21.516191, u: 13.541740 u(+): 5.567682 u(-): 21.515797, u: 13.812722 u(+): 6.110171 u(-): 21.515274, u: 14.110014 u(+): 6.705429 u(-): 21.514598, u: 14.436149 u(+): 7.358556 u(-): 21.513742, u: 14.793908 u(+): 8.075144 u(-): 21.512672, u: 15.186329 u(+): 8.861312 u(-): 21.511347, u: 15.616729 u(+): 9.723740 u(-): 21.509719, u: 16.088744 u(+): 10.669762 u(-): 21.507727, u: 16.606315 u(+): 11.707330 u(-): 21.505300, u: 17.173772 u(+): 12.845192 u(-): 21.502351, u: 17.795795 u(+): 14.092815 u(-): 21.498776, u: 18.477486 u(+): 15.460524 u(-): 21.494448, u: 19.224396 u(+): 16.959577 u(-): 21.489215, u: 20.042456 u(+): 18.602018 u(-): 21.482894, u: 20.938201 u(+): 20.401138 u(-): 21.475264, u: 21.918430 u(+): 22.370800 u(-): 21.466059, u: 22.990660 u(+): 24.526361 u(-): 21.454959, u: 24.162715 u(+): 26.883852 u(-): 21.441579, u: 25.442820 u(+): 29.460185 u(-): 21.425455, u: 26.839844 u(+): 32.273660 u(-): 21.406027, u: 28.362290 u(+): 35.341953 u(-): 21.382627, u: 30.019753 u(+): 38.685063 u(-): 21.354443, u: 31.820340 u(+): 42.320172 u(-): 21.320508, u: 33.773025 u(+): 46.266396 u(-): 21.279653, u: 35.885327 u(+): 50.540179 u(-): 21.230476, u: 38.162400 u(+): 55.153500 u(-): 21.171301, u: 40.609520 u(+): 60.118946 u(-): 21.100094, u: 43.223832 u(+): 65.433198 u(-): 21.014467, u: 46.003625 u(+): 71.095759 u(-): 20.911491, u: 48.933428 u(+): 77.079111 u(-): 20.787744, u: 51.992926 u(+): 83.346759 u(-): 20.639092, u: 55.148502 u(+): 89.836427 u(-): 20.460576, u: 58.342487 u(+): 96.438439 u(-): 20.246534, u: 61.506689 u(+): 103.023641 u(-): 19.989738, u: 64.523823 u(+): 109.364998 u(-): 19.682648, u: 67.255914 u(+): 115.196876 u(-): 19.314952, u: 69.504637 u(+): 120.132785 u(-): 18.876489, u: 71.046244 u(+): 123.734835 u(-): 18.357653, u: 71.493648 u(+): 125.249312 u(-): 17.737985, u: 70.775734 u(+): 124.520841 u(-): 17.030626, u: 67.394100 u(+): 118.649406 u(-): 16.138794, u: 61.881005 u(+): 108.659331 u(-): 15.102678, u: 52.347389 u(+): 90.734163 u(-): 13.960615, u: 42.236752 u(+): 71.572315 u(-): 12.901188, u: 35.945075 u(+): 59.712308 u(-): 12.177842, u: 31.532450 u(+): 51.456758 u(-): 11.608141, u: 28.097869 u(+): 45.087403 u(-): 11.108336, u: 25.238492 u(+): 39.825756 u(-): 10.651227, u: 22.835826 u(+): 35.443527 u(-): 10.228126, u: 20.755991 u(+): 31.681981 u(-): 9.830002, u: 18.942621 u(+): 28.432472 u(-): 9.452770, u: 17.346352 u(+): 25.599907 u(-): 9.092798, u: 15.928463 u(+): 23.109344 u(-): 8.747582, u: 14.665088 u(+): 20.915194 u(-): 8.414982, u: 13.530391 u(+): 18.967271 u(-): 8.093511, u: 12.508915 u(+): 17.236164 u(-): 7.781666, u: 11.584407 u(+): 15.690433 u(-): 7.478382, u: 10.744699 u(+): 14.306689 u(-): 7.182709, u: 9.979462 u(+): 13.065317 u(-): 6.893608, u: 9.279012 u(+): 11.947462 u(-): 6.610561, u: 8.636076 u(+): 10.939637 u(-): 6.332516, u: 8.043205 u(+): 10.027262 u(-): 6.059148, u: 7.494643 u(+): 9.199610 u(-): 5.789676, u: 6.984928 u(+): 8.446242 u(-): 5.523614, u: 6.509340 u(+): 7.758114 u(-): 5.260567, u: 6.063774 u(+): 7.127651 u(-): 4.999897, u: 5.644468 u(+): 6.547501 u(-): 4.741436, u: 5.248227 u(+): 6.011837 u(-): 4.484617, u: 4.872154 u(+): 5.515004 u(-): 4.229303, u: 4.513765 u(+): 5.052307 u(-): 3.975224, u: 4.170909 u(+): 4.619547 u(-): 3.722271, u: 3.841766 u(+): 4.213127 u(-): 3.470404, u: 3.524837 u(+): 3.829977 u(-): 3.219696, u: 3.218937 u(+): 3.467533 u(-): 2.970340, u: 2.923193 u(+): 3.123716 u(-): 2.722670, u: 2.637049 u(+): 2.796913 u(-): 2.477185, u: 2.360267 u(+): 2.485964 u(-): 2.234570, u: 2.092934 u(+): 2.190152 u(-): 1.995716, u: 1.835461 u(+): 1.909186 u(-): 1.761736, u: 1.588593 u(+): 1.643190 u(-): 1.533995, u: 1.353398 u(+): 1.392684 u(-): 1.314113, u: 1.131258 u(+): 1.158548 u(-): 1.103968, u: 0.923832 u(+): 0.941982 u(-): 0.905681, u: 0.733026 u(+): 0.744459 u(-): 0.721593, u: 0.560911 u(+): 0.567632 u(-): 0.554191, u: 0.409601 u(+): 0.413212 u(-): 0.405989, u: 0.281083 u(+): 0.282805 u(-): 0.279361, u: 0.176995 u(+): 0.177690 u(-): 0.176299, u: 0.098265 u(+): 0.098485 u(-): 0.098045, u: 0.044625 u(+): 0.044672 u(-): 0.044577, u: 0.014009 u(+): 0.014014 u(-): 0.014004, u: 0.001776 u(+): 0.001776 u(-): 0.001776, u: 0.000000 u(+): 0.000000 u(-): 0.000000, ]"
plot_data_from_PARTONS(x_grid, Hu, 1e-2, 20, ls="--")
plt.show()