Plots and Numass update

This commit is contained in:
Alexander Nozik 2017-10-18 12:19:03 +03:00
parent 08fb62b141
commit 755a901d2e
4 changed files with 18 additions and 18 deletions

View File

@ -30,13 +30,13 @@ new GrindShell(ctx).eval {
NumassStorage storage = NumassStorageFactory.buildLocal(rootDir);
Meta meta = Grind.buildMeta(binNum: 200, plotHist: false) {
Meta meta = Grind.buildMeta(binNum: 200) {
window(lo: 500, up: 1800)
plot(showErrors: false)
}
def sets = ((2..14) + (22..31)).collect { "set_$it" }
//def sets = (2..14).collect { "set_$it" }
//def sets = ((2..14) + (22..31)).collect { "set_$it" }
def sets = (2..14).collect { "set_$it" }
//def sets = (16..31).collect { "set_$it" }
//def sets = (20..28).collect { "set_$it" }

View File

@ -55,7 +55,7 @@ public class MonitorCorrectAction extends OneToOneAction<Table, Table> {
//private static final String[] monitorNames = {"timestamp", NumassAnalyzer.COUNT_KEY, NumassAnalyzer.COUNT_RATE_KEY, NumassAnalyzer.COUNT_RATE_KEY};
CopyOnWriteArrayList<Values> monitorPoints = new CopyOnWriteArrayList<>();
private CopyOnWriteArrayList<Values> monitorPoints = new CopyOnWriteArrayList<>();
//FIXME remove from state
@Override
@ -69,17 +69,17 @@ public class MonitorCorrectAction extends OneToOneAction<Table, Table> {
return sourceData;
}
double norm = 0;
double totalAv = 0;
StringBuilder head = new StringBuilder();
head.append(String.format("%20s\t%10s\t%s%n", "timestamp", "Count", "CR in window"));
for (Values dp : index.values()) {
head.append(String.format("%20s\t%10d\t%g%n", getTime(dp).toString(), getTotal(dp), getCR(dp)));
norm += getCR(dp) / index.size();
totalAv += getTotal(dp) / index.size();
monitorPoints.add(dp);
}
head.append(String.format("%20s\t%10g\t%g%n", "Average", totalAv, norm));
// double totalAv = 0;
// StringBuilder head = new StringBuilder();
// head.append(String.format("%20s\t%10s\t%s%n", "timestamp", "Count", "CR in window"));
// for (Values dp : index.values()) {
// head.append(String.format("%20s\t%10d\t%g%n", getTime(dp).toString(), getTotal(dp), getCR(dp)));
// norm += getCR(dp) / index.size();
// totalAv += getTotal(dp) / index.size();
// monitorPoints.add(dp);
// }
//
// head.append(String.format("%20s\t%10g\t%g%n", "Average", totalAv, norm));
List<Values> dataList = new ArrayList<>();

View File

@ -286,7 +286,7 @@ class NumassLoaderView : View() {
data.points.map { point ->
val count = NumassAnalyzer.countInWindow(getSpectrum(point), loChannel, upChannel);
val seconds = point.length.toMillis() / 1000.0;
spectrumPlot.progress = -1.0;
runLater { spectrumPlot.progress = -1.0 }
ValueMap.ofMap(
mapOf(
XYAdapter.X_AXIS to point.voltage,

View File

@ -3,8 +3,8 @@ package inr.numass.viewer
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.Logger
import hep.dataforge.context.Global
import hep.dataforge.kodex.fx.dfIcon
import hep.dataforge.storage.commons.StorageManager
import javafx.scene.image.Image
import javafx.stage.Stage
import org.slf4j.LoggerFactory
import tornadofx.*
@ -15,7 +15,7 @@ import tornadofx.*
class Viewer : App(MainView::class) {
override fun start(stage: Stage) {
stage.icons += Image(Global::class.java.getResourceAsStream("/resource/img/df.png"))
stage.icons += dfIcon
(LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) as Logger).level = Level.INFO
Global.setDefaultContext(Global.instance())
StorageManager().startGlobal()