class astropy.nddata.InverseVariance(array=None, copy=True, unit=None)[source]#

Bases: _VariancePropagationMixin, NDUncertainty

Inverse variance uncertainty assuming first order Gaussian error propagation.

This class implements uncertainty propagation for addition, subtraction, multiplication and division with other instances of InverseVariance. The class can handle if the uncertainty has a unit that differs from (but is convertible to) the parents NDData unit. The unit of the resulting uncertainty will the inverse square of the unit of the resulting data. Also support for correlation is possible but requires the correlation as input. It cannot handle correlation determination itself.

args, kwargs

see NDUncertainty


Compare this example to that in StdDevUncertainty; the uncertainties in the examples below are equivalent to the uncertainties in StdDevUncertainty.

InverseVariance should always be associated with an NDData-like instance, either by creating it during initialization:

>>> from astropy.nddata import NDData, InverseVariance
>>> ndd = NDData([1,2,3], unit='m',
...              uncertainty=InverseVariance([100, 100, 100]))
>>> ndd.uncertainty  
InverseVariance([100, 100, 100])

or by setting it manually on the NDData instance:

>>> ndd.uncertainty = InverseVariance([25], unit='1/m^2', copy=True)
>>> ndd.uncertainty  

the uncertainty array can also be set directly:

>>> ndd.uncertainty.array = 0.25
>>> ndd.uncertainty


The unit will not be displayed.

Attributes Summary


True : InverseVariance allows to propagate correlated uncertainties.


"ivar" : InverseVariance implements inverse variance.

Attributes Documentation


True : InverseVariance allows to propagate correlated uncertainties.

correlation must be given, this class does not implement computing it by itself.


"ivar" : InverseVariance implements inverse variance.