Kosmorrolib Documentation

Event

An object representing an event

Synopsis

class Event:
    event_type: EventType
    objects: [Object]
    start_time: datetime
    end_time: Union[datetime|None]
    details: {str: any}

Properties

  • event_type: one of the values of the EventType enumeration

  • objects: the asters involved in the event

  • start_time: the time at which the event starts

  • end_time: the time at which the event ends (if None, then the event is punctual and has no duration)

  • details: a dictionary that might contains details about the event

    Currently, the following event types have details:

    • APOGEE and PERIGEE:
      • distance_km (float): the distance of the object, in kilometers
    • LUNAR_ECLIPSE:
      • type (LunarEclipseType): the identifier of the type of the eclipse
      • maximum (datetime): the time at which the lunar eclipse will be at its maximum
    • MAXIMAL_ELONGATION:
      • deg (float): the angle between the ground and the object
    • SEASON_CHANGE:
      • season (SeasonType): the identifier of the new season

Methods

get_description(self, show_details: bool = True) -> str:

⚠️ Deprecated

This function will be removed in version 2.0. If you are using it, it should be replaced with your own implementation.

Returns a textual description of the event, ready to be displayed.

Arguments:
  • show_details: if there are details, then include them in the returned string.

serialize()

Returns the object as a plain simple Python dictionnary.

See also

Help us to improve this page, contribute to the documentation!