feat: 노을 시간표를 세로 목록으로 — 골든아워·블루아워는 시작~끝 범위(블루아워 시작 해 고도 -4° 계산 추가), 노을 피크 강조, 용어는 ? 눌러야
This commit is contained in:
1 parent
b346838054
commit
6e4babc610
7 files changed
+65
-44
No files matched your search
@@ -4,6 +4,7 @@ from datetime import date, datetime, timedelta, timezone
|
||||
|
||||
_SUN_ALTITUDE = -0.833
|
||||
_CIVIL_ALTITUDE = -6.0
|
||||
_BLUE_ALTITUDE = -4.0 # 블루아워: 해 고도 -4° ~ -6°
|
||||
_GOLDEN_ALTITUDE = 6.0
|
||||
|
||||
|
||||
@@ -17,6 +18,8 @@ class SunTimes:
|
||||
sunrise_azimuth: int
|
||||
golden_start_at: datetime
|
||||
golden_end_at: datetime # 아침에 해 고도가 골든아워 높이까지 올라오는 때
|
||||
blue_start_at: datetime # 저녁 블루아워 시작 (해 고도 -4°)
|
||||
blue_end_morning_at: datetime # 아침 블루아워 끝 (해 고도 -4°)
|
||||
|
||||
|
||||
def _solar(d: date, lon: float) -> tuple[float, float]:
|
||||
@@ -45,6 +48,7 @@ def sun_times(d: date, lat: float, lon: float) -> SunTimes:
|
||||
h_sun = _hour_angle(lat, decl, _SUN_ALTITUDE) * 4
|
||||
h_civil = _hour_angle(lat, decl, _CIVIL_ALTITUDE) * 4
|
||||
h_golden = _hour_angle(lat, decl, _GOLDEN_ALTITUDE) * 4
|
||||
h_blue = _hour_angle(lat, decl, _BLUE_ALTITUDE) * 4
|
||||
phi, dl = math.radians(lat), math.radians(decl)
|
||||
azimuth = math.degrees(math.acos(max(-1.0, min(1.0, math.sin(dl) / math.cos(phi)))))
|
||||
return SunTimes(
|
||||
@@ -56,4 +60,6 @@ def sun_times(d: date, lat: float, lon: float) -> SunTimes:
|
||||
sunrise_azimuth=round(azimuth),
|
||||
golden_start_at=at(noon_min + h_golden),
|
||||
golden_end_at=at(noon_min - h_golden),
|
||||
blue_start_at=at(noon_min + h_blue),
|
||||
blue_end_morning_at=at(noon_min - h_blue),
|
||||
)
|
||||
Reference in new issue
Block a user