How to save and load matrices easily
In /cvs/cds/caltech/scripts/matrix/ there are 4 python scripts:
- saveMatrix.py, oldSaveMatrix.py, loadMatrix.py, oldLoadMatrix.py
The saveMatrix.py and loadMatrix.py are for use with the current front end codes (which start counting from 1), where as the old*.py files are for the old system (which start counting from 0).
Save
To use saveMatrix.py you need to specify the following elements;
- -i the number of inputs
- -o the number of outputs
- -n the base name of the matrix (e.g. C1:LSP-DOF2PD_MTRX is the base of C1:LSP-DOF2PD_MTRX_0_0_GAIN)
- -d an ouptut file where the values are stored
For example, to save the BS in_matrix setting you could do (from /cvs/cds/caltech/scripts/matrix/):
./saveMatrix.py -i 4 -o 5 -n "C1:SUS-BS_TO_COIL_MTRX" -f -d ./to_coil_mtrx.txt
he -i 4 indicates 4 inputs, the -o 5 indicates 5 outputs, -n "blah blah" indicates the base channel name, -f indicates a matrix bank of filters (if its just a normal matrix with no filters, drop the -f flag), and -d ./to_coil_mtrx.txt indicates the destination file.
Load
To write the matrix, you do virtually the same thing:
./loadMatrix.py -n "C1:SUS-PRM_TO_COIL_MTRX" -f -d ./to_coil_mtrx.txt
In this case, you're writing the saved values of the BS, to the PRM.
This method might be faster if you're trying to fill in a bunch of new matrices that are identical rather than typing 1's and -1's 20 times for each matrix.
