fourier-ephem


Namefourier-ephem JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/PedroKKr/fourier_ephem
SummaryAn not-so-accurate ephemeris for the Sun and the Moon using a sum of sines approximation
upload_time2023-07-26 17:15:00
maintainer
docs_urlNone
authorPedro Kleinschmitt Krause
requires_python
licenseMIT
keywords fourier ephemeris astronomy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fourier Ephemeris

An not-so-accurate ephemeris for the Sun and the Moon using a sum of sines approximation.

```
pip install fourier-ephem
```


## Introduction

This recreational project presents a simple ephemeris developed by performing a Fourier transform on the Geocentric Solar Ecliptic (GSE) coordinates of the Moon and applying a least squares fit. The data used for this project is sourced from NASA's [SSC Locator Form](https://sscweb.gsfc.nasa.gov/cgi-bin/Locator.cgi) and spans from 1959 to 2040.

The motivation for creating this ephemeris was to show how one can predict the motion of the Sun and the Moon in a simple way without the need for the advanced methods used by modern ephemeris, with the original final goal of predicting solar eclipses. However, this project seeks to also support ephemerides for the planets and stars in the future.

The ephemeris contains 20, 8, and 9 terms for the longitude, latitude, and distance of the Moon, respectively. For the Sun, the distance is represented by a single sine wave, while its latitude and longitude are assumed to be 0.

## Precision

The root-mean-square deviation of the Moon's latitude, longitude, and distance in the fitted period is 40", 51", and 165 km, respectively. While this error may be considered high by modern standards, it is sufficient for predicting eclipses, as demonstrated below with the total solar eclipse of August 2, 2027. Note that the ephemeris can predict eclipses even from the year 3000, rendering it accurate enough for many centuries.

