Automated focusing and astigmatism correction in electron microscopy door