Chronocalc - Calculates the dates and times when the sun or moon is in a given position in the sky

Overview

Chronocalc

I wrote this script after I was busy updating my article on chronolocation, which can be found here.

It calculates the dates and times when the sun or moon is in a given position in the sky. It can be used during chronolocation tasks, to quickly find possible dates and times within a 15 minutes accuracy. For finding a more precise moment, one should use a tool like suncalc.org to find a closer match, or use the option --accurate.

Installation

Install all the requirements first:

pip install -r requirements.txt

Or with the newest versions:

python3.8 -m pip install -r requirements.txt

Usage

To determine the date and time, you need to have the following information already:

  • The exact latitude and longitude of the location
  • The year you want to calculate
  • Height (altitude) of the sun or moon
  • Direction (azimuth) of the sun or moon*

The script will pull the elevation information from an online source, and after this the script will iterate through a whole year, in 15 minute increments, and returns one of the following:

Sun

Two dates on either side of the solstice, where the given altitude and azimuth matches the closest to the calculated time. If it's not possible to find a match, there might me two possibilities:

  • The initial measurements are incorrect and the situation can't exist
  • The location is extrmely close to the equator, and the sun moves too fast for the 15 minute increment

If the latitude given is close to the equator, about 2 degrees or less off, you can use the --accurate option. This will change the calculation interval to 2 minutes, given a better chance to find a possible match. This will take longer to retrieve a result, but if there is a match, it should be shown.

Moon

To retrieve a list of dates where the moon is at a given position, use the optional argument --moon.

It will return all dates and times the moon is in the given position, and its illumination percentage. Since the moon can be in the same position multiple times a year, all dates that are within a are within a 2 degree limit of the altitude and azimuth are returned.

If there are no matches with the given parameter, it will return a message saying so. Change some variables, or check your findings, and run the script again. The --accurate argument has no use here.

Examples

To find the dates where the sun is in a given position:

python chronocalc.py -y 2020 -lat 50.9423 -lon 6.9579 -alt 32 -az 200

Result:

+---------------------------+----------+---------+
|       Date and time       | Altitude | Azimuth |
+---------------------------+----------+---------+
| 2020-03-08T14:00:00+01:00 |  32.08   |  202.87 |
| 2020-10-05T14:30:00+02:00 |  32.09   |  200.58 |
+---------------------------+----------+---------+

Find all the dates where the moon is at a given position in the sky:

python chronocalc.py -y 2018 -lat 50.9423 -lon 6.9579 -alt 30 -az 200 --moon

Result:

+---------------------------+----------+---------+--------------+
|       Date and time       | Altitude | Azimuth | Illumination |
+---------------------------+----------+---------+--------------+
| 2018-01-08T08:15:00+01:00 | 31.28    | 218.99  |    56.6%     |
| 2018-01-22T19:15:00+01:00 | 28.95    | 221.78  |    28.0%     |
| 2018-02-05T07:00:00+01:00 | 28.28    | 219.48  |    73.7%     |
| 2018-03-04T04:45:00+01:00 | 30.69    | 219.79  |    94.1%     |
| 2018-03-18T15:45:00+01:00 | 31.54    | 219.73  |     1.4%     |
| 2018-04-14T14:45:00+02:00 | 28.95    | 220.78  |     2.9%     |
| 2018-04-28T02:15:00+02:00 | 30.16    | 219.45  |    95.3%     |
| 2018-05-12T13:15:00+02:00 | 31.91    | 220.0   |    11.5%     |
| 2018-05-25T00:15:00+02:00 | 31.48    | 220.87  |    78.6%     |
| 2018-06-08T11:15:00+02:00 | 28.91    | 221.16  |    34.2%     |
| 2018-06-21T23:00:00+02:00 | 28.62    | 219.23  |    65.3%     |
| 2018-07-18T21:00:00+02:00 | 29.86    | 220.99  |    39.3%     |
| 2018-08-02T07:45:00+02:00 | 30.6     | 219.83  |    75.1%     |
| 2018-08-29T05:45:00+02:00 | 29.26    | 219.47  |    93.1%     |
| 2018-09-11T17:30:00+02:00 | 29.16    | 221.32  |     5.1%     |
| 2018-09-26T04:30:00+02:00 | 31.86    | 221.75  |    98.8%     |
| 2018-10-23T02:15:00+02:00 | 31.01    | 218.37  |    96.8%     |
| 2018-11-05T13:00:00+01:00 | 28.59    | 221.58  |     5.8%     |
| 2018-11-18T23:15:00+01:00 | 28.16    | 219.37  |    79.9%     |
| 2018-12-02T10:45:00+01:00 | 31.51    | 219.53  |    24.7%     |
| 2018-12-16T21:45:00+01:00 | 30.99    | 218.8   |    63.4%     |
+---------------------------+----------+---------+--------------+
A modular telegram Python bot running on python3 with an sqlalchemy database.

