# This page is under construction

# TMS Core Calculations and Algorithms

This page details the essential decisions made in the

TMS software when calculating a

TMS correction.

### John Hill's Notes on PSF Pointing Offset correction for TMS

Quick Note on including

PSF Mode3 Pointing Offset in

TMS Reference Offset.

In lbc_set_tms_offset.py
Reference = - measured_zero - poff_zero - inst_zero

poff_zero is what I added today

In lbc_tms.py
Correction = measured_now + poff_now + inst_now + pcorr_now - pcorr_zero + bending_now - bending_zero + Reference

which becomes:
Correction = measured(now-zero) + poff(now-zero) + inst(now-zero) + pcorr(now-zero) + bending(now-zero)

Where the vectors are:
"measured" is

TMS measured correction from Yang's code
"poff" is the

PSF-commanded mode3 Pointing Offset
"inst" is the

PSF-commanded Instrument Offset
"pcorr" is the elevation pointing correction to keep

TMS in range
"bending" is the

PSF-commanded piston associated with Z11/Z22 correction

Of course, you will ask why pcorr_zero and bending_zero are in the
Correction and not in the Reference? This is because we were developing
equations to put them into

XYZrXrY space, and it was easier to keep
all the equations in the same routine.

No

PSF LUT vectors are included in the corrections to Correction, although
the mode3 Pointing Offset are computed from the difference between
left and right pointing models.