From dd240e793e164affe1857d10b6bd7ce5bb58a422 Mon Sep 17 00:00:00 2001
From: Maxim Gonchar <maxim.mg.gonchar@gmail.com>
Date: Thu, 25 May 2023 18:58:01 +0300
Subject: [PATCH] chore: plot integral

---
 models/dayabay_v0.py             | 11 +++++++++--
 submodules/dagflow-reactornueosc |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/models/dayabay_v0.py b/models/dayabay_v0.py
index bc509e4..cb97255 100644
--- a/models/dayabay_v0.py
+++ b/models/dayabay_v0.py
@@ -2,9 +2,9 @@ from dagflow.bundles.load_parameters import load_parameters
 from pathlib import Path
 
 from dagflow.graph import Graph
-from dagflow.graphviz import savegraph
 from dagflow.lib.arithmetic import Sum
 from dagflow.tools.schema import LoadYaml
+from dagflow.plot import plot_auto
 from gindex import GNIndex
 from dagflow.storage import NodeStorage
 
@@ -63,7 +63,7 @@ def model_dayabay_v0():
         from dagflow.lib.Array import Array
         from dagflow.lib.View import View
         from numpy import linspace
-        edges_costheta=Array.make_stored("edges.costheta", linspace(0, 1, 5), label_from=labels)
+        edges_costheta=Array.make_stored("edges.costheta", [-1, 1], label_from=labels)
         edges_energy_common=Array.make_stored("edges.energy_common", linspace(0, 12, 241), label_from=labels)
         edges_energy_enu=View.make_stored("edges.energy_enu", edges_energy_common, label_from=labels)
         edges_energy_edep=View.make_stored("edges.energy_edep", edges_energy_common, label_from=labels)
@@ -90,7 +90,14 @@ def model_dayabay_v0():
         ibd.outputs['result'] >> integrator
         outputs['kinint'] = integrator.outputs['output']
 
+    storage('outputs').read_labels(labels)
     storage.read_paths()
+
+    from mpl_toolkits.mplot3d import axes3d
+    from matplotlib.pyplot import subplots
+    subplots(1, 1, subplot_kw={'projection': '3d'})
+    plot_auto(storage['outputs.kinint'], method='bar3d')
+
     storage('outputs').plot(show_all=True)
 
     storage['parameter.normalized.detector.eres.b_stat'].value = 1
diff --git a/submodules/dagflow-reactornueosc b/submodules/dagflow-reactornueosc
index e4cd542..7252b54 160000
--- a/submodules/dagflow-reactornueosc
+++ b/submodules/dagflow-reactornueosc
@@ -1 +1 @@
-Subproject commit e4cd542a03d2e1304445ff54fe21d7d7a2011800
+Subproject commit 7252b5435e241a2421476b5be8e6e11d96134d0b
-- 
GitLab