From 8a38e54088996e01c5b49c61fae11a23605c6277 Mon Sep 17 00:00:00 2001 From: Takaya Uchida Date: Mon, 13 Jun 2022 11:18:00 +0200 Subject: [PATCH] Update cross_phase too --- xrft/xrft.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xrft/xrft.py b/xrft/xrft.py index 3b5d4455..30d738e8 100644 --- a/xrft/xrft.py +++ b/xrft/xrft.py @@ -871,7 +871,7 @@ def cross_spectrum( return cs -def cross_phase(da1, da2, dim=None, true_phase=False, **kwargs): +def cross_phase(da1, da2, dim=None, true_phase=True, **kwargs): """ Calculates the cross-phase between da1 and da2. @@ -888,15 +888,15 @@ def cross_phase(da1, da2, dim=None, true_phase=False, **kwargs): The data to be transformed da2 : `xarray.DataArray` The data to be transformed + dim : str or sequence of str, optional + The dimensions along which to take the transformation. If `None`, all + dimensions will be transformed. + true_phase : boolean + If True, the phase information is retained. + Set explicitly true_phase = False in cross_spectrum arguments list to ensure future compatibility + with numpy-like behavior where the coordinates are disregarded. kwargs : dict : see xrft.fft for argument list """ - if not true_phase: - msg = ( - "true_phase flag will be set to True in future version of xrft.fft possibly impacting cross_phase output. " - + "Set explicitely true_phase = False in cross_spectrum arguments list to ensure future compatibility " - + "with numpy-like behavior where the coordinates are disregarded." - ) - warnings.warn(msg, UserWarning) cp = xr.ufuncs.angle( cross_spectrum(da1, da2, dim=dim, true_phase=true_phase, **kwargs)