docs: def get_lats_from_cartesian(x__, y__, z__, thr=0.8):
      """Get latitudes from cartesian coordinates.
      """
      # if we are at low latitudes - small z, then get the
      # latitudes only from z. If we are at high latitudes (close to the poles)
      # then derive the latitude using x and y:
  
      lats = np.where(np.logical_and(np.less(z__, thr * EARTH_RADIUS), 
                                     np.greater(z__, -1. * thr * EARTH_RADIUS)),
                      90 - rad2deg(arccos(z__/EARTH_RADIUS)),
                      sign(z__) *
                      (90 - rad2deg(arcsin(sqrt(x__ ** 2 + y__ ** 2)
                                           / EARTH_RADIUS))))
      return lats