diff --git a/iris/__init__.py b/iris/__init__.py index ef0c456..85a91bf 100644 --- a/iris/__init__.py +++ b/iris/__init__.py @@ -1,3 +1,5 @@ """ Python package for analyzing observations from the Interface Region Imaging Spectrograph -""" \ No newline at end of file +""" + +from . import planning diff --git a/iris/planning.py b/iris/planning.py new file mode 100644 index 0000000..fea6e0b --- /dev/null +++ b/iris/planning.py @@ -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