Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkehoe committed Nov 3, 2023
1 parent 33c0f5f commit 1645c84
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions act/qc/bsrn_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ def bsrn_comparison_tests(
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=RuntimeWarning)
if use_dask and isinstance(self._ds[glb_diffuse_SW_dn_name].data, da.Array):
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].data +
self._ds[direct_normal_SW_dn_name].data * np.cos(np.radians(sza)))
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].data
+ self._ds[direct_normal_SW_dn_name].data * np.cos(np.radians(sza)))
sum_sw_down[sum_sw_down < 50] = np.nan
ratio = self._ds[gbl_SW_dn_name].data / sum_sw_down
index_a = sza < 75
Expand All @@ -445,8 +445,8 @@ def bsrn_comparison_tests(
index_4 = da.where((ratio < 0.85) & index_b, True, False)
index = (index_1 | index_2 | index_3 | index_4).compute()
else:
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].values +
self._ds[direct_normal_SW_dn_name].values * np.cos(np.radians(sza)))
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].values
+ self._ds[direct_normal_SW_dn_name].values * np.cos(np.radians(sza)))
sum_sw_down[sum_sw_down < 50] = np.nan
ratio = self._ds[gbl_SW_dn_name].values / sum_sw_down
index_a = sza < 75
Expand Down Expand Up @@ -505,14 +505,14 @@ def bsrn_comparison_tests(
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=RuntimeWarning)
if use_dask and isinstance(self._ds[glb_diffuse_SW_dn_name].data, da.Array):
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].data +
self._ds[direct_normal_SW_dn_name].data * np.cos(np.radians(sza)))
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].data
+ self._ds[direct_normal_SW_dn_name].data * np.cos(np.radians(sza)))

sum_sw_down[sum_sw_down < 50] = np.nan
index = da.where(self._ds[glb_SW_up_name].data > sum_sw_down, True, False).compute()
else:
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].values +
self._ds[direct_normal_SW_dn_name].values * np.cos(np.radians(sza)))
sum_sw_down = (self._ds[glb_diffuse_SW_dn_name].values
+ self._ds[direct_normal_SW_dn_name].values * np.cos(np.radians(sza)))
sum_sw_down[sum_sw_down < 50] = np.nan
index = self._ds[glb_SW_up_name].values > sum_sw_down

Expand Down Expand Up @@ -577,10 +577,10 @@ def bsrn_comparison_tests(
f'for {test_options[3]} test.')

if use_dask and isinstance(self._ds[glb_LW_dn_name].data, da.Array):
index_1 = da.where(self._ds[glb_LW_dn_name].data >
(self._ds[glb_LW_up_name].data + LWdn_lt_LWup_component), True, False)
index_2 = da.where(self._ds[glb_LW_dn_name].data <
(self._ds[glb_LW_up_name].data - LWdn_gt_LWup_component), True, False)
index_1 = da.where(self._ds[glb_LW_dn_name].data
> (self._ds[glb_LW_up_name].data + LWdn_lt_LWup_component), True, False)
index_2 = da.where(self._ds[glb_LW_dn_name].data
< (self._ds[glb_LW_up_name].data - LWdn_gt_LWup_component), True, False)
index = (index_1 | index_2).compute()
else:
index_1 = self._ds[glb_LW_dn_name].values > (self._ds[glb_LW_up_name].values + LWdn_lt_LWup_component)
Expand Down

0 comments on commit 1645c84

Please sign in to comment.