From 500037fd42218835fd16bb3a2301eb6548e22ad9 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 25 Jul 2018 20:01:06 +0300 Subject: [PATCH] Fix in JFreeChart and general plotting --- .../main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt | 6 +++--- .../kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt index 30d10325..abe2adb2 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt @@ -77,7 +77,7 @@ object TimeAnalyzerAction : OneToOneAction() { cr / 1e6 * initialEstimate.getInt(NumassAnalyzer.COUNT_KEY) * binSize * Math.exp(-it * cr / 1e6) } - context.plot(listOf(histogramPlot, functionPlot), "histogram", name) { + context.plot(listOf(histogramPlot, functionPlot), stage = this.name, name = "histogram") { "xAxis" to { "title" to "delay" "units" to "us" @@ -98,7 +98,7 @@ object TimeAnalyzerAction : OneToOneAction() { configure(inputMeta.getMetaOrEmpty("plot")) } - context.plot(statPlot, "stat-method", name) { + context.plot(statPlot, stage = this.name, name = "stat-method") { "xAxis" to { "title" to "delay" "units" to "us" @@ -118,7 +118,7 @@ object TimeAnalyzerAction : OneToOneAction() { 1.0 } - (0..steps).map { minT0 + (maxT0-minT0)/steps*it }.map { t -> + (0..steps).map { minT0 + (maxT0 - minT0) / steps * it }.map { t -> val result = analyzer.analyze(input, analyzerMeta.builder.setValue("t0", t)) if (Thread.currentThread().isInterrupted) { diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt b/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt index 5c7fceb8..4cf1fd4f 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt @@ -69,4 +69,6 @@ fun main(args: Array) { } TimeAnalyzerAction.simpleRun(point, meta); + + readLine() } \ No newline at end of file