Gravar-mail: Compensation of shear waves in photoacoustic tomography with layered acoustic media