VarianceUncertainty¶

class
astropy.nddata.
VarianceUncertainty
(array=None, copy=True, unit=None)[source]¶ Bases:
astropy.nddata.nduncertainty._VariancePropagationMixin
,astropy.nddata.NDUncertainty
Variance uncertainty assuming first order Gaussian error propagation.
This class implements uncertainty propagation for
addition
,subtraction
,multiplication
anddivision
with other instances ofVarianceUncertainty
. The class can handle if the uncertainty has a unit that differs from (but is convertible to) the parentsNDData
unit. The unit of the resulting uncertainty will be the 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. Parameters
 args, kwargs :
see
NDUncertainty
Examples
Compare this example to that in
StdDevUncertainty
; the uncertainties in the examples below are equivalent to the uncertainties inStdDevUncertainty
.VarianceUncertainty
should always be associated with anNDData
like instance, either by creating it during initialization:>>> from astropy.nddata import NDData, VarianceUncertainty >>> ndd = NDData([1,2,3], unit='m', ... uncertainty=VarianceUncertainty([0.01, 0.01, 0.01])) >>> ndd.uncertainty VarianceUncertainty([0.01, 0.01, 0.01])
or by setting it manually on the
NDData
instance:>>> ndd.uncertainty = VarianceUncertainty([0.04], unit='m^2', copy=True) >>> ndd.uncertainty VarianceUncertainty([0.04])
the uncertainty
array
can also be set directly:>>> ndd.uncertainty.array = 4 >>> ndd.uncertainty VarianceUncertainty(4)
Note
The unit will not be displayed.
Attributes Summary
True
:VarianceUncertainty
allows to propagate correlated uncertainties."var"
:VarianceUncertainty
implements variance.Attributes Documentation
True
:VarianceUncertainty
allows to propagate correlated uncertainties.correlation
must be given, this class does not implement computing it by itself.

uncertainty_type
¶ "var"
:VarianceUncertainty
implements variance.