Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and plaplant committed Aug 8, 2022
1 parent ad5ed94 commit 7036c3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bda/decorr_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_decorr_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 7036c3f

Please sign in to comment.