Multiple fixes in value representation

This commit is contained in:
Alexander Nozik 2018-05-10 12:25:17 +03:00
parent 1072f56815
commit 4194422352
4 changed files with 23 additions and 22 deletions

View File

@ -84,6 +84,7 @@ class TimeAnalyzer @JvmOverloads constructor(private val processor: SignalProces
override fun analyzePoint(point: NumassPoint, config: Meta): Values {
//Average count rates, do not sum events
val res = point.blocks.stream()
.filter { it.events.findAny().isPresent }// filter for empty blocks
.map { it -> analyze(it, config) }
.reduce(null) { v1, v2 -> this.combineBlockResults(v1, v2) }

View File

@ -18,4 +18,10 @@ class SimpleNumassPoint(override val blocks: List<NumassBlock>, meta: Meta) : Me
constructor(blocks: Collection<NumassBlock>, voltage: Double) :
this(blocks.sortedBy { it.startTime }, MetaBuilder("point").setValue(NumassPoint.HV_KEY, voltage))
init {
if(blocks.isEmpty()){
throw IllegalArgumentException("No blocks in collection")
}
}
}

View File

@ -37,18 +37,12 @@ class TimeAnalyzerAction : OneToOneAction<NumassPoint, Table>() {
override fun execute(context: Context, name: String, input: NumassPoint, inputMeta: Laminate): Table {
val log = getLog(context, name);
//val t0 = inputMeta.getDouble("t0", 30e3);
// val loChannel = inputMeta.getInt("window.lo", 500);
// val upChannel = inputMeta.getInt("window.up", 10000);
val pm = context.get(PlotPlugin::class.java);
val pm = context[PlotPlugin::class.java];
val trueCR = analyzer.analyze(input, inputMeta).getDouble("cr")
log.report("The expected count rate for 30 us delay is $trueCR")
val binNum = inputMeta.getInt("binNum", 1000);
val binSize = inputMeta.getDouble("binSize", 1.0 / trueCR * 10 / binNum * 1e6)

View File

@ -15,7 +15,7 @@ import inr.numass.data.storage.NumassStorageFactory
fun main(args: Array<String>) {
val context = buildContext("NUMASS", NumassPlugin::class.java, FXPlotManager::class.java) {
rootDir = "D:\\Work\\Numass\\sterile\\2018_04"
rootDir = "D:\\Work\\Numass\\sterile2018_04"
dataDir = "D:\\Work\\Numass\\data\\2018_04"
}
@ -23,10 +23,9 @@ fun main(args: Array<String>) {
val meta = buildMeta {
"binNum" to 200
"inverted" to true
node("window") {
"lo" to 500
"up" to 3000
"lo" to 0
"up" to 4000
}
"plot.showErrors" to false
}
@ -46,16 +45,16 @@ fun main(args: Array<String>) {
val data = DataSet.edit(NumassPoint::class).apply {
hvs.forEach { hv ->
val points = all.points.filter {
it.voltage == hv
}.toList()
if (!points.isEmpty()) {
putStatic(
"point_${hv.toInt()}",
SimpleNumassPoint(
all.points.filter {
it.voltage == hv
}.toList(),
hv
)
SimpleNumassPoint(points, hv)
)
}
}
}.build()
@ -63,4 +62,5 @@ fun main(args: Array<String>) {
result.computeAll();
readLine()
}