pylunar.moon_info module
Module for the MoonInfo class.
- class pylunar.moon_info.MoonInfo(latitude: Tuple[int, int, int], longitude: Tuple[int, int, int], name: str | None = None)[source]
Bases:
object
Handle all moon information.
- observer
The instance containing the observer’s location information.
- Type:
ephem.Observer instance.
- moon
The instance of the moon object.
- Type:
ephem.Moon instance
- Parameters:
latitude (tuple of 3 ints) – The latitude of the observer in GPS DMS(Degrees, Minutes and Seconds) format.
longitude (tuple of 3 ints) – The longitude of the observer in GPS DMS(Degrees, Minutes and Seconds) format.
name (str, optional) – A name for the observer’s location.
- DAYS_TO_HOURS = 24.0
- FEATURE_CUTOFF = 15.0
- LIBRATION_ZONE = 80.0
- MAIN_PHASE_CUTOFF = 2.0
- MAXIMUM_LIBRATION_PHASE_ANGLE_CUTOFF = 65.0
- NO_CUTOFF_TYPE = ('Landing Site', 'Mare', 'Oceanus')
- altitude() float [source]
Lunar altitude in degrees.
- Returns:
The lunar altitiude.
- Return type:
float
- angular_size() float [source]
Lunar current angular size in degrees.
- Returns:
The lunar angular size.
- Return type:
float
- colong() float [source]
Lunar selenographic colongitude in degrees.
- Returns:
The lunar seleographic colongitude.
- Return type:
float
- colong_to_long() float [source]
Selenographic longitude in degrees based on the terminator.
- Returns:
The lunar seleographic longitude.
- Return type:
float
- dec() float [source]
Lunar current declination in degrees.
- Returns:
The lunar declination.
- Return type:
float
- earth_distance() float [source]
Lunar current distance from the earth in km.
- Returns:
THe earth-moon distance.
- Return type:
float
- elongation() float [source]
Lunar elongation from the sun in degrees.
- Returns:
The lunar solar elongation.
- Return type:
float
- fractional_age() float [source]
Lunar fractional age which is always less than 1.0.
- Returns:
The fractional lunar age.
- Return type:
float
- fractional_phase() float [source]
Lunar fractional illumination which is always less than 1.0.
- Returns:
The lunar fractional phase.
- Return type:
float
- is_libration_ok(feature: LunarFeature) bool [source]
Determine if lunar feature is visible due to libration effect.
- Parameters:
feature (
LunarFeature
) – The lunar feature instance to check.- Returns:
True if visible, False if not.
- Return type:
bool
- is_visible(feature: LunarFeature) bool [source]
Determine if lunar feature is visible.
- Parameters:
feature (
LunarFeature
) – The lunar feature instance to check.- Returns:
True if visible, False if not.
- Return type:
bool
- libration_lat() float [source]
Lunar current latitudinal libration in degrees.
- Returns:
The lunar libration latitude.
- Return type:
float
- libration_lon() float [source]
Lunar current longitudinal libration in degrees.
- Returns:
The lunar libration longitude.
- Return type:
float
- libration_phase_angle() float [source]
Phase angle of lunar current libration in degrees.
- Returns:
The lunar libration phase angle.
- Return type:
float
- magnitude() float [source]
Lunar current magnitude.
- Returns:
The lunar magnitude.
- Return type:
float
- next_four_phases() List[Tuple[str, Tuple[int, int, int, int, int, int | float] | str]] [source]
Next four phases in date sorted order (closest phase first).
- Returns:
Set of lunar phases specified by an abbreviated phase name and Modified Julian Date.
- Return type:
list[(str, float)]
- phase_emoji() str [source]
Return standard emoji of lunar phase, i.e. ‘🌒’.
This function returns a standard emoji for lunar phase based on the current selenographic colongitude.
- Returns:
The lunar phase emoji.
- Return type:
str
- phase_name() str [source]
Return standard name of lunar phase, i.e. Waxing Cresent.
This function returns a standard name for lunar phase based on the current selenographic colongitude.
- Returns:
The lunar phase name.
- Return type:
str
- phase_shape_in_ascii() str [source]
Display lunar phase shape in ASCII art.
This function returns a multi-line string demonstrate current lunar shape in ASCII format.
- Returns:
The lunar phase shape.
- Return type:
str
- ra() float [source]
Lunar current right ascension in degrees.
- Returns:
The lunar right ascension.
- Return type:
float
- reverse_phase_lookup = {'first_quarter': (<function previous_new_moon>, 'new_moon'), 'full_moon': (<function previous_first_quarter_moon>, 'first_quarter'), 'last_quarter': (<function previous_full_moon>, 'full_moon'), 'new_moon': (<function previous_last_quarter_moon>, 'last_quarter')}
- rise_set_times(timezone: str) List[Tuple[str, Tuple[int, int, int, int, int, int | float] | str]] [source]
Calculate the rise, set and transit times in the local time system.
- Parameters:
timezone (str) – The timezone identifier for the calculations.
- Returns:
Set of rise, set, and transit times in the local time system. If event does not happen, ‘Does not xxx’ is tuple value.
- Return type:
list[(str, tuple)]
- subsolar_lat() float [source]
Latitude in degress on the moon where the sun is overhead.
- Returns:
The lunar subsolar latitude.
- Return type:
float
- time_from_new_moon() float [source]
Time (hours) from the previous new moon.
This function calculates the time from the previous new moon.
- Returns:
The time from new moon.
- Return type:
float
- time_of_day() str [source]
Terminator time of day.
This function determines if the terminator is sunrise (morning) or sunset (evening).
- Returns:
The lunar time of day.
- Return type:
str
- time_to_full_moon() float [source]
Time (days) to the next full moon.
This function calculates the time to the next full moon.
- Returns:
The time to full moon.
- Return type:
float
- time_to_new_moon() float [source]
Time (hours) to the next new moon.
This function calculates the time to the next new moon.
- Returns:
The time to new moon.
- Return type:
float
- update(datetime: Tuple[int, int, int, int, int, int | float]) None [source]
Update the moon information based on time.
This fuction updates the Observer instance’s datetime setting. The incoming datetime tuple should be in UTC with the following placement of values: (YYYY, m, d, H, M, S) as defined below:
YYYY Four digit year m month (1-12) d day (1-31) H hours (0-23) M minutes (0-59) S seconds (0-59)
- Parameters:
datetime (tuple) – The current UTC time in a tuple of numbers.