QFloat#
- class astropop.math.physical.QFloat(value, uncertainty=None, unit=None)#
Bases:
objectStoring float values with stddev uncertainties and units.
- Parameters:
- valuenumber,
QFloator array_like Nominal value(s) of the quantity. Must be a real number, array of real numbers or a QFloat.
- uncertaintynumber, array_like or
None(optional) Uncertainty value of the quantity. If
None, the quantity will be considered with no errors. Must matchvalueshape.- unit
Unitor string (optional) The data unit. Must be
Unitcompliant.
- valuenumber,
Notes
This class don’t support memmapping. Is intended to be in memory ops.
Units are handled by
units.Math operations cares about units and uncertainties.
Attributes Summary
Nominal value of the quantity.
Shape of the quantity.
Number of significant digits.
Number of elements in the quantity.
Alias for uncertainty.
Uncertainty of the quantity.
Physical unit of the data.
Same as nominal.
Methods Summary
Attributes Documentation
- nominal#
Nominal value of the quantity.
- shape#
Shape of the quantity.
- sig_digits#
Number of significant digits.
- size#
Number of elements in the quantity.
- std_dev#
Alias for uncertainty.
- uncertainty#
Uncertainty of the quantity.
- unit#
Physical unit of the data.
- value#
Same as nominal. For Astropy compatibility.
Methods Documentation
- reset(value, uncertainty=None, unit=None)#
Reset all the data.
- Parameters:
- to(unit)#
Convert this QFloat to another unit.
- Parameters:
- - unit: string or `~astropy.units.UnitBase`
Unit to converto to.
- Returns:
- QFloat:
A new instance of this class, converted to the new unit.