qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. inverse_doppler_d1  (  f_atom ,  f_lab ,  alpha ,  mode='raise-raise' ,  return_mask=False  )[source]

The first derivative of the velocity inverse_doppler with respect to $f_\mathrm{atom}$

$$\begin{aligned} \frac{\partial v}{\partial f_\mathrm{atom}} &= \frac{c}{sf_\mathrm{lab}}\left[\pm\left(\sqrt{s - 1} + \frac{(f_\mathrm{atom}/f_\mathrm{lab})^2}{\sqrt{s - 1}}\right) - 2\frac{v}{c}\frac{f_\mathrm{atom}}{f_\mathrm{lab}}\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_lab and alpha, the situation may be physically impossible. Specify mode to 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 nan values and ambiguous velocities. Available options are:

  • "raise-raise": Raise an error if there are nan values or if the velocity is ambiguous.
  • "raise-small": Raise an error if there are nan values and return the smaller velocity.
  • "raise-large": Raise an error if there are nan values and return the larger velocity.
  • "isnan-raise": Ignore nan values and raise an error if the velocity is ambiguous.
  • "isnan-small": Ignore nan values and return the smaller velocity.
  • "isnan-large": Ignore nan values and return the larger velocity.
return_maskbool

Whether the mask where the velocity is ambiguous is returned as a second argument.

Returns:
(dv_df, mask)ndarray | tuple[ndarray, ndarray]

The first derivative $\partial v / \partial f_\mathrm{atom}$ of the velocity $v$ required to shift f_lab to f_atom (m/s per unit of f_atom) and, if return_mask is True, the mask where the velocity is ambiguous.

Raises:
ValueError

If mode is not one of the options above, or if nan values or ambiguous velocities occur and mode requires to raise an error.