Class ResponseMatrix
java.lang.Object
org.scictrl.mp.orbitcorrect.utilities.ResponseMatrix
Response matrix of closed orbit
- Author:
- igor@kriznar.com
-
Field Summary
-
Constructor Summary
ConstructorDescriptionResponseMatrix
(int rowCount, int columnCount) Creates RM with all arrays and matrix initialized to provided dimensions, but with no data.ResponseMatrix
(File file) Creates new instance of ResponseMatrix from the specified file.ResponseMatrix
(String[] bpms, String[] correctors) Creates new RM which has dimensions and device names initialized with provided parameters.ResponseMatrix
(ElementList<BPMonitor> bpms, ElementList<AbstractCorrector> correctors) Creates new RM which has dimensions and device names initialized with provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic final ResponseMatrix
fillWithCloseOrbitCalculation
(ResponseMatrix rm, DataBush dataBush, Orientation orientation) Fills the provided RM with closed-orbit calculated matrix data.boolean
isValid()
Returnstrue
if this RM contains valid RM data.static void
main.void
printToFile
(File file) Prints this ResponceMatrix to the specified file.void
printToFile
(String label, File file) Prints this ResponceMatrix to the specified file.void
printToStream
(PrintWriter print) Prints this ResponceMatrix to the specified file.Prints this ResponceMatrix to the specified file.submatrix.submatrix.toString()
Returns a String that represents the value of this object.
-
Field Details
-
correctors
Corrector magnet names in matrix. -
bpms
BPM names in matrix. -
matrix
public final double[][] matrixThe response matrix. -
valid
public boolean validIf values are valid. -
energy
public double energyEnergy of beam. -
time
public long timeTime 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 RMcolumnCount
- the number of Correctors in RM
-
ResponseMatrix
Creates new instance of ResponseMatrix from the specified file.- Parameters:
file
- aFile
object- Throws:
ParseException
- if any.IOException
- if any.
-
ResponseMatrix
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 RMcorrectors
- the Correctors defining the RM
-
ResponseMatrix
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 RMcorrectors
- 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 datadataBush
- the DataBush to provide calculationorientation
- the Orientation for which calculation should be done- Returns:
- a
ResponseMatrix
object - Throws:
IllegalStateException
- if any.
-
isValid
public boolean isValid()Returnstrue
if this RM contains valid RM data. By default new RM instance is created withfalse
.- Returns:
true
if this RM contains valid RM data
-
main
main.
- Parameters:
args
- java.lang.String[]
-
printToFile
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
- aFile
object- Throws:
IOException
- if any.
-
printToFile
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
- aString
objectfile
- aFile
object- Throws:
IOException
- if any.
-
printToStream
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
- aPrintWriter
object- Throws:
IOException
- if any.
-
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
submatrix.
- Parameters:
b
- an array ofString
objectsc
- an array ofString
objects- Returns:
- ResponseMatrix
- Throws:
IllegalArgumentException
- if any.
-
submatrix
submatrix.
- Parameters:
b
- an array ofString
objects- Returns:
- a
ResponseMatrix
object - Throws:
IllegalArgumentException
- if any.
-
toString
Returns a String that represents the value of this object.
-