首页 > 解决方案 > 当天文学“足够黑”时,如何使用 Wolfram-Language 计算“适合观看之夜”的日期?

问题描述

我正试图围绕 Wolfram 语言(我没有使用 Mathematica 的经验)。

我注意到“它”有“关于”天文学的“知识”。所以我想知道我是否可以计算以下内容:

tell me the dates and start/finish times of 'dark, socially friendly viewing opportunities during school holidays' where
* 'socially friendly' means between after 10am and before 10:30pm in local time at my vantage point
* it is 'dark' for at least an hour
* where 'dark' means:
  * it's between astronomical sunset and astronomical dawn
  * the moon is either not risen, or less than 15% of its face is lit
* 'school holidays' means school holidays in NSW, Australia, in 2019 (which Wolfram Alpha doesn't 'implicitly know')

put such dates and times as events into my Google Calendar somehow :-)

解决这个玩具问题将帮助我欣赏在这个平台上解决问题的“方法”,它似乎迎合了 Wolfram 系统的优势。另外,每年查找资料可以为我节省一两个小时:-)

我将如何在 Wolfram 语言“程序”(方程式?)中处理这个问题?我可以在 Wolfram-Alpha 中执行此操作还是需要获取引擎?

标签: wolfram-language

解决方案


不是您问题的完整答案。只是一个起点。

tz = Entity["TimeZone", "Australia/Sydney"];
date = DateObject[{2019, 07, 14}, TimeZone -> tz];

Sunrise[Entity["City", {"Sydney", "NewSouthWales", "Australia"}], date, TimeZone -> tz]

在此处输入图像描述

同样对于Sunset

sunset = Sunset[
  Entity["City", {"Sydney", "NewSouthWales", "Australia"}], 
  DateObject[{2019, 07, 14}, TimeZone -> tz], TimeZone -> tz]

您可以从结果中添加/减去 2 或 3 小时以获得“天文”值。

月相

MoonPhase[date]
(* 0.8913 *)

MoonPhase[date, "Name"]["Name"]
(* waxing gibbous moon *)

日落时月亮的位置

MoonPosition[Entity["City", {"Sydney", "NewSouthWales", "Australia"}], sunset]
(* {98.67\[Degree],25.03\[Degree]} *)

观看视频,了解 WL 中与天文和空间相关的实体数据的概述。


推荐阅读