Commit c77b2b94 authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Check nan in plot dl1 param

parent 726ab9c3
Pipeline #112414 passed with stage
in 1 minute and 40 seconds
......@@ -20,13 +20,15 @@ def plotCalibEvent(pdf, tabImage, varName, nbbin):
strValue = varName + ", size = " + str(tabValue.size) + ", Min : " + str(tabValue.min()) + ", max : " + str(tabValue.max()) + ", mean : " + str(tabValue.mean()) + ", std : " + str(tabValue.std())
print(strValue)
plt.hist(tabValue, bins=nbbin, alpha=1.0)
plt.xlabel(varName)
plt.title("Signal "+varName)
plt.ylabel("nb")
plt.yscale("log")
plt.grid()
try:
plt.hist(tabValue, bins=nbbin, alpha=1.0)
plt.xlabel(varName)
plt.title("Signal "+varName)
plt.ylabel("nb")
plt.yscale("log")
plt.grid()
except ValueError:
print("Only NaN in",varName," => skip plot")
plt.text(0.05, 0.95, strValue, transform=fig.transFigure, size=14)
pdf.savefig() # saves the current figure into a pdf page
plt.close()
......@@ -50,14 +52,16 @@ def plotParam(pdf, tabParam, tabIsGoodEvent, varName, nbbin):
strValue = varName + ", size = " + str(tabValue.size) + ", Min : " + str(tabValue.min()) + ", max : " + str(tabValue.max()) + ", mean : " + str(tabValue.mean()) + ", std : " + str(tabValue.std())
print(strValue)
plt.hist(tabValue, bins=nbbin, alpha=1.0)
plt.xlabel(varName)
plt.title("Parameter "+varName)
plt.ylabel("nb")
plt.yscale("log")
plt.grid()
try:
plt.hist(tabValue, bins=nbbin, alpha=1.0)
plt.xlabel(varName)
plt.title("Parameter "+varName)
plt.ylabel("nb")
plt.yscale("log")
plt.grid()
except ValueError:
print("Only NaN in",varName," => skip plot")
plt.text(0.05, 0.95, strValue, transform=fig.transFigure, size=14)
pdf.savefig() # saves the current figure into a pdf page
plt.close()
except KeyError:
......
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