lib.orb

class lib.orb.Orb(orb, lon, lat, elev=False)[Quellcode]

Bases: object

Save an observers location and the name of a celestial body for future use

The Methods internally use PyEphem for computation

An Observer instance allows to compute the positions of celestial bodies as seen from a particular position on the Earth’s surface. Following attributes can be set after creation (used defaults are given):

date - the moment the Observer is created lat - zero degrees latitude lon - zero degrees longitude elevation - 0 meters above sea level horizon - 0 degrees epoch - J2000 temp - 15 degrees Celsius pressure - 1010 mBar

get_observer_and_orb()[Quellcode]

Return a tuple of an instance of an observer with location information and a celestial body Both returned objects are uniquely created to prevent errors in computation

See also this thread at Stackoverflow dated back to 2015 where the creator of pyephem writes:

> Second answer: As long as each thread has its own Moon and Observer objects,

it should be able to do its own computations without ruining those of any other threads.

Rückgabe:

tuple of observer and celestial body

midnight(doff=0, moff=0, dt=None)[Quellcode]
noon(doff=0, moff=0, dt=None)[Quellcode]
pos(offset=None, degree=False, dt=None)[Quellcode]

Calculates the position of either sun or moon :type offset: :param offset: given in minutes, shifts the time of calculation by some minutes back or forth :type degree: :param degree: if True: return the position of either sun or moon from the observer as degrees, otherwise as radians :type dt: :param dt: time for which the position needs to be calculated :return: a tuple with azimuth and elevation

rise(doff=0, moff=0, center=True, dt=None)[Quellcode]

Computes the rise of either sun or moon :type doff: :param doff: degrees offset for the observers horizon :type moff: :param moff: minutes offset from time of rise (either before or after) :type center: :param center: if True then the centerpoint of either sun or moon will be considered to make the transit otherwise the upper limb will be considered :type dt: :param dt: start time for the search for a rise, if not given the current time will be used :return:

set(doff=0, moff=0, center=True, dt=None)[Quellcode]

Computes the setting of either sun or moon :type doff: :param doff: degrees offset for the observers horizon :type moff: :param moff: minutes offset from time of setting (either before or after) :type center: :param center: if True then the centerpoint of either sun or moon will be considered to make the transit otherwise the upper limb will be considered :type dt: :param dt: start time for the search for a setting, if not given the current time will be used :return: