Estimating primaries by sparse inversion and application to near-offset data reconstruction