radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
95 stars 61 forks source link

Spectral cube arithmetic is non-commutative when combined with quantities #839

Open keflavich opened 1 year ago

keflavich commented 1 year ago
from spectral_cube import SpectralCube
from astropy import units as u
cube = SpectralCube.read('http://www.astropy.org/astropy-data/l1448/l1448_13co.fits')
fivecube = cube * 5  # all good, this is a cube
failure = 5 * cube  # kinda ok, this raises an exception
bug = 5*u.km * cube  # this results in a numpy array