Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update transits example #57

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PyPredict is a C Python extension directly adapted from the ubiquitous [predict]
Originally written for the commodore 64, predict has a proven pedigree; We just aim to provide a convenient API.
PyPredict is a port of the predict codebase and should yield identical results.

If you think you've found an error in pypredict, please include output from predict on same inputs to the bug report.
If you think you've found an error in `pypredict`, please include output from `predict` on same inputs to the bug report.
If you think you've found a bug in predict, please report and we'll coordinate with upstream.

### Installation
Expand Down Expand Up @@ -70,21 +70,27 @@ predict.observe(tle, qth) # optional time argument defaults to time.time()
# }
```

#### Show upcoming transits of satellite over groundstation
#### Show upcoming transits of satellite over ground station

```python
p = predict.transits(tle, qth)
for _ in xrange(10):
transit = p.next()
print("%f\t%f\t%f" % (transit.start, transit.duration(), transit.peak()['elevation']))
# start and stop transit times as UNIX timestamp
transit_start = 1680775200
transit_stop = 1681034400

p = predict.transits(tle, qth, transit_start, transit_stop)

print("Start of Transit\tTransit Duration (s)\tPeak Elevation")
for transit in p:
print(f"{transit.start}\t{transit.duration()}\t{transit.peak()['elevation']}")
```


#### Modeling an entire constellation

Generating transits for a lot of satellites over a lot of groundstations can be slow.
Luckily, generating transits for each satellite-groundstation pair can be parallelized for a big speedup.
Generating transits for a lot of satellites over a lot of ground stations can be slow.
Luckily, generating transits for each satellite-groundstation pair can be parallelized for a big speed-up.

```
```python
import itertools
from multiprocessing.pool import Pool
import time
Expand Down Expand Up @@ -117,7 +123,7 @@ transits = flattened_results
```

NOTE: If precise accuracy isn't necessary (for modeling purposes, for example) setting the tolerance argument
to the `above` call to a larger value, say 1 degree, can provide a signifigant performance boost.
to the `above` call to a larger value, say 1 degree, can provide a significant performance boost.

#### Call predict analogs directly

Expand Down