It's annoying for me to share the spreadsheet, but I'm basically implementing the math in:
https://lhc-div-mms.web.cern.ch/tests/MAG/FiDeL/Documentatio...
To do with calculating multipole coefficients from measured data and then doing coordinate transformations on them.