[no commit message]

This commit is contained in:
Alexander Nozik 2016-01-07 18:33:15 +03:00
parent 71928a8894
commit 32cfbff1e2
7 changed files with 15 additions and 8 deletions

View File

@ -100,7 +100,7 @@ public class PlotFitResultAction extends OneToOneAction<FitState, FitState> {
frame.add(new PlottableFunction("fit", null, function, points, "x")); frame.add(new PlottableFunction("fit", null, function, points, "x"));
frame.add(new PlottableData("data", null, points)); frame.add(PlottableData.plot("data", adapter, points));
return input; return input;
} }

View File

@ -21,6 +21,7 @@ import hep.dataforge.context.Context;
import hep.dataforge.data.DataSet; import hep.dataforge.data.DataSet;
import hep.dataforge.data.ListDataSet; import hep.dataforge.data.ListDataSet;
import hep.dataforge.data.MapDataPoint; import hep.dataforge.data.MapDataPoint;
import hep.dataforge.data.XYDataAdapter;
import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitState;
import hep.dataforge.datafitter.FitTaskResult; import hep.dataforge.datafitter.FitTaskResult;
import hep.dataforge.datafitter.Param; import hep.dataforge.datafitter.Param;
@ -232,7 +233,7 @@ public class ShowLossSpectrumAction extends OneToOneAction<FitState, FitState> {
new MetaBuilder("plot").setValue("plotTitle", "Ion ratio Distribution for " + name) new MetaBuilder("plot").setValue("plotTitle", "Ion ratio Distribution for " + name)
); );
// XYPlotFrame frame = JFreeChartFrame.drawFrame("Ion ratio Distribution for " + name, null); // XYPlotFrame frame = JFreeChartFrame.drawFrame("Ion ratio Distribution for " + name, null);
frame.add(new PlottableData(hist, "binCenter", "count")); frame.add(PlottableData.plot(hist, new XYDataAdapter("binCenter", "count")));
return new DescriptiveStatistics(res).getStandardDeviation(); return new DescriptiveStatistics(res).getStandardDeviation();
} }

View File

@ -32,7 +32,7 @@ public class TransmissionInterpolatorTest {
//JFreeChartFrame.drawFrame("TransmissionInterpolatorTest", null); //JFreeChartFrame.drawFrame("TransmissionInterpolatorTest", null);
TransmissionInterpolator interpolator = TransmissionInterpolator.fromFile(GlobalContext.instance(), TransmissionInterpolator interpolator = TransmissionInterpolator.fromFile(GlobalContext.instance(),
"d:\\sterile-new\\loss2014-11\\.dataforge\\merge\\empty_sum.out", "Uset", "CR", 15, 0.8, 19002d); "d:\\sterile-new\\loss2014-11\\.dataforge\\merge\\empty_sum.out", "Uset", "CR", 15, 0.8, 19002d);
frame.add(new PlottableData("data", interpolator.getX(), interpolator.getY())); frame.add(PlottableData.plot("data", interpolator.getX(), interpolator.getY()));
frame.add(new PlottableFunction("interpolated", null, interpolator, interpolator.getXmin(), interpolator.getXmax(), 2000)); frame.add(new PlottableFunction("interpolated", null, interpolator, interpolator.getXmin(), interpolator.getXmax(), 2000));
// PrintFunction.printFuntionSimple(new PrintWriter(System.out), interpolator, interpolator.getXmin(), interpolator.getXmax(), 500); // PrintFunction.printFuntionSimple(new PrintWriter(System.out), interpolator, interpolator.getXmin(), interpolator.getXmax(), 500);

View File

@ -19,13 +19,13 @@ import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder; import hep.dataforge.meta.MetaBuilder;
import hep.dataforge.context.GlobalContext; import hep.dataforge.context.GlobalContext;
import hep.dataforge.data.FileData; import hep.dataforge.data.FileData;
import hep.dataforge.data.XYDataAdapter;
import hep.dataforge.plots.fx.FXPlotUtils; import hep.dataforge.plots.fx.FXPlotUtils;
import inr.numass.prop.ar.JNAEpisode; import inr.numass.prop.ar.JNAEpisode;
import inr.numass.prop.ar.JNASpectrum; import inr.numass.prop.ar.JNASpectrum;
import inr.numass.prop.ar.ReadJNADataAction; import inr.numass.prop.ar.ReadJNADataAction;
import hep.dataforge.plots.PlotFrame; import hep.dataforge.plots.PlotFrame;
import hep.dataforge.plots.data.PlottableData; import hep.dataforge.plots.data.PlottableData;
import hep.dataforge.plots.jfreechart.JFreeChartFrame;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.util.Map; import java.util.Map;
@ -60,7 +60,7 @@ public class TestReader {
PlotFrame frame = FXPlotUtils.displayJFreeChart("JNA test", null); PlotFrame frame = FXPlotUtils.displayJFreeChart("JNA test", null);
frame.add(new PlottableData(sp.asDataSet(), "chanel", "count")); frame.add(PlottableData.plot(sp.asDataSet(), new XYDataAdapter("chanel", "count")));
Meta temps = sp.meta().getNode("temperature"); Meta temps = sp.meta().getNode("temperature");

View File

@ -318,4 +318,9 @@ public class NumassDataLoader extends AbstractLoader implements BinaryLoader<Env
public String getDescription() { public String getDescription() {
return meta().getString("description", "").replace("\\n", "\n"); return meta().getString("description", "").replace("\\n", "\n");
} }
@Override
public void open() throws Exception {
}
} }

View File

@ -24,6 +24,7 @@ import hep.dataforge.data.DataPoint;
import hep.dataforge.data.DataSet; import hep.dataforge.data.DataSet;
import hep.dataforge.data.ListDataSet; import hep.dataforge.data.ListDataSet;
import hep.dataforge.data.MapDataPoint; import hep.dataforge.data.MapDataPoint;
import hep.dataforge.data.XYDataAdapter;
import hep.dataforge.io.ColumnedDataWriter; import hep.dataforge.io.ColumnedDataWriter;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder; import hep.dataforge.meta.MetaBuilder;
@ -44,7 +45,6 @@ import java.util.List;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.logging.Level;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.beans.property.BooleanProperty; import javafx.beans.property.BooleanProperty;
@ -358,7 +358,8 @@ public class NumassLoaderViewComponent extends AnchorPane implements Initializab
for (NMPoint point : points) { for (NMPoint point : points) {
String seriesName = String.format("%d: %.2f (%.2f)", points.indexOf(point), point.getUset(), point.getUread()); String seriesName = String.format("%d: %.2f (%.2f)", points.indexOf(point), point.getUset(), point.getUread());
PlottableData datum = new PlottableData(seriesName, plottableConfig, point.getData(binning, normalize), "chanel", "count"); PlottableData datum = PlottableData.plot(seriesName,new XYDataAdapter("chanel", "count"), point.getData(binning, normalize));
datum.configure(plottableConfig);
plottables.add(datum); plottables.add(datum);
} }
return plottables; return plottables;