![anigif](https://github.com/PedroKKr/fourierEphem/assets/52111108/2182c447-dc76-451c-a769-c4d6ca8b9768)

## Features

The ephemeris currently supports the following calculations:

- Position of the Sun and the Moon in the GSE system
- Altitude and azimuth of the Sun and the Moon for a given observer at specific latitude and longitude coordinates, with a simple atmospheric correction.
- Angular distance and apparent intersection of the Sun and the Moon, particularly useful for eclipse calculations (Eclipse animations can be created using the `eclipseAnimation.py` file and eclipses within a time range can be found using the `searchEclipses.py` file)
- Obliquity of the ecliptic, mean and true anomaly of the Earth

### Example code
```python
from fourier_ephem import *

lat, lon = -22.01134350210518, -47.89648023382425
date = get_date(2023,6,28,20,0,0)

observer, obs_rm = observer_position(date, lat, lon, return_rotation=True)
moon = moon_position(date)
sun = sun_position(date)

moon_az, moon_alt = az(observer, obs_rm, moon), alt(observer, moon)
sun_az, sun_alt = az(observer, obs_rm, sun), alt(observer, sun)

print(f"The Moon is at an altitude of {moon_alt:.2f}° and azimuth of {moon_az:.2f}°")
print(f"The Sun is at an altitude of {sun_alt:.2f}° and azimuth of {sun_az:.2f}°")
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PedroKKr/fourier_ephem",
    "name": "fourier-ephem",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "fourier,ephemeris,astronomy",
    "author": "Pedro Kleinschmitt Krause",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/60/93/cf1a2add91652eb59f42053c3dbb79d3ffecf71bb95cf7f27bfc0e361514/fourier_ephem-1.0.2.tar.gz",
    "platform": null,
    "description": "# Fourier Ephemeris\r\n\r\nAn not-so-accurate ephemeris for the Sun and the Moon using a sum of sines approximation.\r\n\r\n```\r\npip install fourier-ephem\r\n```\r\n\r\n\r\n## Introduction\r\n\r\nThis recreational project presents a simple ephemeris developed by performing a Fourier transform on the Geocentric Solar Ecliptic (GSE) coordinates of the Moon and applying a least squares fit. The data used for this project is sourced from NASA's [SSC Locator Form](https://sscweb.gsfc.nasa.gov/cgi-bin/Locator.cgi) and spans from 1959 to 2040.\r\n\r\nThe motivation for creating this ephemeris was to show how one can predict the motion of the Sun and the Moon in a simple way without the need for the advanced methods used by modern ephemeris, with the original final goal of predicting solar eclipses. However, this project seeks to also support ephemerides for the planets and stars in the future.\r\n\r\nThe ephemeris contains 20, 8, and 9 terms for the longitude, latitude, and distance of the Moon, respectively. For the Sun, the distance is represented by a single sine wave, while its latitude and longitude are assumed to be 0.\r\n\r\n## Precision\r\n\r\nThe root-mean-square deviation of the Moon's latitude, longitude, and distance in the fitted period is 40\", 51\", and 165 km, respectively. While this error may be considered high by modern standards, it is sufficient for predicting eclipses, as demonstrated below with the total solar eclipse of August 2, 2027. Note that the ephemeris can predict eclipses even from the year 3000, rendering it accurate enough for many centuries.\r\n\r\n![anigif](https://github.com/PedroKKr/fourierEphem/assets/52111108/2182c447-dc76-451c-a769-c4d6ca8b9768)\r\n\r\n## Features\r\n\r\nThe ephemeris currently supports the following calculations:\r\n\r\n- Position of the Sun and the Moon in the GSE system\r\n- Altitude and azimuth of the Sun and the Moon for a given observer at specific latitude and longitude coordinates, with a simple atmospheric correction.\r\n- Angular distance and apparent intersection of the Sun and the Moon, particularly useful for eclipse calculations (Eclipse animations can be created using the `eclipseAnimation.py` file and eclipses within a time range can be found using the `searchEclipses.py` file)\r\n- Obliquity of the ecliptic, mean and true anomaly of the Earth\r\n\r\n### Example code\r\n```python\r\nfrom fourier_ephem import *\r\n\r\nlat, lon = -22.01134350210518, -47.89648023382425\r\ndate = get_date(2023,6,28,20,0,0)\r\n\r\nobserver, obs_rm = observer_position(date, lat, lon, return_rotation=True)\r\nmoon = moon_position(date)\r\nsun = sun_position(date)\r\n\r\nmoon_az, moon_alt = az(observer, obs_rm, moon), alt(observer, moon)\r\nsun_az, sun_alt = az(observer, obs_rm, sun), alt(observer, sun)\r\n\r\nprint(f\"The Moon is at an altitude of {moon_alt:.2f}\u00c2\u00b0 and azimuth of {moon_az:.2f}\u00c2\u00b0\")\r\nprint(f\"The Sun is at an altitude of {sun_alt:.2f}\u00c2\u00b0 and azimuth of {sun_az:.2f}\u00c2\u00b0\")\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An not-so-accurate ephemeris for the Sun and the Moon using a sum of sines approximation",
    "version": "1.0.2",
    "project_urls": {
        "Download": "https://github.com/PedroKKr/fourier_ephem/archive/refs/tags/v1.0.0.tar.gz",
        "Homepage": "https://github.com/PedroKKr/fourier_ephem"
    },
    "split_keywords": [
        "fourier",
        "ephemeris",
        "astronomy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6093cf1a2add91652eb59f42053c3dbb79d3ffecf71bb95cf7f27bfc0e361514",
                "md5": "a6d1fcca5aa287e58868df7baccaed61",
                "sha256": "1d33529777144af52768f63ddc8466fe0f691fc5ed2b15b9e70cd6f3a4c093dc"
            },
            "downloads": -1,
            "filename": "fourier_ephem-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a6d1fcca5aa287e58868df7baccaed61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6539,
            "upload_time": "2023-07-26T17:15:00",
            "upload_time_iso_8601": "2023-07-26T17:15:00.439788Z",
            "url": "https://files.pythonhosted.org/packages/60/93/cf1a2add91652eb59f42053c3dbb79d3ffecf71bb95cf7f27bfc0e361514/fourier_ephem-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-26 17:15:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PedroKKr",
    "github_project": "fourier_ephem",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fourier-ephem"
}
        
Elapsed time: 0.09318s