Skip to content

Commit

Permalink
Added iris.planning.num_repeats() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
byrdie committed Jan 29, 2024
1 parent be78b8e commit 91a113e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iris/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""
Python package for analyzing observations from the Interface Region Imaging Spectrograph
"""
"""

from . import planning
23 changes: 23 additions & 0 deletions iris/planning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import astropy.units as u
import astropy.time

__all__ = [
"num_repeats",
]


def num_repeats(
time_start: str | astropy.time.Time,
time_stop: str | astropy.time.Time,
time_raster: u.Quantity,
time_slew: u.Quantity = 10 * u.min,
):
if not isinstance(time_start, astropy.time.Time):
time_start = astropy.time.Time(time_start)
if not isinstance(time_stop, astropy.time.Time):
time_stop = astropy.time.Time(time_stop)

result = (time_stop - time_start - time_slew) / time_raster
result = result.to(u.dimensionless_unscaled)

return result

0 comments on commit 91a113e

Please sign in to comment.