sbpy icon indicating copy to clipboard operation
sbpy copied to clipboard

Fill delta and phase angle from rh and solar elongation

Open mkelley opened this issue 3 years ago • 3 comments

Ephem objects can be manually populated with arbitrary data. Add a method that helps users generate geometrically sound values:

>>> import astropy.units as u
>>> from sbpy.data import Ephem
>>> eph = Ephem.from_dict({'rh': [2] * u.au,
...                        'solar_elongation': [90] * u.deg})
>>> eph.fill_delta_and_phase()
>>> print(eph)
<QTable length=1>
   rh   solar_elongation       delta              phase       
   AU         deg                AU                deg        
float64     float64           float64            float64      
------- ---------------- ------------------ ------------------
    2.0             90.0 1.7320508075688772 30.000000000000004

mkelley avatar May 26 '22 18:05 mkelley

Hello @mkelley! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2022-07-07 02:19:34 UTC

pep8speaks avatar May 26 '22 18:05 pep8speaks

First needs PR #337

mkelley avatar Jun 04 '22 17:06 mkelley

Maybe I could rework this into fill(field), where field is rh, delta, phase, or solar elongation?

mkelley avatar Jun 04 '22 17:06 mkelley