From 7036c3fe04aa3d2ffb1d45403b8fe5ffbb9a6c50 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 20:34:51 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- bda/decorr_calc.py | 8 ++++---- tests/test_decorr_calc.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bda/decorr_calc.py b/bda/decorr_calc.py index 15e2646..9e7a47d 100644 --- a/bda/decorr_calc.py +++ b/bda/decorr_calc.py @@ -212,11 +212,11 @@ def decorr_post_fs_int_time( rfac = max(rfac, (dv * mval) ** 2) # make sure we have the right units - rfac = rfac.to(units.rad ** 2 / units.s ** 2) + rfac = rfac.to(units.rad**2 / units.s**2) # add other factors; return decorrelation fraction and max rfac value decorr_frac = ( - np.pi ** 2 * (post_fs_int_time.to(units.s).value) ** 2 / 6.0 * rfac.value + np.pi**2 * (post_fs_int_time.to(units.s).value) ** 2 / 6.0 * rfac.value ) return decorr_frac, rfac.value @@ -285,7 +285,7 @@ def bda_compression_factor( can be averaged, etc. """ # calculate the pre-BDA decorrelation given the correlator settings - baseline = np.sqrt(lx ** 2 + ly ** 2) + baseline = np.sqrt(lx**2 + ly**2) decorr_cw = decorr_chan_width(chan_width, baseline, corr_fov_angle) decorr_pre_int = decorr_pre_fs_int_time(frequency, baseline, pre_fs_int_time) @@ -303,7 +303,7 @@ def bda_compression_factor( # Figure out the maximum amount of decorrelation allowed for post-fringe # stop integration. post_fs_decorr = 1 - (1 - max_decorr) / (1 - pre_fs_decorr) - int_time = np.sqrt(6 * post_fs_decorr / (np.pi ** 2 * max_rfac)) + int_time = np.sqrt(6 * post_fs_decorr / (np.pi**2 * max_rfac)) # compute the number of samples that can be averaged using a power-of-two scheme num_two_foldings = int( diff --git a/tests/test_decorr_calc.py b/tests/test_decorr_calc.py index eb29116..b9da1e2 100644 --- a/tests/test_decorr_calc.py +++ b/tests/test_decorr_calc.py @@ -105,11 +105,11 @@ def test_decorr_post_fs_int_time(): earth_rot_speed = (Angle(360, units.deg) / units.sday).to(units.arcminute / units.s) du = dc._dudt(lx, ly, -corr_fov, earth_rot_speed, wavelength) lval = np.cos(90.0 * units.deg - corr_fov) - rfac_ref = ((du * lval) ** 2).to(units.rad ** 2 / units.s ** 2).value + rfac_ref = ((du * lval) ** 2).to(units.rad**2 / units.s**2).value assert np.isclose(rfac, rfac_ref) decorr_frac_ref = ( - np.pi ** 2 * (post_fs_int_time.to(units.s).value) ** 2 / 6.0 * rfac_ref + np.pi**2 * (post_fs_int_time.to(units.s).value) ** 2 / 6.0 * rfac_ref ) assert np.isclose(decorr_frac_ref, decorr_frac)