Skip to content

Commit

Permalink
docs: readme example and install
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrcia authored May 23, 2024
1 parent 81cded2 commit ac0d130
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,32 @@ A Python package to compute and visualize observation metrics for periodic event
In Astronomy, *portrait* is useful to answer the following questions:
- How much of an orbit with period $P$ has been observed given certain observation times? ([tutorial](https://portrait.readthedocs.io/en/latest/coverage.html))
- What period $P$ matches with this list of events? ([tutorial](https://portrait.readthedocs.io/en/latest/periodmatch.html))
- How a certain target must be observed to cover all orbits with periods lower than $P$ days?
- How a certain target must be observed to cover all orbits with periods lower than $P$ days?

Documentation at [portrait.readthedocs.io](https://portrait.readthedocs.io)

## Example
Given the range of periods you want to cover, here is how to compute the amout of phase covered by your observation times
```python
from portrait import coverage

time = ... # your observation times
periods = np.linspace(0.1, 10, 2000)

covered = coverage(times)(periods)
```
And plotting it with `matplotlib`
```python
import matplotlib.pyplot as plt

plt.subplot(111, xlabel="periods", ylabel="coverage")
plt.plot(periods, covered, c="0.5")
```

![image](https://github.com/lgrcia/portrait/assets/20612771/b1fdf523-c0ea-41fe-9b9f-246c9f77d7e6)

## Installation

```bash
pip install portrait
```

0 comments on commit ac0d130

Please sign in to comment.