SergeyO7 commited on
Commit
0a92fe3
·
verified ·
1 Parent(s): ccaf0a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -3,6 +3,7 @@ import datetime
3
  import pytz
4
  import yaml
5
  from skyfield.api import load, Topos, load_file
 
6
  from tools.final_answer import FinalAnswerTool
7
  from Gradio_UI import GradioUI
8
 
@@ -27,6 +28,7 @@ MOON_PHASES = [
27
  ("New Moon", 0, 45),
28
  ("Waxing Crescent", 45, 90),
29
  ("First Quarter", 90, 135),
 
30
  ("Waxing Gibbous", 135, 180),
31
  ("Full Moon", 180, 225),
32
  ("Waning Gibbous", 225, 270),
@@ -108,7 +110,7 @@ def get_moon_info(date_time: str) -> dict:
108
  }
109
  where fertility indices ranges from 0 - minimal expected fertility, to 3.0 - most favorable fertility for platining,
110
  and depends on type of plant (root crop or produce above ground);
111
- pruning indices ranges from 0 - when pruning causes damages to the tree, 2.0 - only minimum or sanitary pruning allowed,
112
  to 3.0 - most favorable time for pruning;
113
  """
114
  try:
@@ -131,8 +133,9 @@ def get_moon_info(date_time: str) -> dict:
131
  _, _, ecliptic_lon = astrometric.ecliptic_latlon()
132
  lon_deg = ecliptic_lon.degrees % 360
133
 
134
- # Calculate phase angle (angle between Moon and Sun from Earth)
135
- phase_angle = earth.at(t).observe(moon).apparent().phase_angle(sun).degrees
 
136
 
137
  # Determine Zodiac sign and position
138
  zodiac_sign = "Unknown"
 
3
  import pytz
4
  import yaml
5
  from skyfield.api import load, Topos, load_file
6
+ from skyfield import almanac
7
  from tools.final_answer import FinalAnswerTool
8
  from Gradio_UI import GradioUI
9
 
 
28
  ("New Moon", 0, 45),
29
  ("Waxing Crescent", 45, 90),
30
  ("First Quarter", 90, 135),
31
+
32
  ("Waxing Gibbous", 135, 180),
33
  ("Full Moon", 180, 225),
34
  ("Waning Gibbous", 225, 270),
 
110
  }
111
  where fertility indices ranges from 0 - minimal expected fertility, to 3.0 - most favorable fertility for platining,
112
  and depends on type of plant (root crop or produce above ground);
113
+ pruning indices ranges from 0 - when pruning causes most damage to tree, 2.0 - only minimum or sanitary pruning allowed,
114
  to 3.0 - most favorable time for pruning;
115
  """
116
  try:
 
133
  _, _, ecliptic_lon = astrometric.ecliptic_latlon()
134
  lon_deg = ecliptic_lon.degrees % 360
135
 
136
+ # Calculate the phase angle using almanac.moon_phase
137
+ phase = almanac.moon_phase(planets, t)
138
+ phase_angle = phase.degrees
139
 
140
  # Determine Zodiac sign and position
141
  zodiac_sign = "Unknown"