Constant

class astropy.constants.Constant(abbrev, name, value, unit, uncertainty, reference=None, system=None)[source]

Bases: Quantity

A physical or astronomical constant.

These objects are quantities that are meant to represent physical constants.

Parameters:
abbrevpython:str

A typical ASCII text abbreviation of the constant, generally the same as the Python variable used for this constant.

namepython:str

Full constant name.

valuenumbers.Real

Constant value. Note that this should be a bare number, not a Quantity.

unitpython:str

String representation of the constant units.

uncertaintynumbers.Real

Absolute uncertainty in constant value. Note that this should be a bare number, not a Quantity.

referencepython:str, optional

Reference where the value is taken from.

systempython:str

System of units in which the constant is defined. This can be None when the constant’s units can be directly converted between systems.

Attributes Summary

abbrev

A typical ASCII text abbreviation of the constant, also generally the same as the Python variable used for this constant.

cgs

If the Constant is defined in the CGS system return that instance of the constant, else convert to a Quantity in the appropriate CGS units.

name

The full name of the constant.

reference

The source used for the value of this constant.

si

If the Constant is defined in the SI system return that instance of the constant, else convert to a Quantity in the appropriate SI units.

system

The system of units in which this constant is defined (typically None so long as the constant's units can be directly converted between systems).

uncertainty

The known absolute uncertainty in this constant's value.

Methods Summary

copy()

Return a copy of this Constant instance.

Attributes Documentation

abbrev

A typical ASCII text abbreviation of the constant, also generally the same as the Python variable used for this constant.

cgs

If the Constant is defined in the CGS system return that instance of the constant, else convert to a Quantity in the appropriate CGS units.

name

The full name of the constant.

reference

The source used for the value of this constant.

si

If the Constant is defined in the SI system return that instance of the constant, else convert to a Quantity in the appropriate SI units.

system

The system of units in which this constant is defined (typically None so long as the constant’s units can be directly converted between systems).

uncertainty

The known absolute uncertainty in this constant’s value.

Methods Documentation

copy()[source]

Return a copy of this Constant instance. Since they are by definition immutable, this merely returns another reference to self.