Skip to main content

Calculate night flying hours

Project description

nightflight

This is a very small library that leverages the astral package to calculate how much of a flight occurs during regulatory night time (30 minutes after sunset to 30 minutes before sunrise).

This calculation is somewhat complicated because sunset and sunrise are a function of location, and location is changing rapidly during a flight.

Positions and times during the flight are approximated by assuming that the flight follows a great circle track between origin and destination and that velocity is constant throughout.

The latter assumption is likely the greatest source of error, since average velocity along the great circle track will be much lower during the initial and terminal manoeuvring phases.

The assumption of great circle track may also be erroneous on very long trips. If a trip starts on exactly opposite sides of the planet, there are an infinite number of equally efficient tracks to choose from, so when the situation is close to this, the actual track flown may end up being radically different from that assumed.

The main function takes n_vectors (vectors normal to the tangent plane at a given location) as arguments to avoid dealing with singularities. A database of n_vectors for airfields as designated by their three letter IATA code or four letter ICAO codes is included. This data is a processed version of the database generously provided by ourairports.com (see https://ourairports.com/). The make_locations module has a to_nvec function to convert an arbitrary latitude and longitude to an n_vector .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nightflight-0.9.2.tar.gz (236.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nightflight-0.9.2-py3-none-any.whl (233.6 kB view details)

Uploaded Python 3

File details

Details for the file nightflight-0.9.2.tar.gz.

File metadata

  • Download URL: nightflight-0.9.2.tar.gz
  • Upload date:
  • Size: 236.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for nightflight-0.9.2.tar.gz
Algorithm Hash digest
SHA256 8f1c1248ba56c1ad9949bbca2296e9e91bf3798310aea315c160a11527a7565f
MD5 54135f7166e87e11f4c68e6a168fefe3
BLAKE2b-256 7f45a21cb5d287174ae508fa6aeec09d229064b5be085a005201171a7c9a4488

See more details on using hashes here.

File details

Details for the file nightflight-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: nightflight-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 233.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for nightflight-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d8fc910a8013a716245edf83c4c3d1b47e89944c4378aa29c3eaabc5aae642
MD5 8f87fd513854045ab3414a40dc0d1dd9
BLAKE2b-256 21b67cb63eb48f593d8b0aaaf881be206bcd35b74a5009cb42fea34fa7176f81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page