Combined compression and analysis with application to astronomical point source extraction