Data-adaptive harmonic analysis and modeling of solar wind-magnetosphere coupling