- qspec. inverse_doppler ( f_atom , f_lab , alpha , mode='raise-raise' , return_mask=False )[source]
-
The velocity required to Doppler-shift the frequency $f_\mathrm{lab}$ to $f_\mathrm{atom}$
$$\begin{aligned} v &= \frac{c}{s}\left[\cos(\alpha) \pm \frac{f_\mathrm{atom}}{f_\mathrm{lab}}\sqrt{s - 1}\right]\\[2ex] s &= \left(\frac{f_\mathrm{atom}}{f_\mathrm{lab}}\right)^2 + \cos(\alpha)^2. \end{aligned}$$For angles $-\pi/2 < \alpha < \pi/2$, there can be two solutions. Depending on the combination of
f_atom,f_labandalpha, the situation may be physically impossible. Specifymodeto choose the desired behavior.- Parameters:
-
- f_atomarray_like
The frequency of light $f_\mathrm{atom}$ in the atom's rest frame (arb. units).
- f_labarray_like
The frequency of light $f_\mathrm{lab}$ in the laboratory frame (unit of
f_atom).- alphaarray_like
The angle $\alpha$ between the velocity- and the light-vector in the laboratory frame (rad).
- modestr
How to handle
nanvalues and ambiguous velocities. Available options are:"raise-raise": Raise an error if there arenanvalues or if the velocity is ambiguous."raise-small": Raise an error if there arenanvalues and return the smaller velocity."raise-large": Raise an error if there arenanvalues and return the larger velocity."isnan-raise": Ignorenanvalues and raise an error if the velocity is ambiguous."isnan-small": Ignorenanvalues and return the smaller velocity."isnan-large": Ignorenanvalues and return the larger velocity.
- return_maskbool
Whether the mask where the velocity is ambiguous is returned as a second argument.
- Returns:
- Raises:
-
- ValueError
If
modeis not one of the options above, or ifnanvalues or ambiguous velocities occur andmoderequires to raise an error.