@@ -1,4 +1,5 @@ | |||||
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
from .ephemerides import get_ephemerides | |||||
from .data import Position | |||||
from .ephemerides import get_ephemerides, get_moon_phase | |||||
from .events import get_events | from .events import get_events |
@@ -220,7 +220,7 @@ ASTERS = [ | |||||
class Position: | class Position: | ||||
def __init__(self, latitude: float, longitude: float, aster: Object): | |||||
def __init__(self, latitude: float, longitude: float, aster: Object = EARTH): | |||||
self.latitude = latitude | self.latitude = latitude | ||||
self.longitude = longitude | self.longitude = longitude | ||||
self.aster = aster | self.aster = aster | ||||
@@ -60,7 +60,7 @@ def _get_skyfield_to_moon_phase( | |||||
) | ) | ||||
def get_moon_phase(compute_date: datetime.date, timezone: int = 0) -> MoonPhase: | |||||
def get_moon_phase(compute_date: datetime.date = datetime.date.today(), timezone: int = 0) -> MoonPhase: | |||||
earth = get_skf_objects()["earth"] | earth = get_skf_objects()["earth"] | ||||
moon = get_skf_objects()["moon"] | moon = get_skf_objects()["moon"] | ||||
sun = get_skf_objects()["sun"] | sun = get_skf_objects()["sun"] | ||||
@@ -99,7 +99,7 @@ def get_moon_phase(compute_date: datetime.date, timezone: int = 0) -> MoonPhase: | |||||
def get_ephemerides( | def get_ephemerides( | ||||
date: datetime.date, position: Position, timezone: int = 0 | |||||
position: Position, date: datetime.date = datetime.date.today(), timezone: int = 0 | |||||
) -> [AsterEphemerides]: | ) -> [AsterEphemerides]: | ||||
ephemerides = [] | ephemerides = [] | ||||
@@ -213,7 +213,7 @@ def _search_moon_perigee(start_time: Time, end_time: Time, timezone: int) -> [Ev | |||||
return events | return events | ||||
def get_events(date: date_type, timezone: int = 0) -> [Event]: | |||||
def get_events(date: date_type = date_type.today(), timezone: int = 0) -> [Event]: | |||||
"""Calculate and return a list of events for the given date, adjusted to the given timezone if any. | """Calculate and return a list of events for the given date, adjusted to the given timezone if any. | ||||
Find events that happen on April 4th, 2020 (show hours in UTC): | Find events that happen on April 4th, 2020 (show hours in UTC): | ||||