Real-time earthquake warning for astronomical observatories