It looks like this functionality has been moved to a mixin, NDArithmeticMixin.
The example in the Arithmetic mixin documentation suggests to create one's own class and use that.
So your example would become:
from astropy.nddata import NDData, StdDevUncertainty, NDArithmeticMixin
class MyData(NDData, NDArithmeticMixin):
pass
x = MyData( 16.0, uncertainty=StdDevUncertainty( 4.0 ))
y = MyData( 361.0, uncertainty=StdDevUncertainty( 19.0 ))
z = x.add(y)
print(z)
print(z.uncertainty.array)
which gives:
MyData(377.0)
19.416487838947599
Update
The class NDDataArray
actually does what the above class MyData
does: it includes the three mixins (arithmetic, io & slicing).
That makes the above a bit simpler:
from astropy.nddata import StdDevUncertainty, NDDataArray
x = NDDataArray(16, uncertainty=StdDevUncertainty(4.0))
y = NDDataArray(361, uncertainty=StdDevUncertainty(19.0))
z = x.add(y)
print(z)
print(z.uncertainty.array)
I think this interface is rather clunky. Perhaps it clears up over time, to become as simple as
z = x + y
print(z)
377.0 +/- 19.416487838947599