astropy:docs

NDArithmeticMixin

class astropy.nddata.NDArithmeticMixin[source] [edit on github]

Bases: object

Mixin class to add arithmetic to an NDData object.

When subclassing, be sure to list the superclasses in the correct order so that the subclass sees NDData as the main superclass. See NDDataArray for an example.

Methods Summary

add(operand[, propagate_uncertainties]) Add another dataset (operand) to this dataset.
divide(operand[, propagate_uncertainties]) Divide another dataset (operand) to this dataset.
multiply(operand[, propagate_uncertainties]) Multiply another dataset (operand) to this dataset.
subtract(operand[, propagate_uncertainties]) Subtract another dataset (operand) to this dataset.

Methods Documentation

add(operand, propagate_uncertainties=True)[source] [edit on github]

Add another dataset (operand) to this dataset.

Parameters:

operand : NDData

The second operand in the operation a + b

propagate_uncertainties : bool

Whether to propagate uncertainties following the propagation rules defined by the class used for the uncertainty attribute.

Returns:

result : NDData

The resulting dataset

Notes

This method requires the datasets to have identical WCS properties, equivalent units, and identical shapes. Meta-data get set to None in the resulting dataset. The unit in the result is the same as the unit in self. Uncertainties are propagated, although correlated errors are not supported by any of the built-in uncertainty classes. If uncertainties are assumed to be correlated, a warning is issued by default (though this can be disabled via the astropy.nddata.conf.warn_unsupported_correlated configuration item). Values masked in either dataset before the operation are masked in the resulting dataset.

divide(operand, propagate_uncertainties=True)[source] [edit on github]

Divide another dataset (operand) to this dataset.

Parameters:

operand : NDData

The second operand in the operation a / b

propagate_uncertainties : bool

Whether to propagate uncertainties following the propagation rules defined by the class used for the uncertainty attribute.

Returns:

result : NDData

The resulting dataset

Notes

This method requires the datasets to have identical WCS properties, equivalent units, and identical shapes. Meta-data get set to None in the resulting dataset. The unit in the result is the same as the unit in self. Uncertainties are propagated, although correlated errors are not supported by any of the built-in uncertainty classes. If uncertainties are assumed to be correlated, a warning is issued by default (though this can be disabled via the astropy.nddata.conf.warn_unsupported_correlated configuration item). Values masked in either dataset before the operation are masked in the resulting dataset.

multiply(operand, propagate_uncertainties=True)[source] [edit on github]

Multiply another dataset (operand) to this dataset.

Parameters:

operand : NDData

The second operand in the operation a * b

propagate_uncertainties : bool

Whether to propagate uncertainties following the propagation rules defined by the class used for the uncertainty attribute.

Returns:

result : NDData

The resulting dataset

Notes

This method requires the datasets to have identical WCS properties, equivalent units, and identical shapes. Meta-data get set to None in the resulting dataset. The unit in the result is the same as the unit in self. Uncertainties are propagated, although correlated errors are not supported by any of the built-in uncertainty classes. If uncertainties are assumed to be correlated, a warning is issued by default (though this can be disabled via the astropy.nddata.conf.warn_unsupported_correlated configuration item). Values masked in either dataset before the operation are masked in the resulting dataset.

subtract(operand, propagate_uncertainties=True)[source] [edit on github]

Subtract another dataset (operand) to this dataset.

Parameters:

operand : NDData

The second operand in the operation a - b

propagate_uncertainties : bool

Whether to propagate uncertainties following the propagation rules defined by the class used for the uncertainty attribute.

Returns:

result : NDData

The resulting dataset

Notes

This method requires the datasets to have identical WCS properties, equivalent units, and identical shapes. Meta-data get set to None in the resulting dataset. The unit in the result is the same as the unit in self. Uncertainties are propagated, although correlated errors are not supported by any of the built-in uncertainty classes. If uncertainties are assumed to be correlated, a warning is issued by default (though this can be disabled via the astropy.nddata.conf.warn_unsupported_correlated configuration item). Values masked in either dataset before the operation are masked in the resulting dataset.

Page Contents