From e7cd18a7bda64c1384fabb839dd1a71171e8ec33 Mon Sep 17 00:00:00 2001 From: eiseleb47 Date: Thu, 20 Mar 2025 20:51:52 +0100 Subject: [PATCH 1/2] Added checks for the declination value --- filter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filter.py b/filter.py index 9b52993..38f88c4 100644 --- a/filter.py +++ b/filter.py @@ -1,4 +1,5 @@ import xml.etree.ElementTree as ET +from math import isnan class XMLFilter: """ @@ -69,7 +70,7 @@ def is_observable(self): bool: True if observable, False otherwise """ dec = float(self.get_text('C2')) - return dec >= self.observable_dec_threshold + return dec >= self.observable_dec_threshold and not isnan(dec) and dec <= 90 def get_location_status(self): """ From f7b8ac5fd0c6a942ca6d62029545dce7883537bc Mon Sep 17 00:00:00 2001 From: eiseleb47 Date: Thu, 20 Mar 2025 20:58:46 +0100 Subject: [PATCH 2/2] Changed print statement --- filter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/filter.py b/filter.py index 38f88c4..ac93f83 100644 --- a/filter.py +++ b/filter.py @@ -70,8 +70,8 @@ def is_observable(self): bool: True if observable, False otherwise """ dec = float(self.get_text('C2')) - return dec >= self.observable_dec_threshold and not isnan(dec) and dec <= 90 - + return dec >= self.observable_dec_threshold and not isnan(dec) and dec <= 90 + def get_location_status(self): """ Get a human-readable status of the event's observability. @@ -81,7 +81,7 @@ def get_location_status(self): """ if self.is_observable(): return 'The event should be observable.' - return 'The event is below the observable Declination.' + return 'The event is outside the observable Declination.' def get_event_data(self): """