deerlab.correctphase¶
- correctphase(V, full_output=False, offset=False)[source]¶
Phase correction of complex-valued data.
Rotates the phase of complex-valued data
V
to minimize the imaginary component. Among the two phases that minimize the imaginary part, the one that gives a real part with a positive average is used. For two-dimensional datasetsV2D
, e.g. from measurements with multiple scans, each sliceV2D[:,i]
is phase-rotated independently. If theoffset
parameter isTrue
, the function will correct for a potential non-zero mean imaginary offset.- Parameters:
- Varray_like, or list of array_like
Complex-valued 1D or 2D signal.
- full_outputboolean, optional
If
True
, return additional output arguments. (default:False
)- offsetboolean
Enables numerical phase correction while accounting for a non-zero mean imaginary offset. By default disabled.
- Returns:
- Vrndarray
Real part of the phase-corrected data.
- Vindarray (only if
full_output==True
) Imaginary part of the phase-corrected data.
- phasefloat scalar or ndarray (only if
full_output==True
) Fitted phase, or list of phases for 2D data, used for correction, in radians.