Saber A modular telegram Python bot running on python3 with an sqlalchemy database. Originally a marie fork - Saber has evolved further and was built

ZERO • アクバル . 4 Nov 09, 2021
A synchronous, object oriented API wrapper for thecatapi

cats.py A synchronous, object oriented API wrapper for thecatapi Table Of Content cats.py Table Of Content Installation Usage Contributing FAQ License

Marcus 2 Feb 04, 2022
Unofficial GoPro API Library for Python - connect to GoPro via WiFi.

GoPro API for Python Unofficial GoPro API Library for Python - connect to GoPro cameras via WiFi. Compatibility: HERO3 HERO3+ HERO4 (including HERO Se

Konrad Iturbe 1.3k Jan 01, 2023
Python app to notify via slack channel the status_code change from an URL

Python app to notify, via slack channel you choose to be notified, for the status_code change from the URL list you setup to be checked every yy seconds

Pedro Nunes 1 Oct 25, 2021
Auto-Rollnumber-sender - Auto Rollnumber sender with python

Auto-Rollnumber-sender The above code fits better on my system but it can vary s

Riya Tripathi 2 Feb 14, 2022
Total servers you're in!

Discord-Servercount With this script you can check the amount of servers you are in, along with statistics of how many servers you are owner in and in

Nickyux 1 Feb 12, 2022
Discord E-Store Bot

A delivery bot for Discord, works like Amazon where real users can pack & deliver orders in different servers!

Amit Pathak 2 Jan 28, 2022
Slam Mirror Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive.

Slam Mirror Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive.

Abinash939 1 Oct 10, 2021
Mazda Connected Service API wrapper based on pymazda and Flask.

Mazda Connected Service Relay Mazda Connected Service API wrapper based on pymazda and Flask. Usage Make POST calls to https://mymazda.herokuapp.com/{

Alan Chen 10 Jan 05, 2023
Decryption utility for PGP Whole Disk Encryption

wdepy: Decryption and Inspection for PGP WDE Disks This is a small python tool to inspect and decrypt disk images encrypted with PGP Whole Disk Encryp

Brendan Dolan-Gavitt 17 Oct 07, 2022
Telegram üzerinden paylaşılan kısa linkleri geçmenin daha hızlı bir yolu

Telegram Url skipper Telegramda paylaşılan kısa linkleri geçmenin daha hızlı bir yolu · Hata Raporla · Öneri Yap İçerik Tablosu Kurulum Kullanım Lisan

WarForPeace 6 Oct 07, 2022
LOL-banner - A discord bot that bans anybody playing league of legends

LOL-banner A discord bot that bans anybody playing league of legends This bot ha

bsd_witch 46 Dec 17, 2022
Autofilterv5 With Same more Features

Autofilterv5 With Same more Features ✨ Imbd + Index +.....

Selfie SD 8 Oct 21, 2022
SpamBot.py allows you, to spam other Chat Partners etc.

SpamBot -SpamBot.py allows you, to spam other Chat Partners etc. Install If you downloaded it yet, you have to install "requirements.txt" write the di

Marco 1 Jan 16, 2022
A comand-line utility for taking automated screenshots of websites

shot-scraper A comand-line utility for taking automated screenshots of websites For background on this project see shot-scraper: automated screenshots

Simon Willison 837 Jan 07, 2023
Slack Developer Kit for Python

Python Slack SDK The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the platform, so that you

SlackAPI 3.5k Jan 02, 2023
A Python wrapper around the Twitter API.

Python Twitter A Python wrapper around the Twitter API. By the Python-Twitter Developers Introduction This library provides a pure Python interface fo

Mike Taylor 3.4k Jan 01, 2023
Telegram bot with various Sticker Tools

Sticker Tools Bot @Sticker_Tools_Bot A star ⭐ from you means a lot to us! Telegram bot with various Sticker Tools Usage Deploy to Heroku Tap on above

Stark Bots 20 Dec 08, 2022
Google Sheets Python API v4

pygsheets - Google Spreadsheets Python API v4 A simple, intuitive library for google sheets which gets your work done. Features: Open, create, delete

Nithin Murali 1.4k Jan 08, 2023