diff --git a/pysatSpaceWeather/instruments/ace_sis.py b/pysatSpaceWeather/instruments/ace_sis.py index 61f6546..5ad0596 100644 --- a/pysatSpaceWeather/instruments/ace_sis.py +++ b/pysatSpaceWeather/instruments/ace_sis.py @@ -115,8 +115,10 @@ def clean(self): # Evaluate the different proton fluxes. Replace bad values with NaN and # times with no valid data - self.data['int_pflux_10MeV'][self.data['status_10'] > max_status] = np.nan - self.data['int_pflux_30MeV'][self.data['status_30'] > max_status] = np.nan + self.data['int_pflux_10MeV'] = self.data['int_pflux_10MeV'].where( + (self.data['status_10'] <= max_status), other=np.nan) + self.data['int_pflux_30MeV'] = self.data['int_pflux_30MeV'].where( + (self.data['status_30'] <= max_status), other=np.nan) eval_cols = ['int_pflux_10MeV', 'int_pflux_30MeV'] diff --git a/pysatSpaceWeather/tests/test_methods_kp.py b/pysatSpaceWeather/tests/test_methods_kp.py index 9f10e3c..e6e830a 100644 --- a/pysatSpaceWeather/tests/test_methods_kp.py +++ b/pysatSpaceWeather/tests/test_methods_kp.py @@ -395,7 +395,7 @@ def test_convert_ap_to_kp_middle(self): """Test conversion of ap to Kp where ap is not an exact Kp value.""" kp_ap.convert_3hr_kp_to_ap(self.testInst) - new_val = self.testInst['3hr_ap'][8] + 1 + new_val = self.testInst['3hr_ap']iloc[8] + 1 self.testInst.data.at[self.testInst.index[8], '3hr_ap'] = new_val kp_out, kp_meta = kp_ap.convert_ap_to_kp(self.testInst['3hr_ap'])