Exemplo n.º 1
0
  private void publishResult() throws IOException {
    try {
      outPlot =
          (Plot)
              PlotFactory.createPlot(
                  yType.name() + "_vs_" + xType.name(), DataDimensionType.pattern);

      PlotFactory.addDataToPlot(
          outPlot,
          "data",
          resultEData.getData(),
          yAxisName + " vs " + xAxisName,
          "",
          resultEData.getVariance());

      PlotFactory.addAxisToPlot(outPlot, xType.name(), xAxis, xAxisName, "", 0);

      IDataItem notes = inPlot.findDataItem(DataLib.KEY_NOTES);
      if (null != notes) {
        outPlot.addDataItem(notes);
      }

    } catch (PlotFactoryException e) {
      throw new IOException("Cannot create new Plot for result");
    }
  }
Exemplo n.º 2
0
 private void formatYAxis() throws IOException {
   try {
     yType = YAxisType.getInstance(yAxisName);
     switch (yType) {
       case I:
         resultEData = inputEdata;
         break;
       case LogI:
         resultEData = EMath.toLog10(inputEdata.getData(), inputEdata.getVariance());
         break;
       case LnI:
         resultEData = EMath.toLn(inputEdata.getData(), inputEdata.getVariance());
         break;
       case IPowA:
         resultEData = EMath.toPower(inputEdata.getData(), par_a, inputEdata.getVariance());
         break;
       case IXPowB:
         resultEData =
             EMath.toEltMultiply(
                 inputEdata.getData(),
                 xAxis.getArrayMath().toPower(par_b).getArray(),
                 inputEdata.getVariance(),
                 null);
         break;
       case IPowAXPowB:
         resultEData = EMath.toPower(inputEdata.getData(), par_a, inputEdata.getVariance());
         resultEData =
             EMath.toEltMultiply(
                 resultEData.getData(),
                 xAxis.getArrayMath().toPower(par_b).getArray(),
                 resultEData.getVariance(),
                 null);
         break;
       case IReverse:
         resultEData = EMath.toEltInverseSkipZero(inputEdata.getData(), inputEdata.getVariance());
         break;
       case LnIx:
         resultEData =
             EMath.toEltMultiply(inputEdata.getData(), xAxis, inputEdata.getVariance(), null);
         resultEData = EMath.ln(resultEData.getData(), resultEData.getVariance());
         break;
       case LnIx2:
         resultEData =
             EMath.toEltMultiply(
                 inputEdata.getData(),
                 xAxis.getArrayMath().power(2).getArray(),
                 inputEdata.getVariance(),
                 null);
         resultEData = EMath.toLn(resultEData.getData(), resultEData.getVariance());
         break;
       case SqrtIReverse:
         resultEData = EMath.toSqrt(inputEdata.getData(), inputEdata.getVariance());
         resultEData = EMath.eltInverseSkipZero(resultEData.getData(), resultEData.getVariance());
         break;
       default:
         resultEData = inputEdata;
         break;
     }
   } catch (ShapeNotMatchException e) {
     throw new IOException("Unable to format Y-Axis data to shape");
   }
 }