Skip to content

Commit

Permalink
Merge pull request #57 from hefnawi7/ahmed-update-transits-example
Browse files Browse the repository at this point in the history
update transits example
  • Loading branch information
hefnawi7 committed Apr 11, 2023
2 parents 89b8c01 + 4a943b7 commit c76e2ed
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions README.md
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

0 comments on commit c76e2ed

Please sign in to comment.