4. Given that the point $(a, b)$ moves on the curve $\arcsin x=\arccos y$, and the ellipse $a x^{2}+b y^{2}=1$ is outside the circle $x^{2}+y^{2}=\frac{2}{\sqrt{3}}$ (including the case where they are tangent). Then, the range of $\theta=\arccos a$ is ( ).
A. $\frac{\pi}{6} \leqslant \theta \leqslant \frac{\pi}{4}$
B. $\frac{\pi}{6} \leqslant \theta<\frac{\pi}{2}$
C. $\frac{\pi}{6} \leqslant \theta \leqslant \frac{\pi}{3}$
D. $\frac{\pi}{4} \leqslant \theta \leqslant \frac{\pi}{3}$
4. C
$$
\arcsin x=\arccos y, \arcsin x \in\left[0, \frac{\pi}{2}\right] \quad 0 \leqslant x \leqslant 1,0 \leqslant y \leqslant 1 .
$$

From the original equation, we get $x=\sqrt{1-y^{2}}(0 \leqslant y \leqslant 1)$,
The semi-major and semi-minor axes of the ellipse $\frac{x^{2}}{\frac{1}{a}}+\frac{y^{2}}{\frac{1}{b}}=1$ are $\frac{1}{\sqrt{a}}$ and $\frac{1}{\sqrt{b}}$ respectively. According to the conditions, we should have $\frac{1}{\sqrt{a}} \geq \sqrt{\frac{2}{\sqrt{3}}}$, $\frac{1}{\sqrt{b}} \geqslant \sqrt{\frac{2}{\sqrt{3}}}$, and $a=\sqrt{1-b^{2}}(0 \leqslant b \leqslant 1)$.
Solving these, we get $\frac{1}{2} \leqslant a \leqslant \frac{\sqrt{3}}{2}, \frac{1}{2} \leqslant b \leqslant \frac{\sqrt{3}}{2}$.
Therefore, $\frac{\pi}{6} \leqslant \arccos a \leqslant \frac{\pi}{3}$.