diff --git a/aiapy/calibrate/tests/test_prep.py b/aiapy/calibrate/tests/test_prep.py index 297eacb..b397e99 100644 --- a/aiapy/calibrate/tests/test_prep.py +++ b/aiapy/calibrate/tests/test_prep.py @@ -160,7 +160,6 @@ def test_correct_degradation(aia_171_map, correction_table, version): ), ], ) -@pytest.mark.filterwarnings("ignore:Multiple valid epochs for") def test_degradation(correction_table, version, time_correction_truth): # NOTE: this just tests an expected result from aiapy, not necessarily an # absolutely correct result. It was calculated for the above time and @@ -223,7 +222,6 @@ def test_degradation(correction_table, version, time_correction_truth): ), ], ) -@pytest.mark.filterwarnings("ignore:Multiple valid epochs for") def test_degradation_all_wavelengths(wavelength, result): obstime = astropy.time.Time("2015-01-01T00:00:00", scale="utc") time_correction = degradation( diff --git a/aiapy/calibrate/util.py b/aiapy/calibrate/util.py index 9abd126..cae7d14 100644 --- a/aiapy/calibrate/util.py +++ b/aiapy/calibrate/util.py @@ -13,12 +13,12 @@ from astropy.table import QTable from astropy.time import Time from erfa.core import ErfaWarning +from sunpy import log from sunpy.data import manager from sunpy.net import attrs, jsoc from aiapy import _SSW_MIRRORS from aiapy.util.decorators import validate_channel -from aiapy.util.exceptions import AiapyUserWarning __all__ = ["get_correction_table", "get_pointing_table", "get_error_table"] @@ -147,10 +147,8 @@ def _select_epoch_from_correction_table(channel: u.angstrom, obstime, table, *, # use the most up-to-date one. i_epoch = np.where(obstime_in_epoch)[0] if i_epoch.shape[0] > 1: - warnings.warn( + log.debug( f"Multiple valid epochs for {obstime}. Using the most recent one", - AiapyUserWarning, - stacklevel=3, ) # Create new table with only first and obstime epochs return QTable(table[[0, i_epoch[-1]]]) diff --git a/changelog/318.breaking.rst b/changelog/318.breaking.rst new file mode 100644 index 0000000..3b9c21b --- /dev/null +++ b/changelog/318.breaking.rst @@ -0,0 +1 @@ +Downgraded warning for Multiple Valid Epochs (`aiapy.util.util._select_epoch_from_correction_table`) to a logging debug message.