diff --git a/act/qc/bsrn_tests.py b/act/qc/bsrn_tests.py index c2871acea8..d8ff0de574 100644 --- a/act/qc/bsrn_tests.py +++ b/act/qc/bsrn_tests.py @@ -821,7 +821,7 @@ def bsrn_comparison_tests( test_meaning=test_meaning, ) - def k_test( + def normalized_rradiance_test( self, test, dni=None, @@ -878,7 +878,7 @@ def k_test( .. code-block:: python ds = act.io.arm.read_arm_netcdf(act.tests.EXAMPLE_BRS, cleanup_qc=True) - ds.qcfilter.k_test( + ds.qcfilter.normalized_rradiance_test( ['Clearness index', 'Upper total transmittance', 'Upper direct transmittance', 'Upper diffuse transmittance'], dhi='down_short_diffuse_hemisp', @@ -905,11 +905,11 @@ def k_test( if test_options[0].lower() in test: if dni is None: raise RuntimeError( - "Need to set 'dni' keyword to perform 'Clearness index' test in k_test()." + "Need to set 'dni' keyword to perform 'Clearness index' test in normalized_rradiance_test()." ) if dhi is None: raise RuntimeError( - "Need to set 'dhi' keyword to perform 'Clearness index' test in k_test()." + "Need to set 'dhi' keyword to perform 'Clearness index' test in normalized_rradiance_test()." ) if use_dask and isinstance(self._ds[dni].data, da.Array): @@ -943,11 +943,11 @@ def k_test( if test_options[1].lower() in test: if dni is None: raise RuntimeError( - "Need to set 'dni' keyword to perform 'Upper total transmittance' test in k_test()." + "Need to set 'dni' keyword to perform 'Upper total transmittance' test in normalized_rradiance_test()." ) if dhi is None: raise RuntimeError( - "Need to set 'dhi' keyword to perform 'Upper total transmittance' test in k_test()." + "Need to set 'dhi' keyword to perform 'Upper total transmittance' test in normalized_rradiance_test()." ) if use_dask and isinstance(self._ds[dni].data, da.Array): @@ -982,11 +982,11 @@ def k_test( if test_options[2].lower() in test: if dni is None: raise RuntimeError( - "Need to set 'dni' keyword to perform 'Upper direct transmittance' test in k_test()." + "Need to set 'dni' keyword to perform 'Upper direct transmittance' test in normalized_rradiance_test()." ) if ghi is None: raise RuntimeError( - "Need to set 'ghi' keyword to perform 'Upper direct transmittance' test in k_test()." + "Need to set 'ghi' keyword to perform 'Upper direct transmittance' test in normalized_rradiance_test()." ) if use_dask and isinstance(self._ds[dni].data, da.Array): @@ -1019,7 +1019,7 @@ def k_test( if test_options[3].lower() in test: if dhi is None: raise RuntimeError( - "Need to set 'dhi' keyword to perform 'Upper diffuse transmittance' test in k_test()." + "Need to set 'dhi' keyword to perform 'Upper diffuse transmittance' test in normalized_rradiance_test()." ) if use_dask and isinstance(self._ds[dhi].data, da.Array): diff --git a/examples/qc/plot_qc_bsrn.py b/examples/qc/plot_qc_bsrn.py index 419754c9d6..6ec1afe15d 100644 --- a/examples/qc/plot_qc_bsrn.py +++ b/examples/qc/plot_qc_bsrn.py @@ -65,7 +65,7 @@ ) # Add K-tests QC to ancillary QC variables. -ds.qcfilter.k_test( +ds.qcfilter.normalized_rradiance_test( [ 'Clearness index', 'Upper total transmittance', diff --git a/tests/qc/test_bsrn_tests.py b/tests/qc/test_bsrn_tests.py index ccac0a9998..81e0c4b430 100644 --- a/tests/qc/test_bsrn_tests.py +++ b/tests/qc/test_bsrn_tests.py @@ -305,7 +305,7 @@ def test_bsrn_limits_test(): assert np.sum(result) == 38 -def test_k_test(): +def test_normalized_rradiance_test(): keep_vars = [ 'short_direct_normal', 'down_short_diffuse_hemisp', @@ -323,14 +323,14 @@ def test_k_test(): ] for test in tests: with pytest.raises(RuntimeError): - ds.qcfilter.k_test(test) + ds.qcfilter.normalized_rradiance_test(test) for use_dask in [False, True]: ds = read_arm_netcdf(EXAMPLE_BRS, keep_variables=keep_vars) data = ds['short_direct_normal'].values data[1050:1100] = data[1050:1100] + 400 ds['short_direct_normal'].values = data - ds.qcfilter.k_test( + ds.qcfilter.normalized_rradiance_test( tests, dni='short_direct_normal', dhi='down_short_diffuse_hemisp',