Up to now, the ALS COMM
and ALS DIFF
guardians have been using some hard-coded frequency offsets in order to do the IR finding. This works alright while the offsets are fresh, but after a few days (or less) they become stale and no longer correspond to IR resonance. So then we go find the resonances by hand, hard-code fresh frequency offsets into the guardians, and start the cycle over again.
After discussion with Lisa, we are now starting to have the guardians update the frequency offsets by themselves. This will hopefully reduce the amount of time spent looking by hand for IR resonance, and the amount of time spent going through the fine-tuning states in the guardians.
In userapps/als/common/guardian
, I’ve created alsDiffParams.dat
and alsCommParams.dat
. Each guardian reads from and writes to its parameter file using the json
library. This keeps the parameter file human-readable (unlike, e.g., pickle
).
When loaded into the guardian, the parameters are contained a python dictionary.
So, for example, the COMM guardian loads its dictionary from the file like so:
alsCommParamsPath = '/opt/rtcds/userapps/trunk/als/common/guardian/alsCommParams.dat'
with open(alsCommParamsPath, 'r') as alsCommParamFile:
alsCommParamDict = json.load(alsCommParamFile)
Once it’s done modifying alsCommParamDict
, it dumps the dictionary back into the file like so:
with open(alsCommParamsPath, 'w+') as alsCommParamFile:
json.dump(alsCommParamDict, alsCommParamFile)