Minor fixes to visualization.

This commit is contained in:
Alexander Nozik 2018-05-22 17:00:32 +03:00
parent 01d1fe5528
commit 4a1752ca07
5 changed files with 21 additions and 16 deletions

View File

@ -84,8 +84,8 @@ class TimeSpectrumAction : OneToOneAction<NumassPoint, Table>() {
context.plot("histogram", name, histogramPlot) { context.plot("histogram", name, histogramPlot) {
"xAxis" to { "xAxis" to {
"axisTitle" to "delay" "title" to "delay"
"axisUnits" to "us" "units" to "us"
} }
"yAxis" to { "yAxis" to {
"type" to "log" "type" to "log"

View File

@ -6,6 +6,7 @@ import hep.dataforge.kodex.buildMeta
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
import inr.numass.data.analyzers.TimeAnalyzer
import inr.numass.data.api.NumassPoint import inr.numass.data.api.NumassPoint
import inr.numass.data.api.NumassSet import inr.numass.data.api.NumassSet
import inr.numass.data.api.SimpleNumassPoint import inr.numass.data.api.SimpleNumassPoint
@ -25,8 +26,9 @@ fun main(args: Array<String>) {
"binNum" to 200 "binNum" to 200
"t0Step" to 100 "t0Step" to 100
"chunkSize" to 3000 "chunkSize" to 3000
"mean" to TimeAnalyzer.AveragingMethod.GEOMETRIC
// "separateParallelBlocks" to true // "separateParallelBlocks" to true
node("window") { "window" to {
"lo" to 0 "lo" to 0
"up" to 4000 "up" to 4000
} }

View File

@ -12,7 +12,7 @@ if (!hasProperty('mainClass')) {
mainClassName = mainClass mainClassName = mainClass
version = "0.5.1 - SNAPSHOT" version = "0.5.2 - SNAPSHOT"
description = "The viewer for numass data" description = "The viewer for numass data"

View File

@ -92,10 +92,15 @@ class AmplitudeView : View(title = "Numass amplitude spectrum plot", icon = Imag
} }
binningProperty.onChange { binningProperty.onChange {
clear() frame.plots.clear()
plots.clear()
invalidate()
} }
normalizeProperty.onChange { normalizeProperty.onChange {
clear() frame.plots.clear()
plots.clear()
invalidate()
} }
container.progressProperty.bind(progress) container.progressProperty.bind(progress)
@ -161,8 +166,10 @@ class AmplitudeView : View(title = "Numass amplitude spectrum plot", icon = Imag
fun clear() { fun clear() {
data.clear() data.clear()
// frame.plots.clear() plots.values.forEach{
// plots.clear() it.cancel()
}
plots.clear()
invalidate() invalidate()
} }

View File

@ -35,15 +35,11 @@ class CachedPoint(val point: NumassPoint) : NumassPoint by point {
override val meta: Meta = point.meta override val meta: Meta = point.meta
val channelSpectra: Deferred<Map<Int, Table>> val channelSpectra: Deferred<Map<Int, Table>> = async(start = CoroutineStart.LAZY) {
get() = async(start = CoroutineStart.LAZY) { point.channels.mapValues { (_, value) -> analyzer.getAmplitudeSpectrum(value) }
return@async point.channels.mapValues { (_, value) -> analyzer.getAmplitudeSpectrum(value) }
} }
val spectrum: Deferred<Table> val spectrum: Deferred<Table> = async(start = CoroutineStart.LAZY) { analyzer.getAmplitudeSpectrum(point) }
get() = async(start = CoroutineStart.LAZY) {
analyzer.getAmplitudeSpectrum(point)
}
} }
class CachedSet(set: NumassSet) : NumassSet by set { class CachedSet(set: NumassSet) : NumassSet by set {