Class ResponseMatrix

java.lang.Object
org.scictrl.mp.orbitcorrect.utilities.ResponseMatrix

public final class ResponseMatrix extends Object
Response matrix of closed orbit
Author:
igor@kriznar.com
  • Field Details

    • correctors

      public final String[] correctors
      Corrector magnet names in matrix.
    • bpms

      public final String[] bpms
      BPM names in matrix.
    • matrix

      public final double[][] matrix
      The response matrix.
    • valid

      public boolean valid
      If values are valid.
    • energy

      public double energy
      Energy of beam.
    • time

      public long time
      Time duration of matrix calculation in ms.
  • Constructor Details

    • ResponseMatrix

      public ResponseMatrix(int rowCount, int columnCount)
      Creates RM with all arrays and matrix initialized to provided dimensions, but with no data.
      Parameters:
      rowCount - the number of BPMs in RM
      columnCount - the number of Correctors in RM
    • ResponseMatrix

      public ResponseMatrix(File file) throws ParseException, IOException
      Creates new instance of ResponseMatrix from the specified file.
      Parameters:
      file - a File object
      Throws:
      ParseException - if any.
      IOException - if any.
    • ResponseMatrix

      public ResponseMatrix(ElementList<BPMonitor> bpms, ElementList<AbstractCorrector> correctors)
      Creates new RM which has dimensions and device names initialized with provided parameters. The matrix itself is of right dimension but with 0.0 values.
      Parameters:
      bpms - the BPMs defining the RM
      correctors - the Correctors defining the RM
    • ResponseMatrix

      public ResponseMatrix(String[] bpms, String[] correctors)
      Creates new RM which has dimensions and device names initialized with provided parameters. The matrix itself is of right dimension but with 0.0 values.
      Parameters:
      bpms - the BPMs defining the RM
      correctors - the Correctors defining the RM
  • Method Details

    • fillWithCloseOrbitCalculation

      public static final ResponseMatrix fillWithCloseOrbitCalculation(ResponseMatrix rm, DataBush dataBush, Orientation orientation) throws IllegalStateException
      Fills the provided RM with closed-orbit calculated matrix data.
      Parameters:
      rm - the RM to be filled with data
      dataBush - the DataBush to provide calculation
      orientation - the Orientation for which calculation should be done
      Returns:
      a ResponseMatrix object
      Throws:
      IllegalStateException - if any.
    • isValid

      public boolean isValid()
      Returns true if this RM contains valid RM data. By default new RM instance is created with false.
      Returns:
      true if this RM contains valid RM data
    • main

      public static void main(String[] args)

      main.

      Parameters:
      args - java.lang.String[]
    • printToFile

      public void printToFile(File file) throws IOException
      Prints this ResponceMatrix to the specified file. Data is formated in table. In first row are names of correctors, in first column names of beam position monitors. Items in line are separated with tabulators.
      Parameters:
      file - a File object
      Throws:
      IOException - if any.
    • printToFile

      public void printToFile(String label, File file) throws IOException
      Prints this ResponceMatrix to the specified file. Data is formated in table. In first row are names of correctors, in first column names of beam position monitors. Items in line are separated with tabulators.
      Parameters:
      label - a String object
      file - a File object
      Throws:
      IOException - if any.
    • printToStream

      public void printToStream(PrintWriter print) throws IOException
      Prints this ResponceMatrix to the specified file. Data is formated in table. In first row are names of correctors, in first column names of beam position monitors. Items in line are separated with tabulators.
      Parameters:
      print - a PrintWriter object
      Throws:
      IOException - if any.
    • printToString

      public String printToString()
      Prints this ResponceMatrix to the specified file. Data is formated in table. In first row are names of correctors, in first column names of beam position monitors. Items in line are separated with tabulators.
      Returns:
      a String object
    • submatrix

      public ResponseMatrix submatrix(String[] b, String[] c) throws IllegalArgumentException

      submatrix.

      Parameters:
      b - an array of String objects
      c - an array of String objects
      Returns:
      ResponseMatrix
      Throws:
      IllegalArgumentException - if any.
    • submatrix

      public ResponseMatrix submatrix(String[] b) throws IllegalArgumentException

      submatrix.

      Parameters:
      b - an array of String objects
      Returns:
      a ResponseMatrix object
      Throws:
      IllegalArgumentException - if any.
    • toString

      public String toString()
      Returns a String that represents the value of this object.
      Overrides:
      toString in class Object