Minor fixes
This commit is contained in:
parent
44ebe4680a
commit
4655449966
@ -13,9 +13,10 @@ import hep.dataforge.data.DataNode
|
||||
import hep.dataforge.grind.GrindShell
|
||||
import hep.dataforge.grind.helpers.PlotHelper
|
||||
import hep.dataforge.io.ColumnedDataWriter
|
||||
import hep.dataforge.kodex.fx.plots.PlotManager
|
||||
import hep.dataforge.meta.Meta
|
||||
import hep.dataforge.plots.PlotGroup
|
||||
import hep.dataforge.plots.data.DataPlot
|
||||
import hep.dataforge.plots.data.PlottableGroup
|
||||
import hep.dataforge.tables.Table
|
||||
import hep.dataforge.tables.TableTransform
|
||||
import hep.dataforge.tables.XYAdapter
|
||||
@ -28,9 +29,9 @@ import static inr.numass.data.api.NumassAnalyzer.CHANNEL_KEY
|
||||
import static inr.numass.data.api.NumassAnalyzer.COUNT_RATE_KEY
|
||||
|
||||
Context ctx = Global.instance()
|
||||
ctx.pluginManager().load(FXPlotManager)
|
||||
ctx.pluginManager().load(NumassPlugin.class)
|
||||
ctx.pluginManager().load(CachePlugin.class)
|
||||
ctx.pluginManager().load(PlotManager)
|
||||
ctx.pluginManager().load(NumassPlugin)
|
||||
ctx.pluginManager().load(CachePlugin)
|
||||
|
||||
Meta meta = buildMeta {
|
||||
data(dir: "D:\\Work\\Numass\\data\\2017_05\\Fill_2", mask: "set_.{1,3}")
|
||||
@ -63,7 +64,7 @@ shell.eval {
|
||||
|
||||
//Showing selected points
|
||||
def showPoints = { Map points, int binning = 20, int loChannel = 300, int upChannel = 2000 ->
|
||||
PlottableGroup<DataPlot> plotGroup = new PlottableGroup<>();
|
||||
def plotGroup = new PlotGroup("points");
|
||||
def adapter = new XYAdapter(CHANNEL_KEY, COUNT_RATE_KEY)
|
||||
points.each {
|
||||
plotGroup.add(
|
||||
@ -79,7 +80,7 @@ shell.eval {
|
||||
plotGroup.configure(showLine: true, showSymbol: false, showErrors: false, connectionType: "step")
|
||||
def frame = (plots as PlotHelper).getManager().getPlotFrame("Spectra")
|
||||
frame.configureValue("yAxis.type", "log")
|
||||
frame.addAll(plotGroup)
|
||||
frame.add(plotGroup)
|
||||
}
|
||||
|
||||
showPoints(spectraMap.findAll { it.key in [16200d, 16400d, 16800d, 17000d, 17200d, 17700d] })
|
||||
@ -104,9 +105,7 @@ shell.eval {
|
||||
}
|
||||
|
||||
Platform.runLater {
|
||||
(plots as PlotHelper).plot(correctionTable, name: "upper_${xHigh}", frame: "Correction") {
|
||||
adapter("x.value": "U", "y.value": "correction")
|
||||
}
|
||||
(plots as PlotHelper).plot(correctionTable, new XYAdapter("U", "correction"), "upper_${xHigh}", "Correction")
|
||||
}
|
||||
}
|
||||
}
|
@ -56,8 +56,10 @@ class UnderflowUtils {
|
||||
|
||||
DataNode<NumassPoint> data = dataBuilder.build()
|
||||
|
||||
def generate = GrindPipe.<NumassPoint, Table> build(name: "generate") {
|
||||
return analyzer.getSpectrum(delegate.input as NumassPoint, delegate.meta)
|
||||
def generate = GrindPipe.build("generate") {
|
||||
result { input ->
|
||||
return analyzer.getSpectrum(input as NumassPoint, delegate.meta)
|
||||
}
|
||||
}
|
||||
|
||||
DataNode<Table> spectra = generate.run(shell.context, data, meta.getMeta("generate"));
|
||||
|
Loading…
Reference in New Issue
Block a user