subroutine atthkgen * get ODF * get start and end times of complete observation * open output fits file * loop through time (timestep) set attitudeFromAhf to true + call OAL_getAttitude (get AHF attitude) set AHF info to OAL_getAttitude info (or to NULL if bad) calculate summed attitude information for AHF set attitudeFromAhf to false + call OAL_getAttitude (get OM attitude) set OM info to OAL_getAttitude info (or to NULL if bad) calculate summed attitude information for AHF OM calculate AHF-Om difference * end loop through time * get median infomation at correct point in loop (AHF/OM values) * calculate mean attitude information (AHF/OM) * loop through time (timestep) calculate differences (AHF-PNT, OM-PNT) * end loop through time * get median infomation at correct point in loop (Diff PNT values) * calculate mean attitude information (Diff PNT) * fill fits file columns (AHF, OM) * fill in differences columns * add keywords, means, medians and history to fits file end subroutine atthkgen