Repository navigation
Non scalar times - #5085
Non scalar times#5085
Conversation
| """ | ||
| try: | ||
| rmat = np.array([rotation_matrix(this_obl, 'x') for this_obl in obl]) | ||
| result = np.einsum('...ij,...jk->...ik', rmat, rnpb) |
There was a problem hiding this comment.
In numpy >=1.10, this is more efficiently done with np.matmul. Since eventually this should be used, we may as well replace now with (matmul should work for scalar case too):
from ...utils.compat import NUMPY_LT_1_10
if NUMPY_LT_1_10:
try:
result = np.einsum('...ij,...jk->...ik', rmat, rnpb)
...
else:
result = np.matmul(rmat, rnpb)
| into a new array. | ||
| """ | ||
| try: | ||
| rmat = np.array([rotation_matrix(this_obl, 'x') for this_obl in obl]) |
There was a problem hiding this comment.
I was about to write that this seemed to be something rotation_matrix should be able to handle, when I realised it could not because it returns np.matrix. So, not for this PR, but see #5088.
|
@StuartLittlefair - could you also add a direct test for multidimensional ecliptic transforms? Ideally, more than 1-D, though that may well break other parts... |
|
Noting @mhvk's comment about this I ran into some problems with non-1D arrays... But I think that's better addressed as a speparate PR, as this at least gets the 1d case working. So merging! |
|
@StuartLittlefair - fair enough - I've been seeing if I can get some "quick fix" solution for this particular pathway in time for 1.2, but #5088 is definitely a better solution once we can get it in. |
This PR makes changes which ensure that
coordinates.get_mooncan handle non-scalar times when using the builtin ephemeris. This PR fixes #5069.