Using the following script,
${CALSVN}/trunk/Runs/O3/Scripts/CALCS_FE/CALCSvsDARMmodel.py
I've made a first direct comparison of the installed CAL-CS model with the new pyDARM model. This was not that easy to do because some standard scipy functions to make ZPK filters from sos coefficients have some very restrictive tolerances that don't make a lot of sense to me. I've kludged my way around this by adding some of the same functions scipy uses for the ZPK filters without such tight tolerances.
Attached are three figures showing the comparisons:
1) Full sensing function and actuation functions. This reveals the limitations of the CAL-CS model, especially at high frequencies. There are issues in magnitude below 10 Hz--probably an issue of large dynamic range of the suspension model--but not very important because it is below 10 Hz. In addition there look to be issues around 300 Hz (missing filter?). Needing further investigation is the phase: it is unclear what is going wrong with phase offsets at low frequency in sensing. Again, further investigation needed
2) Individual stages are compared between CAL-CS and pyDARM. The L1 stage is the cause of low frequency (<10 Hz) discrepancy, and L3 stage for the 300 Hz discrepancy. The effective time delay in L1, L2, and L3, does not seem consistent--also worth investigating.
3) Given the current model, we can find a relative time delay between sensing and actuation in units of 61 usec clock cycles. The orange dot marks the point closest to the UGF.
As mentioned, there is further investigation needed to make sure we fully understand the differences between stages in the CAL-CS vs pyDARM model.