[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

@ -72,7 +72,7 @@ public class PlotFitResultAction extends OneToOneAction<FitState, FitState> {
XYPlotFrame frame = (XYPlotFrame) PlotsPlugin
.buildFrom(getContext()).buildPlotFrame(getName(), input.getName(),
metaData.getNode("plot", null));
metaData.getNode("plot", null));
//JFreeChartFrame.drawFrame(reader.getString("plotTitle", "Fit result plot for "+input.getName()), null);
double[] x = new double[data.size()];
@ -100,7 +100,7 @@ public class PlotFitResultAction extends OneToOneAction<FitState, FitState> {
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;
}

View File

@ -21,6 +21,7 @@ import hep.dataforge.context.Context;
import hep.dataforge.data.DataSet;
import hep.dataforge.data.ListDataSet;
import hep.dataforge.data.MapDataPoint;
import hep.dataforge.data.XYDataAdapter;
import hep.dataforge.datafitter.FitState;
import hep.dataforge.datafitter.FitTaskResult;
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)
);
// 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();
}

View File

@ -32,7 +32,7 @@ public class TransmissionInterpolatorTest {
//JFreeChartFrame.drawFrame("TransmissionInterpolatorTest", null);
TransmissionInterpolator interpolator = TransmissionInterpolator.fromFile(GlobalContext.instance(),
"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));
// 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.context.GlobalContext;
import hep.dataforge.data.FileData;
import hep.dataforge.data.XYDataAdapter;
import hep.dataforge.plots.fx.FXPlotUtils;
import inr.numass.prop.ar.JNAEpisode;
import inr.numass.prop.ar.JNASpectrum;
import inr.numass.prop.ar.ReadJNADataAction;
import hep.dataforge.plots.PlotFrame;
import hep.dataforge.plots.data.PlottableData;
import hep.dataforge.plots.jfreechart.JFreeChartFrame;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Map;
@ -60,7 +60,7 @@ public class TestReader {
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");

View File

@ -318,4 +318,9 @@ public class NumassDataLoader extends AbstractLoader implements BinaryLoader<Env
public String getDescription() {
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.ListDataSet;
import hep.dataforge.data.MapDataPoint;
import hep.dataforge.data.XYDataAdapter;
import hep.dataforge.io.ColumnedDataWriter;
import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder;
@ -44,7 +45,6 @@ import java.util.List;
import java.util.ResourceBundle;
import java.util.concurrent.ExecutionException;
import java.util.function.Predicate;
import java.util.logging.Level;
import java.util.stream.Collectors;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
@ -358,7 +358,8 @@ public class NumassLoaderViewComponent extends AnchorPane implements Initializab
for (NMPoint point : points) {
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);
}
return plottables;