diff --git a/rdtools/filtering.py b/rdtools/filtering.py index 2fd7c131..4678ff1d 100644 --- a/rdtools/filtering.py +++ b/rdtools/filtering.py @@ -131,9 +131,9 @@ def clearsky_filter(poa_global_measured, poa_global_clearsky, model='pvlib', **k pvlib_clearsky_filter : Filtering based on pvlib's clearsky model. """ - if model == "pvlib": + if model == "csi": clearsky_mask = csi_filter(poa_global_measured, poa_global_clearsky, **kwargs) - elif model == "csi": + elif model == "pvlib": clearsky_mask = pvlib_clearsky_filter(poa_global_measured, poa_global_clearsky, **kwargs) else: raise ValueError("Clearsky filter must be 'pvlib' or 'csi'.") diff --git a/rdtools/test/analysis_chains_test.py b/rdtools/test/analysis_chains_test.py index 3cc3efd7..cb635754 100644 --- a/rdtools/test/analysis_chains_test.py +++ b/rdtools/test/analysis_chains_test.py @@ -277,7 +277,7 @@ def test_aggregated_filter_ad_hoc_warnings(workflow, sensor_parameters): rd_analysis.set_clearsky(pvlib_location=pvlib.location.Location(40, -80), poa_global_clearsky=rd_analysis.poa_global) # disable all filters outside of CSI - rd_analysis.filter_params = {'csi_filter': {}} + rd_analysis.filter_params = {"clearsky_filter": {'model': 'csi'}} # warning for incomplete index daily_ad_hoc_filter = pd.Series(True, index=sensor_parameters['pv'].index[:-5]) @@ -300,7 +300,7 @@ def test_aggregated_filter_ad_hoc_warnings(workflow, sensor_parameters): rd_analysis_2.set_clearsky(pvlib_location=pvlib.location.Location(40, -80), poa_global_clearsky=rd_analysis_2.poa_global) # disable all filters outside of CSI - rd_analysis_2.filter_params = {'csi_filter': {}} + rd_analysis_2.filter_params = {"clearsky_filter": {'model': 'csi'}} daily_ad_hoc_filter = pd.Series(True, index=sensor_parameters['pv'].index) daily_ad_hoc_filter = daily_ad_hoc_filter.resample( '1D').first().dropna(how='all')