Skip to content

Instantly share code, notes, and snippets.

@AndreasAlbert
Last active October 4, 2021 08:47
Show Gist options
  • Save AndreasAlbert/2befaea9d4b12f9705acaf3a9afbdf36 to your computer and use it in GitHub Desktop.
Save AndreasAlbert/2befaea9d4b12f9705acaf3a9afbdf36 to your computer and use it in GitHub Desktop.
closed contour hepdata
import numpy as np
from hepdata_lib import Submission, Table, Variable
sub = Submission()
tab = Table("test")
x = Variable("x", is_independent=True, is_binned=False)
y1 = Variable("y", is_independent=False, is_binned=False)
y2 = Variable("y", is_independent=False, is_binned=False)
phi = np.linspace(0,2*np.pi, 50)
x.values = np.cos(phi)
y1.values = np.sin(phi)
y2.values = 1.1*np.sin(phi)
y1.add_qualifier("Exclusion type", "Expected")
y2.add_qualifier("Exclusion type", "Observed")
tab.add_variable(x)
tab.add_variable(y1)
tab.add_variable(y2)
sub.add_table(tab)
sub.create_files("./output")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment