Skip to content

Commit

Permalink
Update position docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanconn committed Aug 29, 2023
1 parent f8d0fcd commit c8cc287
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ska_sun/sun.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from Quaternion import Quat
from ska_helpers import chandra_models


CHANDRA_MODELS_PITCH_ROLL_FILE = "chandra_models/pitch_roll/pitch_roll_constraint.csv"

from . import conf
Expand Down Expand Up @@ -256,11 +255,25 @@ def position(time, method=None, **kwargs):
"""
Calculate the sun RA, Dec at the given ``time`` from Earth geocenter or Chandra.
The method for position determination may be explicitly set via kwarg to ``fast`` or
``accurate``. See `position_fast()` and `position_accurate` methods for details.
The default method behavior is set by ``ska_sun.conf.sun_position_method_default``,
currently set to `fast`.
The ``accurate`` method also supports the ``from_chandra`` kwarg.
Example::
>>> import ska_sun
>>> ska_sun.position('2008:002:00:01:02')
(281.90344855695275, -22.9892737322084)
>>> ska_sun.position('2008:002:00:01:02', method='accurate')
(281.7865848220755, -22.99607130644057)
>>> with ska_sun.conf.set_temp('sun_position_method_default', 'accurate'):
... ska_sun.position('2008:002:00:01:02')
(281.7865848220755, -22.99607130644057
>>> ska_sun.position('2008:002:00:01:02', method='accurate', from_chandra=True)
(281.80963749492935, -23.033877980418676)
:param time: Input time(s) (CxoTimeLike)
:param method: Method to use ("fast" | "accurate", default="fast")
Expand Down

0 comments on commit c8cc287

Please sign in to comment.