Beispiel #1
0
  /**
   * use the online model to predict the target position given the positions measured at the bpms
   */
  protected TargetAnalysisResultRecord predictWithMatcher(
      final List<BPM> bpms, final ViewScreenMeasurement measurement) throws Exception {
    final Trajectory<TransferMapState> trajectory = measurement.getTrajectory(SEQUENCE);
    final double measuredBeamPosition = PLANE_ADAPTOR.getViewScreenBeamPosition(measurement);
    final PVLoggerSnapshot snapshot = measurement.getSnapshot();
    final int bpmCount = bpms.size();
    final double[] beamPositions = new double[bpmCount];
    for (int index = 0; index < bpmCount; index++) {
      final BPM bpm = bpms.get(index);
      beamPositions[index] = PLANE_ADAPTOR.getAverageBeamPosition(snapshot, bpm);
    }

    final OrbitMatcher orbitMatcher = new OrbitMatcher(TARGET, bpms, trajectory);

    final double prediction = PLANE_ADAPTOR.getMatchedBeamPosition(orbitMatcher, beamPositions);

    return new TargetAnalysisResultRecord(measuredBeamPosition, prediction);
  }
Beispiel #2
0
 public double getViewScreenBeamPosition(final ViewScreenMeasurement measurement) {
   return measurement.getBeamPositionY();
 }