Skip to content

Commit

Permalink
Fixes to Orbit
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Jul 21, 2023
1 parent 2cf4c16 commit ca0e8ae
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions galpy/orbit/Orbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -8213,7 +8213,11 @@ def _XYZvxvyvz(orb, thiso, *args, **kwargs):
obs[3] * obs[0] / Xsun / vo + obs[4] * obs[1] / Xsun / vo,
-obs[3] * obs[1] / Xsun / vo + obs[4] * obs[0] / Xsun / vo,
obs[5]
* (numpy.ones_like(Xsun) if obs[5].ndim == 0 else 1.0)
* (
numpy.ones_like(Xsun)
if isinstance(Xsun, numpy.ndarray) and obs[5].ndim == 0
else 1.0
)
/ vo,
]
),
Expand Down Expand Up @@ -8294,7 +8298,11 @@ def _XYZvxvyvz(orb, thiso, *args, **kwargs):
obs[3] * obs[0] / Xsun / vo + obs[4] * obs[1] / Xsun / vo,
-obs[3] * obs[1] / Xsun / vo + obs[4] * obs[0] / Xsun / vo,
obs[5]
* (numpy.ones_like(Xsun) if obs[5].ndim == 0 else 1.0)
* (
numpy.ones_like(Xsun)
if isinstance(Xsun, numpy.ndarray) and obs[5].ndim == 0
else 1.0
)
/ vo,
]
),
Expand Down Expand Up @@ -8413,7 +8421,7 @@ def _parse_radec_kwargs(orb, kwargs, vel=False, dontpop=False, thiso=None):
else:
vo = orb._vo
# Tile everything when thiso includes a time axis
if not thiso is None and thiso.shape[1] > orb.size:
if isinstance(obs, list) and not thiso is None and thiso.shape[1] > orb.size:
nt = thiso.shape[1] // orb.size
obs = [
numpy.tile(obs[ii], nt)
Expand Down

0 comments on commit ca0e8ae

Please sign in to comment.