Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions nnpdf_data/nnpdf_data/filter_utils/eic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def write_data(
asym: bool = True,
abserr: Optional[Union[np.ndarray, None]] = None,
add_fluctuate: bool = False,
sys_error: float = 0.0,
suffix: str = "",
) -> None:
"""Write the input kinematics, central values, and uncertainties
into the new commondata format.
Expand All @@ -122,7 +124,7 @@ def write_data(
print(f"The dataset has {len(data_central)} datapoints!")

data_central_yaml = {"data_central": data_central}
with open("data.yaml", "w") as file:
with open(f"data_{suffix}.yaml", "w") as file:
yaml.dump(data_central_yaml, file, sort_keys=False)

if asym:
Expand Down Expand Up @@ -184,15 +186,18 @@ def write_data(

# -----------------------------------------------------------------
# Prepare the uncertainty values
errors = [{"stat": float(d["abs"]), "sys": 0.0} for _, d in df.iterrows()]
errors = [
{"stat": float(d["abs"]), "sys": float(data_central[i] * sys_error)}
for i, d in df.iterrows()
]

error_definition = {
"stat": {
"description": "statistical uncertainty",
"treatment": "ADD",
"type": "UNCORR",
},
"sys": {"description": "systematic uncertainty", "treatment": "ADD", "type": "UNCORR"},
"sys": {"description": "systematic uncertainty", "treatment": "MULT", "type": "CORR"},
}

# -----------------------------------------------------------------
Expand All @@ -202,5 +207,5 @@ def write_data(
yaml.dump(kinematics_yaml, file, sort_keys=False)

uncertainties_yaml = {"definitions": error_definition, "bins": errors}
with open("uncertainties.yaml", "w") as file:
with open(f"uncertainties_{suffix}.yaml", "w") as file:
yaml.dump(uncertainties_yaml, file, sort_keys=False)
124 changes: 0 additions & 124 deletions nnpdf_data/nnpdf_data/new_commondata/ATHENA_NC_105GEV_EP/data.yaml

This file was deleted.

124 changes: 124 additions & 0 deletions nnpdf_data/nnpdf_data/new_commondata/ATHENA_NC_105GEV_EP/data_nlo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
data_central:
- -7.9686135798526e-05
- 0.0002622778592100214
- -8.971990952500228e-05
- 0.0003628747566496608
- 0.0003025455606930224
- -0.0003289396500082594
- 0.000527054559951973
- 0.0004032644714491676
- 0.0001481775475596897
- -0.0006079219455117313
- 0.0005024371133567035
- 0.0005457329516728618
- 0.0005443908463106457
- 0.00017035475863076682
- -0.0002337125541561955
- 0.0005645489349221586
- 0.0007706117390689029
- 0.0006587939550546941
- 0.0009382957243788438
- 0.000777917208132874
- 0.00037375785249127105
- 0.00047748047883363243
- 0.0007119676009007722
- 0.0008295811417789234
- 0.0011488113066331566
- 0.001450630379123243
- 0.002078282116525751
- 0.0024206334590696587
- 0.0004405019776883573
- 0.0007483436903050735
- 0.0009872885740138074
- 0.0013416345834552875
- 0.0018842729468733271
- 0.00258061458881251
- 0.0039818104246081626
- 0.005626434699792646
- 0.0006934233360681582
- 0.001028315280783365
- 0.0014186099044476248
- 0.0019842314954966905
- 0.002997442001906029
- 0.004799903586210154
- 0.007185279701466692
- 0.011048600628194181
- 0.0008483582626409018
- 0.0012098791895980272
- 0.0020981550383013287
- 0.0032510779021936356
- 0.004924952060087364
- 0.007869355840293713
- 0.012327664818173363
- 0.019373305654178406
- 0.0012702189970770893
- 0.0019516512271589685
- 0.0027882257686412757
- 0.004709829515748181
- 0.0076610106528119705
- 0.011941775238752323
- 0.020512539207820386
- 0.033199757077112244
- 0.001766225587548656
- 0.0028700405543423996
- 0.00445125142621223
- 0.007328448152888959
- 0.011373304782740777
- 0.019174161857557808
- 0.03192182372156644
- 0.052150831686440184
- 0.0024532942817132005
- 0.004389477501758794
- 0.006998345079620076
- 0.01056874188430606
- 0.018037201498317657
- 0.028670268151369555
- 0.04870711544113141
- 0.0809062734710754
- 0.003761905022154242
- 0.00609560205469274
- 0.009009697922423439
- 0.0155883006163242
- 0.025115802273797182
- 0.04360557684501048
- 0.07282022986865623
- 0.1187394126377662
- 0.005296962994242974
- 0.008713152265362425
- 0.01379190285650563
- 0.02254310429766776
- 0.03644366417781698
- 0.061166719038238254
- 0.1013487295607234
- 0.1675171964965923
- 0.007170480945043473
- 0.01207701366471271
- 0.018426746989812726
- 0.030887562862464444
- 0.04924067191448828
- 0.0836229782621661
- 0.13723561833633344
- 0.22225297807177194
- 0.010180052675848867
- 0.01546611145021116
- 0.02573869826452503
- 0.04043385918178369
- 0.06758788773895415
- 0.10690652802285827
- 0.1774920798074007
- 0.2886214497436867
- 0.012675193009394273
- 0.018662707587756032
- 0.03589600521832406
- 0.05419357611943356
- 0.07841029808872996
- 0.13592881332923945
- 0.21975087129836593
- 0.34091679158712623
- 0.008261810311290464
- 0.030557722485239133
- 0.03545078323896834
- 0.07774683149865645
- 0.11086575147231159
- 0.16948280631982732
- 0.24658998569172716
Loading