#compsci #python 

PyEphem is a Python library that lets programmers compute planet, comet, asteroid, and Earth satellite positions.
Uses the "libastro" C library that powers the [[XEphem]] software.
Also can compute the angular separation between two objects in the sky, find what constellation the objects lies in, and so on.

Latest version - 4.2

![[Pasted image 20250712025216.png]]
([[Skyfield]], [[AstroPy]])

![[Pasted image 20250712025314.png]]


## Quick reference
### Bodies
![[Pasted image 20250712030100.png]]
#### body.compute(date)
![[Pasted image 20250712030450.png]]
- Computes the position of the body
- the date, if omitted, defaults to "now()"
- the epoch, if omitted, defaults to "2000"
- Sets the following body properties
	![[Pasted image 20250712031034.png]]
- On Solar System bodies, also sets:
	![[Pasted image 20250712032857.png]]
- On planetary moons, body.compute() also sets:
	![[Pasted image 20250712032924.png]]
- On artificial satellites, body.compute() also sets:
	![[Pasted image 20250712032937.png]]
- On Moon bodies, body.compute() also sets:
	![[Pasted image 20250712032954.png]]
![[Pasted image 20250712033011.png]]

#### body.compute(observer)
![[Pasted image 20250712033307.png]]![[Pasted image 20250712033448.png]]
![[Pasted image 20250712033530.png]]

### catalog format
Bodies can be imported and exported in the popular XEphem format:
![[Pasted image 20250712033634.png]]

![[Pasted image 20250712033645.png]]

![[Pasted image 20250712033704.png]]

### bodies with orbital elements
![[Pasted image 20250712034315.png]]
![[Pasted image 20250712034354.png]]
![[Pasted image 20250712034448.png]]
### Other functions
![[Pasted image 20250712034608.png]]
![[Pasted image 20250712034709.png]]
![[Pasted image 20250712034740.png]]
![[Pasted image 20250712034758.png]]

### Coordinate conversion
![[Pasted image 20250712034908.png]]
![[Pasted image 20250712034944.png]]

### Observers
![[Pasted image 20250712035119.png]]
![[Pasted image 20250712035134.png]]![[Pasted image 20250712035234.png]]
![[Pasted image 20250712035344.png]]
![[Pasted image 20250712035430.png]]
![[Pasted image 20250712035457.png]]

### Observer.horizon
![[Pasted image 20250712035631.png]]

### other Observer methods
![[Pasted image 20250712035846.png]]

### Equinoxes and solstices
![[Pasted image 20250712035956.png]]

### Phases of the Moon
![[Pasted image 20250712040036.png]]

### Angles
![[Pasted image 20250712040637.png]]


### Dates
![[Pasted image 20250712040811.png]]
![[Pasted image 20250712040852.png]]

### Stars and Cities
![[Pasted image 20250712040909.png]]
![[Pasted image 20250712040946.png]]
## Catalogs
![[Pasted image 20250712052259.png]]