This is very related to #15300: it is confusing for users that Column has a unit attribute that is ignored in operations.
A few examples:
Treats values as radians even though the units are degrees:
>>> import astropy.table as at
>>> import numpy as np
>>> col1 = at.Column([1., 2., 3], unit="deg")
>>> np.sin(col1).value
array([0.84147098, 0.90929743, 0.14112001])
>>> np.sin(np.deg2rad(col1.value))
array([0.01745241, 0.0348995 , 0.05233596])
Ignores units in operations, but still returns a column with the unit of the first operand:
>>> col2 = at.Column([1., 2., 3], unit="rad")
>>> col1 + col2
<Column dtype='float64' unit='deg' length=3>
2.0
4.0
6.0
(and etc. for other operations, like multiplication)
However, if you do an operation between a Column with a unit and a Quantity, the units are used and we get a Quantity out:
>>> import astropy.units as u
>>> col1 * 5 * u.m
<Quantity [ 5., 10., 15.] deg m>
I think I'm in favor of adding a warning and suggestion to use QTable instead. I think we could just add this check to BaseColumn.__array_wrap__?
This is very related to #15300: it is confusing for users that
Columnhas a unit attribute that is ignored in operations.A few examples:
Treats values as radians even though the units are degrees:
Ignores units in operations, but still returns a column with the unit of the first operand:
(and etc. for other operations, like multiplication)
However, if you do an operation between a Column with a unit and a Quantity, the units are used and we get a Quantity out:
I think I'm in favor of adding a warning and suggestion to use
QTableinstead. I think we could just add this check toBaseColumn.__array_wrap__?