diff --git a/fink_filters/__init__.py b/fink_filters/__init__.py index 062717b..fc26a58 100644 --- a/fink_filters/__init__.py +++ b/fink_filters/__init__.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "7.8" +__version__ = "7.9" diff --git a/fink_filters/ztf/livestream/filter_early_kn_candidates/filter.py b/fink_filters/ztf/livestream/filter_early_kn_candidates/filter.py index ddc4bc8..734ca5a 100644 --- a/fink_filters/ztf/livestream/filter_early_kn_candidates/filter.py +++ b/fink_filters/ztf/livestream/filter_early_kn_candidates/filter.py @@ -35,6 +35,8 @@ from fink_filters import __file__ from fink_filters.tester import spark_unit_tests +log = logging.Logger("Kilonova filter") + def perform_classification( drb, @@ -143,7 +145,12 @@ def perform_classification( ) # for a test on "many" objects, you may wait 1s to stay under the # query limit. - table = SDSS.query_region(pos, fields=["type"], radius=5 * u.arcsec) + try: + table = SDSS.query_region(pos, fields=["type"], radius=5 * u.arcsec) + except requests.exceptions.ReadTimeout: + log.warning("Timeout when querying SDSS servers") + table = None + type_close_objects = [] if table is not None: type_close_objects = table["type"] @@ -454,7 +461,6 @@ def early_kn_candidates( headers={"Content-Type": "application/json"}, ) else: - log = logging.Logger("Kilonova filter") log.warning(error_message.format(url_name)) # Grandma amateur channel @@ -475,7 +481,6 @@ def early_kn_candidates( headers={"Content-Type": "application/json"}, ) else: - log = logging.Logger("Kilonova filter") log.warning(error_message.format("KNWEBHOOK_AMA_GALAXIES")) # DWF channel and requirements @@ -490,7 +495,6 @@ def early_kn_candidates( headers={"Content-Type": "application/json"}, ) else: - log = logging.Logger("Kilonova filter") log.warning(error_message.format("KNWEBHOOK_DWF")) return mask_filter