Compare commits
2 commits
bc8391a5d5
...
bc4d956042
| Author | SHA1 | Date | |
|---|---|---|---|
| bc4d956042 | |||
| 8901bc9bbb |
2 changed files with 13 additions and 11 deletions
|
|
@ -197,15 +197,18 @@ def calculate_meteor_shower_data(year: int) -> list[MeteorShower]:
|
||||||
|
|
||||||
for shower_id, shower_info in METEOR_SHOWERS.items():
|
for shower_id, shower_info in METEOR_SHOWERS.items():
|
||||||
# Calculate peak date based on solar longitude
|
# Calculate peak date based on solar longitude
|
||||||
peak_date = calculate_solar_longitude_date(
|
peak_longitude = shower_info["peak_solar_longitude"]
|
||||||
year, shower_info["peak_solar_longitude"]
|
assert isinstance(peak_longitude, (int, float))
|
||||||
)
|
peak_date = calculate_solar_longitude_date(year, peak_longitude)
|
||||||
|
|
||||||
# Calculate activity period
|
# Calculate activity period
|
||||||
activity_start = calculate_solar_longitude_date(
|
start_longitude = shower_info["activity_start"]
|
||||||
year, shower_info["activity_start"]
|
assert isinstance(start_longitude, (int, float))
|
||||||
)
|
activity_start = calculate_solar_longitude_date(year, start_longitude)
|
||||||
activity_end = calculate_solar_longitude_date(year, shower_info["activity_end"])
|
|
||||||
|
end_longitude = shower_info["activity_end"]
|
||||||
|
assert isinstance(end_longitude, (int, float))
|
||||||
|
activity_end = calculate_solar_longitude_date(year, end_longitude)
|
||||||
|
|
||||||
# Calculate moon phase at peak
|
# Calculate moon phase at peak
|
||||||
moon_illumination, moon_phase_desc = calculate_moon_phase(peak_date)
|
moon_illumination, moon_phase_desc = calculate_moon_phase(peak_date)
|
||||||
|
|
@ -235,9 +238,9 @@ def calculate_meteor_shower_data(year: int) -> list[MeteorShower]:
|
||||||
"peak": peak_formatted,
|
"peak": peak_formatted,
|
||||||
"active": active_formatted,
|
"active": active_formatted,
|
||||||
"rate": f"{shower_info['rate_min']}-{shower_info['rate_max']} meteors per hour",
|
"rate": f"{shower_info['rate_min']}-{shower_info['rate_max']} meteors per hour",
|
||||||
"radiant": shower_info["radiant_ra"].split("h")[0]
|
"radiant": str(shower_info["radiant_ra"]).split("h")[0]
|
||||||
+ "h "
|
+ "h "
|
||||||
+ shower_info["radiant_dec"],
|
+ str(shower_info["radiant_dec"]),
|
||||||
"moon_phase": moon_phase_desc,
|
"moon_phase": moon_phase_desc,
|
||||||
"visibility": shower_info["visibility"],
|
"visibility": shower_info["visibility"],
|
||||||
"description": shower_info["description"],
|
"description": shower_info["description"],
|
||||||
|
|
@ -255,7 +258,7 @@ def calculate_meteor_shower_data(year: int) -> list[MeteorShower]:
|
||||||
meteor_data.append(meteor_shower)
|
meteor_data.append(meteor_shower)
|
||||||
|
|
||||||
# Sort by peak date
|
# Sort by peak date
|
||||||
meteor_data.sort(key=lambda x: datetime.strptime(x["peak_date"], "%Y-%m-%d"))
|
meteor_data.sort(key=lambda x: datetime.strptime(str(x["peak_date"]), "%Y-%m-%d"))
|
||||||
|
|
||||||
return meteor_data
|
return meteor_data
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,6 @@ async def recent() -> str:
|
||||||
"event_list.html",
|
"event_list.html",
|
||||||
today=now.date(),
|
today=now.date(),
|
||||||
events=events,
|
events=events,
|
||||||
fullcalendar_events=calendar.build_events(events),
|
|
||||||
start_event_list=date.today() - timedelta(days=14),
|
start_event_list=date.today() - timedelta(days=14),
|
||||||
end_event_list=date.today(),
|
end_event_list=date.today(),
|
||||||
render_time=(time.time() - t0),
|
render_time=(time.time() - t0),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue