diff --git a/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt
index dd7d9fe2..b943c2b2 100644
--- a/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt
+++ b/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt
@@ -60,7 +60,7 @@ object MergeDataAction : ManyToOneAction
() {
}
override fun afterGroup(context: Context, groupName: String, outputMeta: Meta, output: Table) {
- context.output[name, groupName].render(NumassUtils.wrap(output, outputMeta))
+ context.output.get(name, groupName).render(NumassUtils.wrap(output, outputMeta))
super.afterGroup(context, groupName, outputMeta, output)
}
diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/models/IntegralSpectrum.kt b/numass-main/src/main/kotlin/inr/numass/scripts/models/IntegralSpectrum.kt
index 35d19975..d8f94a6a 100644
--- a/numass-main/src/main/kotlin/inr/numass/scripts/models/IntegralSpectrum.kt
+++ b/numass-main/src/main/kotlin/inr/numass/scripts/models/IntegralSpectrum.kt
@@ -16,15 +16,15 @@
package inr.numass.scripts.models
-import hep.dataforge.context.Global
-import hep.dataforge.fx.plots.display
+import hep.dataforge.fx.output.FXOutputManager
+import hep.dataforge.kodex.buildContext
import hep.dataforge.kodex.configure
import hep.dataforge.kodex.step
import hep.dataforge.meta.Meta
import hep.dataforge.plots.Plot
import hep.dataforge.plots.data.DataPlot
-import hep.dataforge.plots.jfreechart.JFreeChartFrame
import hep.dataforge.plots.jfreechart.JFreeChartPlugin
+import hep.dataforge.plots.output.plot
import hep.dataforge.stat.fit.ParamSet
import inr.numass.NumassPlugin
import inr.numass.models.NBkgSpectrum
@@ -32,10 +32,14 @@ import inr.numass.models.sterile.SterileNeutrinoSpectrum
fun main(args: Array) {
- JFreeChartPlugin().startGlobal()
- NumassPlugin().startGlobal()
- val sp = SterileNeutrinoSpectrum(Global, Meta.empty())
+ val context = buildContext("NUMASS", NumassPlugin::class.java, JFreeChartPlugin::class.java) {
+ output = FXOutputManager()
+ rootDir = "D:\\Work\\Numass\\sterile2018_04"
+ dataDir = "D:\\Work\\Numass\\data\\2018_04"
+ }
+
+ val sp = SterileNeutrinoSpectrum(context, Meta.empty())
//beta.setCaching(false);
val spectrum = NBkgSpectrum(sp)
@@ -55,7 +59,7 @@ fun main(args: Array) {
fun plotSpectrum(name: String, vararg override: Pair): Plot {
val pars = params.copy().apply {
override.forEach {
- setParValue(it.first,it.second)
+ setParValue(it.first, it.second)
}
}
val x = (14000.0..18600.0).step(100.0).toList()
@@ -63,16 +67,16 @@ fun main(args: Array) {
return DataPlot.plot(name, x.toDoubleArray(), y.toDoubleArray())
}
- Global.display {
- JFreeChartFrame().apply {
- plots.configure {
- "showLine" to true
- "showSymbol" to false
- "showErrors" to false
- }
- add(plotSpectrum("base"))
- add(plotSpectrum("noTrap", "trap" to 0.0))
+
+
+ context.plot("default") {
+ plots.configure {
+ "showLine" to true
+ "showSymbol" to false
+ "showErrors" to false
}
+ add(plotSpectrum("base"))
+ add(plotSpectrum("noTrap", "trap" to 0.0))
}
}
\ No newline at end of file