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%     |
+---------------------------+----------+---------+--------------+
You might also like...
Bot simply search for the files from provided channel according to given query and gives link to those files as buttons!

Auto Filter Bot ㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤ You can call this as an Auto Filter Bot if you like :D Bot simply search for the files from provided channel according

A Tool to scrape URLs for a given domain from wayback machine, Commoncrawl and OTX Alienvault
A Tool to scrape URLs for a given domain from wayback machine, Commoncrawl and OTX Alienvault

Mr_URL Mr.URL fetches known URLs for a given domain from Wayback Machine, Commoncrawl and OTX Alienvault. It also finds old versions of any given URL

A simple discord bot written in python which can surf subreddits, send a random meme, jokes and also weather of a given place
A simple discord bot written in python which can surf subreddits, send a random meme, jokes and also weather of a given place

A simple Discord Bot A simple discord bot written in python which can surf subreddits, send a random meme, jokes and also weather of a given place. We

A Bot Upload file|video To Telegram using given Links.

A Bot Upload file|video To Telegram using given Links.

GET-ACQ is a python tool used to gather all companies acquired by a given company domain name.

get-acq 🏢 GET-ACQ is a python tool used to gather all companies acquired by a given company domain name. It is done by calling SecurityTrails API. Us

Replace sequence_IDs in gff3 based on given genome.fasta

gff-rename Replace the sequence IDs in a gff3 file with a set of provided sequence IDs from a genom.fasta. This is useful when a gff3 file is retrieve

WhatSender is a python package that allows you to send Whatsapp messages at a given time.

WhatSender is a python package that allows you to send Whatsapp messages at a given time.

A simple Telegram bot that analyses a given word, built with python-telegram-bot
A simple Telegram bot that analyses a given word, built with python-telegram-bot

Telegram Word Bot A simple Telegram bot that analyses a given word, built with python-telegram-bot. The bot is fairly useless - unless you often need

CDIoU and CDIoU loss is like a convenient plug-in that can be used in multiple models. CDIoU and CDIoU loss have different excellent performances in several models such as Faster R-CNN, YOLOv4, RetinaNet and . There is a maximum AP improvement of 1.9% and an average AP of 0.8% improvement on MS COCO dataset, compared to traditional evaluation-feedback modules. Here we just use as an example to illustrate the code.
Owner
null
A thin Python Wrapper for the Dark Sky (formerly forecast.io) weather API

Dark Sky Wrapper This is a wrapper for the Dark Sky (formerly forecast.io) API. It allows you to get the weather for any location, now, in the past, o

Ze'ev Gilovitz 414 Nov 16, 2022
Generate direct m3u playlist for all the channels subscribed in the Tata Sky portal

Tata Sky IPTV Script generator A script to generate the m3u playlist containing direct streamable file (.mpd or MPEG-DASH or DASH) based on the channe

Gaurav Thakkar 250 Jan 1, 2023
Replacement for the default Dark Sky Home Assistant integration using Pirate Weather

Pirate Weather Integrations This integration is designed to replace the default Dark Sky integration in Home Assistant with a slightly modified, but f

Alexander Rey 129 Jan 6, 2023
Techie Sneh 19 Dec 3, 2021
telegram bot that calculates file hash / Dosya toplamı hesaplayan telegram botu

Telegram File Hash Bot FileHashBot: ???? Bot that calculates file hashes. ???? Dosya toplamları hesaplayan bot. Demo in Telegram: @FileHashBot ???? Se

Hüzünlü Artemis [HuzunluArtemis] 5 Jun 29, 2022
Short Program using Transavia's API to notify via email an user waiting for a flight at special dates and with the best price

Flight-Notifier Short Program using Transavia's API to notify via email an user waiting for a flight at special dates and with the best price Algorith

Wassim 2 Apr 10, 2022
Notflix - Notion / Netflix and IMDb to organise your movie dates. Happy Valentine <3 from 0x1za

Welcome to notflix ?? This is a project to help organise shows to watch with my

Mwiza Ed' Simbeye 3 Feb 15, 2022
Demo to explain how to use AWS Chalice to connect to twitter API and change profile picture at scheduled times.

chalice-twitter-demo Demo to explain how to use AWS Chalice to connect to twitter API and change profile picture at scheduled times. Video Demo Click

Ahmed Mohamed 4 Dec 13, 2021
Messing around with GitHub API to look at omicron build times

gh-workflow-runs This is a very simple tool to dump out basic information about workflow runs for a GitHub repo. The structure is based on gh-subscrip

David Pacheco 1 Nov 30, 2021
Pythonic wrapper for the Aladhan prayer times API.

aladhan.py is a pythonic wrapper for the Aladhan prayer times API. Installation Python 3.6 or higher is required. To Install aladhan.py with pip: pip

HETHAT 8 Aug 17, 2022