Fix automatic dependency loading for output manager

This commit is contained in:
Alexander Nozik 2018-05-25 21:21:32 +03:00
parent 8be357b4ab
commit 2a6c7b75a5
2 changed files with 10 additions and 9 deletions

View File

@ -36,7 +36,6 @@ import java.util.stream.Stream
import kotlin.math.sqrt import kotlin.math.sqrt
import kotlin.streams.asSequence import kotlin.streams.asSequence
import kotlin.streams.asStream import kotlin.streams.asStream
import kotlin.streams.toList
/** /**
@ -99,9 +98,8 @@ class TimeAnalyzer(processor: SignalProcessor? = null) : AbstractAnalyzer(proces
override fun analyzeParent(point: ParentBlock, config: Meta): Values { override fun analyzeParent(point: ParentBlock, config: Meta): Values {
//Average count rates, do not sum events //Average count rates, do not sum events
val res = point.blocks.stream() val res = point.blocks
.map { it -> analyze(it, config) } .map { it -> analyze(it, config) }
.toList()
.mean(config.getEnum("mean", WEIGHTED)) .mean(config.getEnum("mean", WEIGHTED))
val map = HashMap(res.asMap()) val map = HashMap(res.asMap())

View File

@ -1,8 +1,10 @@
package inr.numass.scripts.timeanalysis package inr.numass.scripts.timeanalysis
import hep.dataforge.data.DataSet import hep.dataforge.data.DataSet
import hep.dataforge.fx.output.FXOutputManager
import hep.dataforge.kodex.buildContext import hep.dataforge.kodex.buildContext
import hep.dataforge.kodex.buildMeta import hep.dataforge.kodex.buildMeta
import hep.dataforge.plots.jfreechart.JFreeChartPlugin
import inr.numass.NumassPlugin import inr.numass.NumassPlugin
import inr.numass.actions.TimeAnalyzerAction import inr.numass.actions.TimeAnalyzerAction
import inr.numass.data.NumassDataUtils import inr.numass.data.NumassDataUtils
@ -14,20 +16,21 @@ import inr.numass.data.storage.NumassStorageFactory
fun main(args: Array<String>) { fun main(args: Array<String>) {
val context = buildContext("NUMASS", NumassPlugin::class.java) { val context = buildContext("NUMASS", NumassPlugin::class.java, JFreeChartPlugin::class.java) {
output = FXOutputManager()
rootDir = "D:\\Work\\Numass\\sterile2018_04" rootDir = "D:\\Work\\Numass\\sterile2018_04"
dataDir = "D:\\Work\\Numass\\data\\2018_04" dataDir = "D:\\Work\\Numass\\data\\2018_04"
} }
val storage = NumassStorageFactory.buildLocal(context, "Fill_4", true, false); val storage = NumassStorageFactory.buildLocal(context, "Fill_4/Scattering_1", true, false);
val meta = buildMeta { val meta = buildMeta {
"t0" to 3000 "t0" to 3000
"binNum" to 200 "binNum" to 200
"t0Step" to 100 "t0Step" to 100
"chunkSize" to 3000 "chunkSize" to 3000
"mean" to TimeAnalyzer.AveragingMethod.GEOMETRIC "mean" to TimeAnalyzer.AveragingMethod.ARITHMETIC
// "separateParallelBlocks" to true "separateParallelBlocks" to true
"window" to { "window" to {
"lo" to 0 "lo" to 0
"up" to 4000 "up" to 4000
@ -44,10 +47,10 @@ fun main(args: Array<String>) {
storage.provide("loader::$set", NumassSet::class.java).orElse(null) storage.provide("loader::$set", NumassSet::class.java).orElse(null)
}.filter { it != null } }.filter { it != null }
val hvs = listOf(12000.0, 14000.0, 16000.0)//, 15000d, 15200d, 15400d, 15600d, 15800d]
val all = NumassDataUtils.join("sum", loaders) val all = NumassDataUtils.join("sum", loaders)
val hvs = listOf(18500.0, 18600.0, 18995.0, 19000.0)//listOf(12000.0, 14000.0, 16000.0)//, 15000d, 15200d, 15400d, 15600d, 15800d]
val data = DataSet.edit(NumassPoint::class).apply { val data = DataSet.edit(NumassPoint::class).apply {
hvs.forEach { hv -> hvs.forEach { hv ->
val points = all.points.filter { val points = all.points.filter {