I have adapted the code from "the baffle/dither align scripts" into new Guardian states in the ALS_XARM and ALS_YARM nodes called BAFFLE_ALIGN_TMS, BAFFLE_ALIGN_ITM, and BAFFLE_ALIGN_ETM.
Previously, the baffle alignment scripts for each arm were run via a button on the INIT_ALIGN.adl screen. All of the code used was spread across multiple functions in three separate files in the /userapps/asc/h1/scripts/ directory: ditherAlign.py, baffleAlign.py, and slowDemod.py. Since this process was just a user running a script, there was no logging of what was done, it wasn't clear when these scripts were run if someone wanted to trend back that information, and multiple users could mistakenly run these at the same time.
Now, there are states in the ALS_XARM and ALS_YARM Guardian nodes that will appropriately mis/align optics as necessary and run through the baffle alignment process for the desired suspension. To do this, I created a new file called baffle_align_params.py that lives in /userapps/als/h1/guardian/ which contains the parameters and functions called by the new baffle align states. Functionally these states work the same as the scripts did, but it's now more clear when these are running and we have a record of what happens in the process that can be looked back on. These states are all branched off of the UNLOCKED state so that an arm can't accidentally be locked while the baffle alignments are running, and they are protected states so that the process can't be interrupted partway through (except for switching the node's operating mode to "manual" and moving to another state, which would require manually reverting alignment changes and closing any open excitations).
I tested the functionality of the new states this morning and have appropriately committed everything to svn.