  We show that the Atiyah-Patodi-Singer $\eta$-invariant can be related to the
temperature dependent Witten index of a noncompact theory and give a new proof
of the APS theorem using scattering theory. We relate the $\eta$-invariant to a
Callias index and compute it using localization of a supersymmetric path
integral. We show that the $\eta$-invariant for the elliptic genus of a finite
cigar is related to quantum modular forms obtained from the completion of a
mock Jacobi form which we compute from the noncompact path integral.
