Simultaneous seismic wave clustering and registration