API Reference: Core Module
core
Core functions for astronomical calculations using Skyfield library.
get_ascendent_position(lat, lon, given_time)
Calculate the tropical ascendant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat
|
float
|
The latitude of the observer in decimal degrees. |
required |
lon
|
float
|
The longitude of the observer in decimal degrees. |
required |
given_time
|
datetime
|
The datetime of the observation. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The longitude of the tropical/sidereal ascendant. |
Source code in ndastro_engine/core.py
get_lunar_node_positions(given_time)
Calculate the positions of the lunar nodes (Rahu and Kethu) for a given datetime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
given_time
|
datetime
|
The datetime in UTC for which to calculate the lunar node positions. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
tuple[float, float]: A tuple containing the longitudes of Rahu and Kethu in decimal degrees. |
Source code in ndastro_engine/core.py
get_planet_position(planet, lat, lon, given_time)
Return the tropical position of the planet for the given latitude, longitude, and datetime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planet
|
Planets
|
The planet to calculate the position for. |
required |
lat
|
float
|
The latitude of the observer in decimal degrees. |
required |
lon
|
float
|
The longitude of the observer in decimal degrees. |
required |
given_time
|
datetime
|
The datetime of the observation in UTC. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PlanetPosition |
PlanetPosition
|
The tropical latitude, longitude, distance, and their rates of change of the planet. |
Source code in ndastro_engine/core.py
get_planets_position(planets, lat, lon, given_time)
Return the tropical positions of all planets for the given latitude, longitude, and datetime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planets
|
list[Planets]
|
The list of planets to calculate the positions for. |
required |
lat
|
float
|
The latitude of the observer in decimal degrees. |
required |
lon
|
float
|
The longitude of the observer in decimal degrees. |
required |
given_time
|
datetime
|
The datetime of the observation in UTC. |
required |
Returns:
| Type | Description |
|---|---|
dict[Planets, PlanetPosition]
|
dict[Planets, PlanetPosition]: A dictionary mapping each planet to its tropical/sidereal latitude, longitude, and distance & their rates of change. |
Source code in ndastro_engine/core.py
get_sunrise_sunset(lat, lon, given_time, elevation=914)
Calculate the sunrise and sunset times for a given location and date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat
|
float
|
The latitude of the location in decimal degrees. |
required |
lon
|
float
|
The longitude of the location in decimal degrees. |
required |
given_time
|
datetime
|
The date and time for which to calculate the sunrise and sunset times. |
required |
elevation
|
float
|
The elevation of the location in meters. Defaults to 914 meters (approximately 3000 feet). |
914
|
Returns:
| Type | Description |
|---|---|
tuple[datetime, datetime]
|
tuple[datetime, datetime]: A tuple containing the sunrise and sunset times as datetime objects. |