Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions zeus.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_current_status(self):
astronomical_twilight_end_datetime = datetime.strptime(astronomical_twilight_end_str, "%Y-%m-%dT%H:%M:%S+00:00")
astronomical_twilight_end_datetime_utc = astronomical_twilight_end_datetime.replace(tzinfo=from_zone)
astronomical_twilight_end_datetime_local = astronomical_twilight_end_datetime_utc.astimezone(to_zone)

forecast = self.get_forecast()

latitude = forecast["latitude"]
Expand Down Expand Up @@ -280,17 +280,17 @@ def get_forecast(self):
"longitude" : longitude,
"area" : element_area_str,
"height" : element_height_str,
"time" : time_start_list,
"time_jd" : time_start_jd_list,
"dew_point" : dew_point_list,
"heat_index" : heat_index_list,
"wind_speed" : wind_speed_list,
"cloud_amount" : cloud_amount_list,
"prob_of_precip" : prob_of_precip_list,
"humidity" : humidity_list,
"wind_direction" : wind_direction_list,
"temperature" : temperature_list,
"gust" : gust_list,
"time" : time_start_list,
"time_jd" : time_start_jd_list,
"dew_point" : dew_point_list,
"heat_index" : heat_index_list,
"wind_speed" : wind_speed_list,
"cloud_amount" : cloud_amount_list,
"prob_of_precip" : prob_of_precip_list,
"humidity" : humidity_list,
"wind_direction" : wind_direction_list,
"temperature" : temperature_list,
"gust" : gust_list,
"hourly_qpf" : hourly_qpf_list}

def get_imaging(self, location):
Expand Down Expand Up @@ -392,6 +392,22 @@ def send_tweet(self, message="#ctmosays Hello world!"):
print(" [Forecast projection]")
print()

if len(forecast["time"]) == 168:

block_hour = " Hour (CDT) "
i = 0

while i < len(forecast["time"]):

hour_str = "↓"+str(datetime.fromisoformat(forecast["time"][i]).hour)
padding = " " * (6 - len(hour_str))

block_hour += hour_str + padding

i += 6

print (block_hour)

color_cloud_amount = "#FFFFFF"
block_cloud_amount = " Cloud amount (%) "

Expand Down