Pressure-induced absorption I: The calculation of pressure-induced absorption in pure hydrogen and deuterium