Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch '5-restructure-spherical-harmonics-code-so-that-it-is-mo…
Browse files Browse the repository at this point in the history
…re-modular-than-at-present' of github.com:MintonGroup/swiftest into 5-restructure-spherical-harmonics-code-so-that-it-is-more-modular-than-at-present
  • Loading branch information
anand43 committed Feb 27, 2024
2 parents 2bfd4c7 + bf70692 commit a20f02a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ def solar_system_horizons(name: str,
if param['ROTATION']:
Ip = Ipsun
rot = rotcb
if param['IN_FORM'] == 'XV':
rh = np.array([0.0, 0.0, 0.0])
vh = np.array([0.0, 0.0, 0.0])
elif param['IN_FORM'] == 'EL':
a = np.nan
e = np.nan
inc = np.nan
capom = np.nan
omega = np.nan
capm = np.nan
else: # Fetch solar system ephemerides from Horizons
if ephemeris_id is None:
ephemeris_id = name
Expand Down
13 changes: 13 additions & 0 deletions swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -2635,6 +2635,19 @@ def input_to_clm_array(val, n):
if is_central_body:
if a is not None or e is not None or inc is not None or capom is not None or omega is not None or capm is not None:
raise ValueError("Orbital elements cannot be passed for a central body.")
if nbodies > 1:
raise ValueError("Only one central body may be passed.")
if rh is None:
rh = np.zeros((1,3))
if vh is None:
vh = np.zeros((1,3))
a = np.nan
e = np.nan
inc = np.nan
capom = np.nan
omega = np.nan
capm = np.nan


dsnew = init_cond.vec2xr(self.param, name=name, a=a, e=e, inc=inc, capom=capom, omega=omega, capm=capm, id=id,
Gmass=Gmass, radius=radius, rhill=rhill, Ip=Ip, rh=rh, vh=vh,rot=rot, j2rp2=J2, j4rp4=J4, c_lm=c_lm, rotphase=rotphase, time=time)
Expand Down

0 comments on commit a20f02a

Please sign in to comment.