Satellite LOS visibility calculator
Project description
satvis: A satellite visibility calculator.
Description
satvis is a small library of functions used to calculate line-of-sight (LOS) visibility between spacecraft and plot access windows. The core functions that the library is based on are implementations of algorithms developed by J. A. Lawton and Salvatore Alfano et. al. Visibility windows are represented as IntervalTree
s. Access windows are plotted using matplotlib.
Install
pip install satvis
Examples
Example 1
To calculate the visibility between two Earth-centered-inertial (ECI) points:
earth_radius = 6378 # km
extra_height = 0 # km
r1 = array([[earth_radius + 400, 0, 0]]).transpose() # position of object 1
r2 = array([[earth_radius, 0, 0]]).transpose() # position of object 2
[vis, phi, a1, a2] = visibilityFunc(r1, r2, earth_radius, extra_height)
print(vis)
print(phi)
print(a1)
print(a2)
# Prints:
# 0.3451182504723773
# 0.00014753614577624565
# 0.34526578661815355
# 0.0
where vis
is the value of the visibility function, phi
is the angle (in radians) drawn between the two Earth-centered-inertial points, and a1
and a2
are intermediate construction angles. A value of vis
>0 means that the two points have a direct LOS to each other.
Example 2
If you just want to know if two points are visible to each other in a binary fashion, use isVis
:
[vis_bool] = isVis(r1, r2, earth_radius, extra_height)
print(vis_bool)
# True
Example 3
A series of visibility function values can be represented as a couple of ndarray
s or an IntervalTree
via the zeroCrossingFit
function. This is handy if you want to calculate visibility windows between two objects.
t = array([0, 1, 2, 3, 4]) # time vector
vis = array([-1, -0.1, 0.5, 4, 2]) # objects become visible to each other between t[1] and t[2]
[crossings, rise_set, vis_tree] = zeroCrossingFit(vis, t)
print(crossings)
print(rise_set)
print(vis_tree)
# Prints:
# [1.40896106]
# [1.]
# tree=IntervalTree([Interval(1.4089610649024726, 4)])
Where crossings
is a list of times at which the visibility function value crosses zero, rise_set
indicates the direction of the crossing (1=rise, -1=set), and tree
is an IntervalTree
indicating time windows during which the visibility function value is positive. See the IntervalTree package on GitHub for details on its structure.
Example 4
If the two objects never see each other, the returned arrays and IntervalTree
are empty.
vis = array([-1, -0.1, -0.5, -4, -2])
[crossings, rise_set, vis_tree] = zeroCrossingFit(vis, t)
print(crossings)
print(rise_set)
print(vis_tree)
# []
# []
# IntervalTree()
Example 5
You can assign an identifier to Interval
s within an IntervalTree
. This is useful if you combine multiple IntervalTree
s representing more than two objects.
vis1 = array([-1, -0.1, 0.5, 4, 2])
vis2 = array([-2, -1, -0.5, 1, 1.1])
[_, _, vis_tree1] = zeroCrossingFit(vis1, t, "pair1")
[_, _, vis_tree2] = zeroCrossingFit(vis2, t, "pair2")
combined_tree = vis_tree1 | vis_tree2
print(vis_tree1)
print(vis_tree2)
print(combined_tree)
# tree=IntervalTree([Interval(1.4089610649024726, 4, 'pair1)])
# tree=IntervalTree([Interval(2.328702338492417, 4, 'pair2')])
# IntervalTree([Interval(1.4089610649024726, 4, 'pair1'), Interval(2.328702338492417, 4, 'pair2')])
Citations:
- Alfano, Salvatore & Jr, Negron, & Moore, Jennifer. (1992). Rapid Determination of Satellite Visibility Periods. Journal of The Astronautical Sciences. Vol. 40, April-June, pp 281-296.
- Lawton, J. A.. (1987). Numerical Method for Rapidly Determining Satellite-Satellite and Satellite-Ground Station In-View Periods. Journal of Guidance, Navigation and Control. Vol. 10, January-February, pp. 32-36
- Chaim Leib Halbert's IntervalTree package on GitHub, https://pypi.org/project/intervaltree/#description
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file satvis-0.1.1.tar.gz
.
File metadata
- Download URL: satvis-0.1.1.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f45ea52cd4757aa471ca98523ca64638be9f434701cba25ec7c9f3705c91dbf |
|
MD5 | bbe773d21ca6e100c604f1e109619eef |
|
BLAKE2b-256 | 33daf632d2e1789eed6a7dca8b179602347d67ad3443cfa70b9b2cbfcb4508ed |
File details
Details for the file satvis-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: satvis-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b9b4da32bcd9505949141dea3fc2fd9ecb00cd59cfc0fcfe2428a608afe9a70 |
|
MD5 | fea3e424c433d6ca87a0d5c2d7fb8fd7 |
|
BLAKE2b-256 | bfd458ee26cde2757520472af72293781ddf8d97ac39baf3be27ed8921f3798d |