Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions filter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import xml.etree.ElementTree as ET
from math import isnan

class XMLFilter:
"""
Expand Down Expand Up @@ -69,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
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.
Expand All @@ -80,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):
"""
Expand Down